public class ClasspathUtils extends Object
Constructor and Description |
---|
ClasspathUtils() |
Modifier and Type | Method and Description |
---|---|
static List<String> |
getClassesFromJar(URL jarUrl)
Get a list of class files in the JAR specified by a URL.
|
static ClasspathClasses |
getClassesInClasspathJars()
Gets a list of JARs from the thread context classloader, and returns a ClasspathClasses object with the class file names and
the JARs which they appear in.
|
static List<URL> |
getClassLoaderClasspath(ClassLoader classloader)
Get the classpath searched for by a particular classloader (only supports
URLClassLoader s presently) |
static ClasspathClasses |
getFilesInClasspathJars()
Gets a list of JARs from the thread context classloader, and returns a ClasspathClasses object with the class file names and
the JARs which they appear in.
|
static Optional<File> |
getJarFileFromClass(Class clazz)
If the provided class has been loaded from a jar file, will find the absolute path to that jar file.
|
static URL[] |
getSystemClasspath()
Deprecated.
since 7.0.1
|
static List<ClassLoader> |
getThreadContentClassLoaderHierarchy()
Get a list of classloaders in the thread context classloader hierarchy
|
static URL[] |
getThreadContextClasspath()
This method will return an array of URLs used by the thread context classloader and its parent classloaders.
|
@Deprecated public static URL[] getSystemClasspath()
public static URL[] getThreadContextClasspath()
public static List<ClassLoader> getThreadContentClassLoaderHierarchy()
public static List<URL> getClassLoaderClasspath(ClassLoader classloader)
URLClassLoader
s presently)classloader
- to examinepublic static List<String> getClassesFromJar(URL jarUrl)
jarUrl
- the URL of a JAR on the classpath, such as one of the items in the list returned by
getClassLoaderClasspath(ClassLoader)
public static ClasspathClasses getClassesInClasspathJars()
getThreadContextClasspath()
public static ClasspathClasses getFilesInClasspathJars()
getThreadContextClasspath()
Copyright © 2003–2020 Atlassian. All rights reserved.