org.pentaho.di.core.vfs
Class KettleVFS
java.lang.Object
org.pentaho.di.core.vfs.KettleVFS
public class KettleVFS
- extends Object
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 fromcharSetName
- 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