Sdílet prostřednictvím


URLClassLoader Constructors

Definition

Overloads

URLClassLoader(URL[])

Constructs a new URLClassLoader for the specified URLs using the default delegation parent ClassLoader.

URLClassLoader(URL[], ClassLoader)

Constructs a new URLClassLoader for the given URLs.

URLClassLoader(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

URLClassLoader(URL[], ClassLoader, IURLStreamHandlerFactory)

Constructs a new URLClassLoader for the specified URLs, parent class loader, and URLStreamHandlerFactory.

URLClassLoader(URL[])

Constructs a new URLClassLoader for the specified URLs using the default delegation parent ClassLoader.

[Android.Runtime.Register(".ctor", "([Ljava/net/URL;)V", "")]
public URLClassLoader (Java.Net.URL[]? urls);
[<Android.Runtime.Register(".ctor", "([Ljava/net/URL;)V", "")>]
new Java.Net.URLClassLoader : Java.Net.URL[] -> Java.Net.URLClassLoader

Parameters

urls
URL[]

the URLs from which to load classes and resources

Attributes

Remarks

Constructs a new URLClassLoader for the specified URLs using the default delegation parent ClassLoader. The URLs will be searched in the order specified for classes and resources after first searching in the parent class loader. Any URL that ends with a '/' is assumed to refer to a directory. Otherwise, the URL is assumed to refer to a JAR file which will be downloaded and opened as needed.

If there is a security manager, this method first calls the security manager's checkCreateClassLoader method to ensure creation of a class loader is allowed.

Java documentation for java.net.URLClassLoader.URLClassLoader(java.net.URL[]).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

URLClassLoader(URL[], ClassLoader)

Constructs a new URLClassLoader for the given URLs.

[Android.Runtime.Register(".ctor", "([Ljava/net/URL;Ljava/lang/ClassLoader;)V", "")]
public URLClassLoader (Java.Net.URL[]? urls, Java.Lang.ClassLoader? parent);
[<Android.Runtime.Register(".ctor", "([Ljava/net/URL;Ljava/lang/ClassLoader;)V", "")>]
new Java.Net.URLClassLoader : Java.Net.URL[] * Java.Lang.ClassLoader -> Java.Net.URLClassLoader

Parameters

urls
URL[]

the URLs from which to load classes and resources

parent
ClassLoader

the parent class loader for delegation

Attributes

Remarks

Constructs a new URLClassLoader for the given URLs. The URLs will be searched in the order specified for classes and resources after first searching in the specified parent class loader. Any URL that ends with a '/' is assumed to refer to a directory. Otherwise, the URL is assumed to refer to a JAR file which will be downloaded and opened as needed.

If there is a security manager, this method first calls the security manager's checkCreateClassLoader method to ensure creation of a class loader is allowed.

Java documentation for java.net.URLClassLoader.URLClassLoader(java.net.URL[], java.lang.ClassLoader).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

URLClassLoader(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

protected URLClassLoader (IntPtr javaReference, Android.Runtime.JniHandleOwnership transfer);
new Java.Net.URLClassLoader : nativeint * Android.Runtime.JniHandleOwnership -> Java.Net.URLClassLoader

Parameters

javaReference
IntPtr

nativeint

A IntPtrcontaining a Java Native Interface (JNI) object reference.

transfer
JniHandleOwnership

A JniHandleOwnershipindicating how to handle javaReference

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

URLClassLoader(URL[], ClassLoader, IURLStreamHandlerFactory)

Constructs a new URLClassLoader for the specified URLs, parent class loader, and URLStreamHandlerFactory.

[Android.Runtime.Register(".ctor", "([Ljava/net/URL;Ljava/lang/ClassLoader;Ljava/net/URLStreamHandlerFactory;)V", "")]
public URLClassLoader (Java.Net.URL[]? urls, Java.Lang.ClassLoader? parent, Java.Net.IURLStreamHandlerFactory? factory);
[<Android.Runtime.Register(".ctor", "([Ljava/net/URL;Ljava/lang/ClassLoader;Ljava/net/URLStreamHandlerFactory;)V", "")>]
new Java.Net.URLClassLoader : Java.Net.URL[] * Java.Lang.ClassLoader * Java.Net.IURLStreamHandlerFactory -> Java.Net.URLClassLoader

Parameters

urls
URL[]

the URLs from which to load classes and resources

parent
ClassLoader

the parent class loader for delegation

factory
IURLStreamHandlerFactory

the URLStreamHandlerFactory to use when creating URLs

Attributes

Remarks

Constructs a new URLClassLoader for the specified URLs, parent class loader, and URLStreamHandlerFactory. The parent argument will be used as the parent class loader for delegation. The factory argument will be used as the stream handler factory to obtain protocol handlers when creating new jar URLs.

If there is a security manager, this method first calls the security manager's checkCreateClassLoader method to ensure creation of a class loader is allowed.

Java documentation for java.net.URLClassLoader.URLClassLoader(java.net.URL[], java.lang.ClassLoader, java.net.URLStreamHandlerFactory).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to