java.lang.Object
io.smallrye.common.resource.URLResourceLoader
- All Implemented Interfaces:
ResourceLoader,Closeable,AutoCloseable
A resource loader for a URL base.
-
Field Summary
Fields inherited from interface io.smallrye.common.resource.ResourceLoader
EMPTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbaseUrl()Returns the base URL for this loader.findResource(String path) Find a resource from this loader.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
close, getChildLoader, manifest, release
-
Constructor Details
-
URLResourceLoader
Construct a new instance. Note: to open a JAR file, useJarFileResourceLoaderinstead. To access files on the file system, usePathResourceLoaderinstead.- Parameters:
base- the URL base (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 - Throws:
IOException- if the resource could not be loaded
-
baseUrl
Description copied from interface:ResourceLoaderReturns the base URL for this loader.- Specified by:
baseUrlin interfaceResourceLoader- Returns:
- the base URL for this loader
-