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 boolean fileExists(String vfsFilename)
           
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 InputStream getInputStream(org.apache.commons.vfs.FileObject fileObject)
           
static InputStream getInputStream(String vfsFilename)
           
static OutputStream getOutputStream(org.apache.commons.vfs.FileObject fileObject, boolean append)
           
static OutputStream getOutputStream(String vfsFilename, boolean append)
           
static String getTextFileContent(String vfsFilename, String charSetName)
          Read a text file (like an XML document).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFileObject

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

getTextFileContent

public static String getTextFileContent(String vfsFilename,
                                        String charSetName)
                                 throws IOException
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

fileExists

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

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 IOException
Throws:
IOException

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 IOException
Throws:
IOException

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 IOException
Throws:
IOException

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