liquibase.resource
Class FileSystemResourceAccessor

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

public class FileSystemResourceAccessor
extends Object
implements ResourceAccessor

A FileOpener implementation which finds Files in the File System.

FileSystemFileOpeners can use a BaseDirectory to determine where relative paths should be resolved from.

Author:
Constructor Summary
FileSystemResourceAccessor()
          Creates using a Base directory of null, all files will be resolved exactly as they are given.
FileSystemResourceAccessor(String base)
          Creates using a supplied base directory.
 
Method Summary
 InputStream getResourceAsStream(String file)
          Opens a stream on a file, resolving to the baseDirectory if the file is relative.
 Enumeration<URL> getResources(String packageName)
           
 ClassLoader toClassLoader()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileSystemResourceAccessor

public FileSystemResourceAccessor()
Creates using a Base directory of null, all files will be resolved exactly as they are given.


FileSystemResourceAccessor

public FileSystemResourceAccessor(String base)
Creates using a supplied base directory.

Parameters:
base - The path to use to resolve relative paths
Method Detail

getResourceAsStream

public InputStream getResourceAsStream(String file)
                                throws IOException
Opens a stream on a file, resolving to the baseDirectory if the file is relative.

Specified by:
getResourceAsStream in interface ResourceAccessor
Throws:
IOException

getResources

public Enumeration<URL> getResources(String packageName)
                              throws IOException
Specified by:
getResources in interface ResourceAccessor
Throws:
IOException

toClassLoader

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

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2011 Liquibase.org. All Rights Reserved.