Top Description Fields Constructors Methods
org.apache.commons.lang3

public Class ClassLoaderUtils

extends Object
Class Inheritance
Imports
java.net.URL, .URLClassLoader, java.util.Arrays, .Objects

Helps work with ClassLoader.
Since
3.10

Field Summary

Modifier and TypeField and Description
private static final URL[]

Constructor Summary

AccessConstructor and Description
public
ClassLoaderUtils()
Deprecated TODO Make private in 4.0.

Make private in 4.0.

Method Summary

Modifier and TypeMethod and Description
public static URL[]

Returns:

the system class loader's URLs, if any.
getSystemURLs
()

Gets the system class loader's URLs, if any.

public static URL[]

Returns:

the current thread's context class loader's URLs, if any.
getThreadURLs
()

Gets the current thread's context class loader's URLs, if any.

private static URL[]
getURLs(final ClassLoader cl)

public static String

Returns:

the formatted string.
toString
(final ClassLoader
to URLClassLoader to convert.
classLoader
)

Converts the given class loader to a String calling toString(URLClassLoader).

public static String

Returns:

the formatted string.
toString
(final URLClassLoader
to URLClassLoader to convert.
classLoader
)

Converts the given URLClassLoader to a String in the format "URLClassLoader.toString() + [URL1, URL2, ...]".

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

EMPTY_URL_ARRAYback to summary
private static final URL[] EMPTY_URL_ARRAY

Constructor Detail

ClassLoaderUtilsback to summary
public ClassLoaderUtils()

Deprecated

TODO Make private in 4.0.

Make private in 4.0.

Annotations
@Deprecated

Method Detail

getSystemURLsback to summary
public static URL[] getSystemURLs()

Gets the system class loader's URLs, if any.

Returns:URL[]

the system class loader's URLs, if any.

Since
3.13.0
getThreadURLsback to summary
public static URL[] getThreadURLs()

Gets the current thread's context class loader's URLs, if any.

Returns:URL[]

the current thread's context class loader's URLs, if any.

Since
3.13.0
getURLsback to summary
private static URL[] getURLs(final ClassLoader cl)
toStringback to summary
public static String toString(final ClassLoader classLoader)

Converts the given class loader to a String calling toString(URLClassLoader).

Parameters
classLoader:ClassLoader

to URLClassLoader to convert.

Returns:String

the formatted string.

toStringback to summary
public static String toString(final URLClassLoader classLoader)

Converts the given URLClassLoader to a String in the format "URLClassLoader.toString() + [URL1, URL2, ...]".

Parameters
classLoader:URLClassLoader

to URLClassLoader to convert.

Returns:String

the formatted string.