public class DefaultFileSystemResourceLoader extends java.lang.Object implements FileSystemResourceLoader
Constructor and Description |
---|
DefaultFileSystemResourceLoader()
Default constructor.
|
DefaultFileSystemResourceLoader(java.io.File baseDirPath) |
DefaultFileSystemResourceLoader(java.nio.file.Path path) |
DefaultFileSystemResourceLoader(java.lang.String path) |
Modifier and Type | Method and Description |
---|---|
ResourceLoader |
forBase(java.lang.String basePath)
Constructs a new resource loader designed to load
resources from the given path.
|
java.util.Optional<java.net.URL> |
getResource(java.lang.String path)
Obtains the URL to a given resource.
|
java.util.Optional<java.io.InputStream> |
getResourceAsStream(java.lang.String path)
Obtains a resource as a stream.
|
java.util.stream.Stream<java.net.URL> |
getResources(java.lang.String name)
Obtains all resources with the given name.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
defaultLoader, supportsPrefix
public DefaultFileSystemResourceLoader()
public DefaultFileSystemResourceLoader(java.io.File baseDirPath)
baseDirPath
- The base directorypublic DefaultFileSystemResourceLoader(java.lang.String path)
path
- The pathpublic DefaultFileSystemResourceLoader(java.nio.file.Path path)
path
- The pathpublic java.util.Optional<java.io.InputStream> getResourceAsStream(java.lang.String path)
ResourceLoader
getResourceAsStream
in interface ResourceLoader
path
- The pathpublic java.util.Optional<java.net.URL> getResource(java.lang.String path)
ResourceLoader
getResource
in interface ResourceLoader
path
- The pathpublic java.util.stream.Stream<java.net.URL> getResources(java.lang.String name)
ResourceLoader
getResources
in interface ResourceLoader
name
- The name of the resourcepublic ResourceLoader forBase(java.lang.String basePath)
ResourceLoader
forBase
in interface ResourceLoader
basePath
- The path to load resources