liquibase
Class FileSystemFileOpener

java.lang.Object
  extended by liquibase.FileSystemFileOpener
All Implemented Interfaces:
FileOpener

public class FileSystemFileOpener
extends java.lang.Object
implements FileOpener

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

Constructor Detail

FileSystemFileOpener

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


FileSystemFileOpener

public FileSystemFileOpener(java.lang.String base)
Creates using a supplied base directory.

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

getResourceAsStream

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

Specified by:
getResourceAsStream in interface FileOpener
Throws:
java.io.IOException

getResources

public java.util.Enumeration<java.net.URL> getResources(java.lang.String packageName)
                                                 throws java.io.IOException
Specified by:
getResources in interface FileOpener
Throws:
java.io.IOException

toClassLoader

public java.lang.ClassLoader toClassLoader()
Specified by:
toClassLoader in interface FileOpener