public class CompositeResourceAccessor extends AbstractResourceAccessor
ResourceAccessor
that contains multiple sub-accessors and combines the results of all of them.
For the "overall" aggregate resource accessor, integrations should generally use SearchPathResourceAccessor
instead of this.Constructor and Description |
---|
CompositeResourceAccessor(Collection<ResourceAccessor> resourceAccessors) |
CompositeResourceAccessor(ResourceAccessor... resourceAccessors) |
Modifier and Type | Method and Description |
---|---|
CompositeResourceAccessor |
addResourceAccessor(ResourceAccessor resourceAccessor) |
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.
|
InputStreamList |
openStreams(String relativeTo,
String streamPath)
Return the streams for each resource mapped by the given path.
|
void |
removeResourceAccessor(ResourceAccessor resourceAccessor) |
openStream
clone, describe, equals, get, get, get, getAttributes, getFieldValue, getObjectMetaData, getValuePath, has, hashCode, set, toString
public CompositeResourceAccessor(ResourceAccessor... resourceAccessors)
public CompositeResourceAccessor(Collection<ResourceAccessor> resourceAccessors)
public CompositeResourceAccessor addResourceAccessor(ResourceAccessor resourceAccessor)
public void removeResourceAccessor(ResourceAccessor resourceAccessor)
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.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
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.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.public SortedSet<String> describeLocations()
ResourceAccessor
Copyright © 2022 Liquibase.org. All rights reserved.