public class MavenResourceAccessor extends ClassLoaderResourceAccessor
ClassLoaderResourceAccessor for Maven which will use a default or user specified ClassLoader to load files/resources.description, rootPaths| Constructor and Description |
|---|
MavenResourceAccessor(ClassLoader classLoader) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
close, describeLocations, getFinalPath, init, isDirectory, listFromClassLoader, listFromRootPaths, loadRootPathsopenStreamclone, describe, equals, get, get, get, getAttributes, getFieldValue, getObjectMetaData, getValuePath, has, hashCode, set, toStringpublic MavenResourceAccessor(ClassLoader classLoader)
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.openStreams in interface ResourceAccessoropenStreams in class ClassLoaderResourceAccessorrelativeTo - 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.list in interface ResourceAccessorlist in class ClassLoaderResourceAccessorrelativeTo - 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 © 2022 Liquibase.org. All rights reserved.