java.lang.AutoCloseable
IterableResourceLoader
AbstractResourceLoader
, NativeLibraryResourceLoader
public interface ResourceLoader
extends java.lang.AutoCloseable
Modifier and Type | Method | Description |
---|---|---|
default void |
close() |
Closes this resource, relinquishing any underlying resources.
|
default ResourceLoader |
createSubloader(java.lang.String relativePath,
java.lang.String rootName) |
Create a loader which loads resources under a relative subdirectory relative to this loader.
|
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.
|
default java.net.URI |
getLocation() |
Get the base location of the resources in this loader (if any).
|
PackageSpec |
getPackageSpec(java.lang.String name) |
Get the package specification for the given directory name.
|
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.
|
default java.lang.String |
getRootName() |
Deprecated.
|
@Deprecated default java.lang.String getRootName()
ClassSpec getClassSpec(java.lang.String fileName) throws java.io.IOException
null
is returned.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 occursPackageSpec getPackageSpec(java.lang.String name) throws java.io.IOException
/
" separators.name
- the directory namejava.io.IOException
- if an I/O error occursResource getResource(java.lang.String name)
null
is returned.
The resource name will always be specified using "/
" separators for the directory segments.name
- the resource namenull
if it is not availablejava.lang.String getLibrary(java.lang.String name)
/
" characters.name
- the namenull
if the library is not presentjava.util.Collection<java.lang.String> getPaths()
/
" characters to separate the path segments.default void close()
try
-with-resources statement.close
in interface java.lang.AutoCloseable
default java.net.URI getLocation()
null
is returned.null
if not availabledefault ResourceLoader createSubloader(java.lang.String relativePath, java.lang.String rootName)
null
is returned.relativePath
- the relative pathrootName
- the name of the subloader's rootnull
if subloaders are not supportedCopyright © 2022 JBoss by Red Hat. All rights reserved.