public abstract class ClasspathUtil
extends java.lang.Object
Constructor and Description |
---|
ClasspathUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.ClassLoader |
classLoader(java.lang.Class cls)
Returns the class loader for the specified class.
|
static java.net.URL |
locate(java.lang.Class cls)
Returns the resource URL corresponding the the specified class.
|
static java.net.URL |
locate(java.lang.Class cls,
java.lang.String path)
Returns the resource URL corresponding the the specified path.
|
static java.io.File |
locateFile(java.lang.Class cls)
Returns the file containing the specified class.
|
static java.util.jar.Manifest |
manifest(java.lang.Class cls)
Returns the manifest for the JAR file containing the specified class.
|
static java.lang.String |
manifestAttribute(java.lang.Class cls,
java.lang.String name)
Returns a single attribute value from the JAR manifest for a class.
|
public static java.lang.ClassLoader classLoader(java.lang.Class cls)
cls
- the class to checkpublic static java.net.URL locate(java.lang.Class cls)
cls
- the class to checkpublic static java.net.URL locate(java.lang.Class cls, java.lang.String path)
cls
- the base class (loader) to usepath
- the resource pathpublic static java.io.File locateFile(java.lang.Class cls)
cls
- the class to checkpublic static java.util.jar.Manifest manifest(java.lang.Class cls)
cls
- the class to checkpublic static java.lang.String manifestAttribute(java.lang.Class cls, java.lang.String name)
cls
- the class to checkname
- the main attribute name