org.pentaho.di.core.vfs
Class KettleVFS

java.lang.Object
  extended by org.pentaho.di.core.vfs.KettleVFS

public class KettleVFS
extends Object


Method Summary
static org.apache.commons.vfs.FileObject createTempFile(String prefix, String suffix, String directory)
           
static org.apache.commons.vfs.FileObject createTempFile(String prefix, String suffix, String directory, VariableSpace space)
           
static boolean fileExists(String vfsFilename)
           
static boolean fileExists(String vfsFilename, VariableSpace space)
           
static Comparator<org.apache.commons.vfs.FileObject> getComparator()
           
static FileInputStream getFileInputStream(org.apache.commons.vfs.FileObject fileObject)
          Deprecated. because of API change in Apache VFS. As a workaround use FileObject.getName().getPathDecoded(); Then use a regular File() object to create a File Input stream.
static String getFilename(org.apache.commons.vfs.FileObject fileObject)
           
static org.apache.commons.vfs.FileObject getFileObject(String vfsFilename)
           
static org.apache.commons.vfs.FileObject getFileObject(String vfsFilename, VariableSpace space)
           
static org.apache.commons.vfs.FileObject getFileObject(String vfsFilename, VariableSpace space, org.apache.commons.vfs.FileSystemOptions fsOptions)
           
 org.apache.commons.vfs.FileSystemManager getFileSystemManager()
           
static InputStream getInputStream(org.apache.commons.vfs.FileObject fileObject)
           
static InputStream getInputStream(String vfsFilename)
           
static InputStream getInputStream(String vfsFilename, VariableSpace space)
           
static KettleVFS getInstance()
           
static OutputStream getOutputStream(org.apache.commons.vfs.FileObject fileObject, boolean append)
           
static OutputStream getOutputStream(String vfsFilename, boolean append)
           
static OutputStream getOutputStream(String vfsFilename, VariableSpace space, boolean append)
           
static String getTextFileContent(String vfsFilename, String charSetName)
          Read a text file (like an XML document).
static String getTextFileContent(String vfsFilename, VariableSpace space, String charSetName)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFileSystemManager

public org.apache.commons.vfs.FileSystemManager getFileSystemManager()

getInstance

public static KettleVFS getInstance()

getFileObject

public static org.apache.commons.vfs.FileObject getFileObject(String vfsFilename)
                                                       throws KettleFileException
Throws:
KettleFileException

getFileObject

public static org.apache.commons.vfs.FileObject getFileObject(String vfsFilename,
                                                              VariableSpace space)
                                                       throws KettleFileException
Throws:
KettleFileException

getFileObject

public static org.apache.commons.vfs.FileObject getFileObject(String vfsFilename,
                                                              VariableSpace space,
                                                              org.apache.commons.vfs.FileSystemOptions fsOptions)
                                                       throws KettleFileException
Throws:
KettleFileException

getTextFileContent

public static String getTextFileContent(String vfsFilename,
                                        String charSetName)
                                 throws KettleFileException
Read a text file (like an XML document). WARNING DO NOT USE FOR DATA FILES.

Parameters:
vfsFilename - the filename or URL to read from
charSetName - the character set of the string (UTF-8, ISO8859-1, etc)
Returns:
The content of the file as a String
Throws:
IOException
KettleFileException

getTextFileContent

public static String getTextFileContent(String vfsFilename,
                                        VariableSpace space,
                                        String charSetName)
                                 throws KettleFileException
Throws:
KettleFileException

fileExists

public static boolean fileExists(String vfsFilename)
                          throws KettleFileException
Throws:
KettleFileException

fileExists

public static boolean fileExists(String vfsFilename,
                                 VariableSpace space)
                          throws KettleFileException
Throws:
KettleFileException

getInputStream

public static InputStream getInputStream(org.apache.commons.vfs.FileObject fileObject)
                                  throws org.apache.commons.vfs.FileSystemException
Throws:
org.apache.commons.vfs.FileSystemException

getInputStream

public static InputStream getInputStream(String vfsFilename)
                                  throws KettleFileException
Throws:
KettleFileException

getInputStream

public static InputStream getInputStream(String vfsFilename,
                                         VariableSpace space)
                                  throws KettleFileException
Throws:
KettleFileException

getOutputStream

public static OutputStream getOutputStream(org.apache.commons.vfs.FileObject fileObject,
                                           boolean append)
                                    throws IOException
Throws:
IOException

getOutputStream

public static OutputStream getOutputStream(String vfsFilename,
                                           boolean append)
                                    throws KettleFileException
Throws:
KettleFileException

getOutputStream

public static OutputStream getOutputStream(String vfsFilename,
                                           VariableSpace space,
                                           boolean append)
                                    throws KettleFileException
Throws:
KettleFileException

getFilename

public static String getFilename(org.apache.commons.vfs.FileObject fileObject)

createTempFile

public static org.apache.commons.vfs.FileObject createTempFile(String prefix,
                                                               String suffix,
                                                               String directory)
                                                        throws KettleFileException
Throws:
KettleFileException

createTempFile

public static org.apache.commons.vfs.FileObject createTempFile(String prefix,
                                                               String suffix,
                                                               String directory,
                                                               VariableSpace space)
                                                        throws KettleFileException
Throws:
KettleFileException

getComparator

public static Comparator<org.apache.commons.vfs.FileObject> getComparator()

getFileInputStream

public static FileInputStream getFileInputStream(org.apache.commons.vfs.FileObject fileObject)
                                          throws IOException
Deprecated. because of API change in Apache VFS. As a workaround use FileObject.getName().getPathDecoded(); Then use a regular File() object to create a File Input stream.

Get a FileInputStream for a local file. Local files can be read with NIO.

Parameters:
fileObject -
Returns:
a FileInputStream
Throws:
IOException