liquibase.resource
Class FileSystemResourceAccessor

java.lang.Object
  extended by liquibase.resource.AbstractResourceAccessor
      extended by liquibase.resource.FileSystemResourceAccessor
All Implemented Interfaces:
ResourceAccessor

public class FileSystemResourceAccessor
extends AbstractResourceAccessor

A @{link ResourceAccessor} implementation which finds Files in the File System.


Constructor Summary
FileSystemResourceAccessor()
          Creates with no base directory.
FileSystemResourceAccessor(String base)
          Creates with base directory for relative path support.
 
Method Summary
protected  String convertToPath(String string)
           
 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 liquibase.resource.AbstractResourceAccessor
addRootPath, convertToPath, getContents, getRootPaths, init, isCaseSensitive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileSystemResourceAccessor

public FileSystemResourceAccessor()
Creates with no base directory. All files will be resolved exactly as they are given.


FileSystemResourceAccessor

public FileSystemResourceAccessor(String base)
Creates with base directory for relative path support.

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.

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

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. The passed root is not included in the returned set.

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.

convertToPath

protected String convertToPath(String string)
Overrides:
convertToPath in class AbstractResourceAccessor

toClassLoader

public ClassLoader toClassLoader()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2016 Liquibase.org. All rights reserved.