public class DefaultFileSystemResourceLoader extends Object implements FileSystemResourceLoader
Constructor and Description |
---|
DefaultFileSystemResourceLoader()
Default constructor.
|
DefaultFileSystemResourceLoader(File baseDirPath) |
DefaultFileSystemResourceLoader(Path path) |
DefaultFileSystemResourceLoader(String path) |
Modifier and Type | Method and Description |
---|---|
ResourceLoader |
forBase(String basePath)
Constructs a new resource loader designed to load
resources from the given path.
|
Optional<URL> |
getResource(String path)
Obtains the URL to a given resource.
|
Optional<InputStream> |
getResourceAsStream(String path)
Obtains a resource as a stream.
|
Stream<URL> |
getResources(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(File baseDirPath)
baseDirPath
- The base directorypublic DefaultFileSystemResourceLoader(String path)
path
- The pathpublic DefaultFileSystemResourceLoader(Path path)
path
- The pathpublic Optional<InputStream> getResourceAsStream(String path)
ResourceLoader
getResourceAsStream
in interface ResourceLoader
path
- The pathpublic Optional<URL> getResource(String path)
ResourceLoader
getResource
in interface ResourceLoader
path
- The pathpublic Stream<URL> getResources(String name)
ResourceLoader
getResources
in interface ResourceLoader
name
- The name of the resourcepublic ResourceLoader forBase(String basePath)
ResourceLoader
forBase
in interface ResourceLoader
basePath
- The path to load resources