com.atlassian.confluence.util
Class ClasspathUtils

java.lang.Object
  extended bycom.atlassian.confluence.util.ClasspathUtils

public class ClasspathUtils
extends Object

Classpath discovery utilities


Constructor Summary
ClasspathUtils()
           
 
Method Summary
static List getClassLoaderClasspath(ClassLoader classloader)
          Get the classpath searched for by a particular classloader (only supports URLClassLoaders presently)
static URL[] getSystemClasspath()
          This method will return an array of URLs used by the system classloader.
static List 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClasspathUtils

public ClasspathUtils()
Method Detail

getSystemClasspath

public static URL[] getSystemClasspath()
This method will return an array of URLs used by the system classloader. If the system classloader is not an instance of URLClassLoader, this method will return null

Returns:
Array of URLs in classpath lookup order or null if system classloader does not support classpath discovery

getThreadContextClasspath

public static URL[] getThreadContextClasspath()
This method will return an array of URLs used by the thread context classloader. This method will search the classloader hierarchy for all classloaders of class URLClassLoader and return all URLs searched by these classloaders in order of discovery. If no such classloaders are found this method will return null

Returns:
Array of URLs in classpath as reported by all URLClassLoaders in the classloader hierarchy, null if no such classloaders exist.

getThreadContentClassLoaderHierarchy

public static List getThreadContentClassLoaderHierarchy()
Get a list of classloaders in the thread context classloader hierarchy

Returns:
list of classloaders in order of delegation

getClassLoaderClasspath

public static List getClassLoaderClasspath(ClassLoader classloader)
Get the classpath searched for by a particular classloader (only supports URLClassLoaders presently)

Parameters:
classloader - to examine
Returns:
List of paths searched on by the classloader, or null if the classloader does not support path discovery


Confluence is developed by Atlassian.