Interface ClassPathElement
-
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
AbstractClassPathElement,DirectoryClassPathElement,FilteredClassPathElement,JarClassPathElement,MemoryClassPathElement
public interface ClassPathElement extends Closeable
Represents an element on the virtual classpath, such as a jar file or classes directory.
-
-
Field Summary
Fields Modifier and Type Field Description static ClassPathElementEMPTY
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static ClassPathElementfromPath(Path path)Creates an element from a file system pathManifestgetManifest()ProtectionDomaingetProtectionDomain(ClassLoader classLoader)Set<String>getProvidedResources()Returns a set of all known resources.ClassPathResourcegetResource(String name)Loads a resource from the class path element, or null if it does not exist.PathgetRoot()
-
-
-
Field Detail
-
EMPTY
static final ClassPathElement EMPTY
-
-
Method Detail
-
getRoot
Path getRoot()
- Returns:
- The element root, or null if not applicable
-
getResource
ClassPathResource getResource(String name)
Loads a resource from the class path element, or null if it does not exist.- Parameters:
name- The resource to load- Returns:
- An representation of the class path resource if it exists
-
getProvidedResources
Set<String> getProvidedResources()
Returns a set of all known resources.- Returns:
- A set representing all known resources
-
getProtectionDomain
ProtectionDomain getProtectionDomain(ClassLoader classLoader)
- Returns:
- The protection domain that should be used to define classes from this element
-
getManifest
Manifest getManifest()
-
fromPath
static ClassPathElement fromPath(Path path)
Creates an element from a file system path
-
-