liquibase.resource
Class CompositeResourceAccessor

java.lang.Object
  extended by liquibase.resource.CompositeResourceAccessor
All Implemented Interfaces:
ResourceAccessor
Direct Known Subclasses:
AntResourceAccessor

public class CompositeResourceAccessor
extends Object
implements ResourceAccessor

A ResourceAccessor that will search in a list of other ResourceAccessors until it finds one that has a resource of the appropriate name and path.


Constructor Summary
CompositeResourceAccessor(List<ResourceAccessor> resourceAccessors)
           
CompositeResourceAccessor(ResourceAccessor... resourceAccessors)
           
 
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()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CompositeResourceAccessor

public CompositeResourceAccessor(List<ResourceAccessor> resourceAccessors)

CompositeResourceAccessor

public CompositeResourceAccessor(ResourceAccessor... resourceAccessors)
Method Detail

getResourcesAsStream

public Set<InputStream> getResourcesAsStream(String path)
                                      throws IOException
Description copied from interface: ResourceAccessor
Return an InputStream for each resource mapped by the given path. The path is often a URL but does not have to be. Return null if the resource does not exist. Throws IOException if there is an error reading an existing path.

Specified by:
getResourcesAsStream in interface ResourceAccessor
Throws:
IOException

list

public Set<String> list(String relativeTo,
                        String path,
                        boolean includeFiles,
                        boolean includeDirectories,
                        boolean recursive)
                 throws IOException
Description copied from interface: ResourceAccessor
Returns the path to all resources contained in the given root. Returns null if the root does not exist. Throws IOException if there is an error reading an existing root. The passed root is not included in the returned set.

Specified by:
list in interface ResourceAccessor
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
Throws:
IOException

toClassLoader

public ClassLoader toClassLoader()
Specified by:
toClassLoader in interface ResourceAccessor

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2015 Liquibase.org. All rights reserved.