public class FileSystemResourceAccessor extends AbstractResourceAccessor
| Constructor and Description |
|---|
FileSystemResourceAccessor(File... baseDirsAndFiles)
Creates a FileSystemResourceAccessor with the given directories/files as the roots.
|
FileSystemResourceAccessor(String file)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addRootPath(Path path) |
SortedSet<String> |
describeLocations()
Returns a description of the places this classloader will look for paths.
|
protected LinkedHashSet<Path> |
getRootPaths() |
protected boolean |
isCompressedFile(Path path)
Returns true if the given path is a compressed file.
|
SortedSet<String> |
list(String relativeTo,
String path,
boolean recursive,
boolean includeFiles,
boolean includeDirectories)
Returns the path to all resources contained in the given path.
|
InputStreamList |
openStreams(String relativeTo,
String streamPath)
Return the streams for each resource mapped by the given path.
|
protected File |
toFile(String path) |
String |
toString() |
openStreamclone, describe, equals, get, get, get, getAttributes, getFieldValue, getObjectMetaData, getValuePath, has, hashCode, setpublic FileSystemResourceAccessor(File... baseDirsAndFiles)
public FileSystemResourceAccessor(String file)
FileSystemResourceAccessor(File...)protected void addRootPath(Path path)
protected LinkedHashSet<Path> getRootPaths()
public InputStreamList openStreams(String relativeTo, String streamPath) throws IOException
ResourceAccessorInputStreamList 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.public SortedSet<String> list(String relativeTo, String path, boolean recursive, boolean includeFiles, boolean includeDirectories) throws IOException
ResourceAccessorResourceAccessor.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.protected boolean isCompressedFile(Path path)
public String toString()
toString in class AbstractExtensibleObjectpublic SortedSet<String> describeLocations()
ResourceAccessorCopyright © 2022 Liquibase.org. All rights reserved.