java.lang.AutoCloseable
, ResourceLoader
NativeLibraryResourceLoader
public abstract class AbstractResourceLoader extends java.lang.Object implements ResourceLoader
Modifier | Constructor | Description |
---|---|---|
protected |
AbstractResourceLoader() |
Construct a new instance.
|
Modifier and Type | Method | Description |
---|---|---|
ClassSpec |
getClassSpec(java.lang.String fileName) |
Get the class specification for the given class name.
|
java.lang.String |
getLibrary(java.lang.String name) |
Get the absolute physical filesystem path for a library with the given name.
|
PackageSpec |
getPackageSpec(java.lang.String name) |
Get the package specification for the given directory name.
|
protected static PackageSpec |
getPackageSpec(java.lang.String name,
java.util.jar.Manifest manifest,
java.net.URL rootUrl) |
Convenience method to get a package specification from a
Manifest . |
java.util.Collection<java.lang.String> |
getPaths() |
Get the collection of resource paths.
|
Resource |
getResource(java.lang.String name) |
Get a resource with the given name.
|
java.lang.String |
getRootName() |
Get the name of the root represented by this resource loader.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, createSubloader, getLocation
protected AbstractResourceLoader()
protected static PackageSpec getPackageSpec(java.lang.String name, java.util.jar.Manifest manifest, java.net.URL rootUrl)
Manifest
.name
- the (dot-separated) package namemanifest
- the Manifest
instancerootUrl
- the code source URLpublic java.lang.String getRootName()
ResourceLoader
getRootName
in interface ResourceLoader
public ClassSpec getClassSpec(java.lang.String fileName) throws java.io.IOException
ResourceLoader
null
is returned.getClassSpec
in interface ResourceLoader
fileName
- the fileName of the class, e.g. for the class org.jboss.modules.ResourceLoader
the fileName will be org/jboss/modules/ResourceLoader.class
null
if the named class is not foundjava.io.IOException
- if an I/O error occurspublic PackageSpec getPackageSpec(java.lang.String name) throws java.io.IOException
ResourceLoader
/
" separators.getPackageSpec
in interface ResourceLoader
name
- the directory namejava.io.IOException
- if an I/O error occurspublic Resource getResource(java.lang.String name)
ResourceLoader
null
is returned.
The resource name will always be specified using "/
" separators for the directory segments.getResource
in interface ResourceLoader
name
- the resource namenull
if it is not availablepublic java.lang.String getLibrary(java.lang.String name)
ResourceLoader
/
" characters.getLibrary
in interface ResourceLoader
name
- the namenull
if the library is not presentpublic java.util.Collection<java.lang.String> getPaths()
ResourceLoader
/
" characters to separate the path segments.getPaths
in interface ResourceLoader
Copyright © 2022 JBoss by Red Hat. All rights reserved.