java.lang.Object
io.smallrye.common.resource.PathResourceLoader
- All Implemented Interfaces:
ResourceLoader,Closeable,AutoCloseable
A resource loader which loads resources from a base path.
-
Field Summary
Fields inherited from interface io.smallrye.common.resource.ResourceLoader
EMPTY -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a new instance from a filesystem's root.PathResourceLoader(Path base) Construct a new instance. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.smallrye.common.resource.ResourceLoader
getChildLoader, manifest, release
-
Constructor Details
-
PathResourceLoader
Construct a new instance. Note: to open a JAR file, useJarFileResourceLoaderinstead.- Parameters:
base- the base path (must not benull)
-
PathResourceLoader
Construct a new instance from a filesystem's root. The filesystem is closed when this resource loader is closed. Note: to open a JAR file, useJarFileResourceLoaderinstead.- Parameters:
fs- the filesystem (must not benull)
-
-
Method Details
-
findResource
Description copied from interface:ResourceLoaderFind a resource from this loader.- Specified by:
findResourcein interfaceResourceLoader- Parameters:
path- the resource path (must not benull)- Returns:
- the loaded resource, or
nullif no resource is found at the given path
-
baseUrl
Description copied from interface:ResourceLoaderReturns the base URL for this loader.- Specified by:
baseUrlin interfaceResourceLoader- Returns:
- the base URL for this loader
-
close
public void close()Description copied from interface:ResourceLoaderRelease any system resources or allocations associated with this resource loader.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceResourceLoader
-