liquibase.resource
Interface ResourceAccessor

All Known Implementing Classes:
AbstractResourceAccessor, AntResourceAccessor, ClassLoaderResourceAccessor, CommandLineResourceAccessor, CompositeResourceAccessor, FileSystemResourceAccessor, MockResourceAccessor, OSGiResourceAccessor, SpringLiquibase.SpringResourceOpener

public interface ResourceAccessor

Abstracts file access so they can be read in a variety of manners.


Method Summary
 Set<InputStream> getResourcesAsStream(String path)
          Return an InputStream for each resource mapped by the given path.
 Set<String> list(String relativeTo, String path, boolean includeFiles, boolean includeDirectories, boolean recursive)
          Returns the path to all resources contained in the given root.
 ClassLoader toClassLoader()
           
 

Method Detail

getResourcesAsStream

Set<InputStream> getResourcesAsStream(String path)
                                      throws IOException
Return an InputStream for each resource mapped by the given path. The path is often a URL but does not have to be.

Returns:
null if the resource does not exist.
Throws:
IOException - if there is an error reading an existing path.

list

Set<String> list(String relativeTo,
                 String path,
                 boolean includeFiles,
                 boolean includeDirectories,
                 boolean recursive)
                 throws IOException
Returns the path to all resources contained in the given root. The passed root is not included in the returned set.

Parameters:
includeFiles - Set to false to exclude files in the returned set. Defaults to true
includeDirectories - Set to false to exclude directories in the returned set. Defaults to true
recursive - Set to true and will return paths to contents in sub directories as well. Defaults to false
Returns:
null if the root does not exist.
Throws:
IOException - if there is an error reading an existing root.

toClassLoader

ClassLoader toClassLoader()


Copyright © 2016 Liquibase.org. All rights reserved.