public class CommandLineResourceAccessor extends ClassLoaderResourceAccessor
ClassLoaderResourceAccessor
that adds extra fuzzy searching logic based on
what users may enter that is different than what is exactly correct.description, rootPaths
Constructor and Description |
---|
CommandLineResourceAccessor(ClassLoader loader) |
Modifier and Type | Method and Description |
---|---|
protected List<String> |
getAlternatePaths(String path)
Return alternate options for the given path that the user maybe meant.
|
SortedSet<String> |
list(String relativeTo,
String path,
boolean includeFiles,
boolean includeDirectories,
boolean recursive)
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.
|
close, describeLocations, getFinalPath, init, isDirectory, listFromClassLoader, listFromRootPaths, loadRootPaths
openStream
clone, describe, equals, get, get, get, getAttributes, getFieldValue, getObjectMetaData, getValuePath, has, hashCode, set, toString
public CommandLineResourceAccessor(ClassLoader loader)
public InputStreamList openStreams(String relativeTo, String streamPath) throws IOException
ResourceAccessor
InputStreamList
since multiple resources can map to the same path, such as "META-INF/MAINFEST.MF".
Remember to close streams when finished with them.openStreams
in interface ResourceAccessor
openStreams
in class ClassLoaderResourceAccessor
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 includeFiles, boolean includeDirectories, boolean recursive) throws IOException
ResourceAccessor
ResourceAccessor.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.list
in interface ResourceAccessor
list
in class ClassLoaderResourceAccessor
relativeTo
- Location that streamPath should be found relative to. If null, path is an absolute pathpath
- The path to lookup resources in.includeFiles
- Set to true and will return paths to contents in sub directories as well.includeDirectories
- Set to true and will return paths to files.recursive
- Set to true and will return paths to directories.IOException
- if there is an error reading an existing root.Copyright © 2022 Liquibase.org. All rights reserved.