public interface ResourceAccessor
ClassLoader
but for finding and reading files, not finding and loading classes.Modifier and Type | Method and Description |
---|---|
SortedSet<String> |
describeLocations()
Returns a description of the places this classloader will look for paths.
|
SortedSet<String> |
list(String relativeTo,
String path,
boolean recursive,
boolean includeFiles,
boolean includeDirectories)
Returns the path to all resources contained in the given path.
|
InputStream |
openStream(String relativeTo,
String streamPath)
Returns a single stream matching the given path.
|
InputStreamList |
openStreams(String relativeTo,
String streamPath)
Return the streams for each resource mapped by the given path.
|
InputStreamList openStreams(String relativeTo, String streamPath) throws IOException
InputStreamList
since multiple resources can map to the same path, such as "META-INF/MAINFEST.MF".
Remember to close streams when finished with them.relativeTo
- Location that streamPath should be found relative to. If null, streamPath is an absolute pathIOException
- if there is an error reading an existing path.InputStream openStream(String relativeTo, String streamPath) throws IOException
openStreams(String, String)
for details about path options.relativeTo
- Location that streamPath should be found relative to. If null, streamPath is an absolute pathIOException
- if multiple paths matched the streamIOException
- if there is an error reading an existing pathSortedSet<String> list(String relativeTo, String path, boolean recursive, boolean includeFiles, boolean includeDirectories) throws IOException
openStreams(String, String)
and return the contents.
Returned paths should normally be root-relative and therefore not be an absolute path, unless there is a good reason to be absolute.relativeTo
- Location that streamPath should be found relative to. If null, path is an absolute pathpath
- The path to lookup resources in.recursive
- Set to true and will return paths to contents in sub directories as well.includeFiles
- Set to true and will return paths to files.includeDirectories
- Set to true and will return paths to directories.IOException
- if there is an error reading an existing root.Copyright © 2020 Liquibase.org. All rights reserved.