Package org.pentaho.di.core.vfs
Class KettleVFSImpl
java.lang.Object
org.pentaho.di.core.vfs.KettleVFSImpl
- All Implemented Interfaces:
IKettleVFS
Implementation of IKettleVFS. Implementation of VFS file access for kettle. Use KettleVFS.getInstance( Bowl ) to get
an instance.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.apache.commons.vfs2.FileObject
createTempFile
(String prefix, String suffix, String directory) org.apache.commons.vfs2.FileObject
createTempFile
(String prefix, String suffix, String directory, VariableSpace space) org.apache.commons.vfs2.FileObject
createTempFile
(String prefix, KettleVFS.Suffix suffix) Creates a file using "java.io.tmpdir" directoryorg.apache.commons.vfs2.FileObject
createTempFile
(String prefix, KettleVFS.Suffix suffix, String directory) org.apache.commons.vfs2.FileObject
createTempFile
(String prefix, KettleVFS.Suffix suffix, String directory, VariableSpace space) org.apache.commons.vfs2.FileObject
createTempFile
(String prefix, KettleVFS.Suffix suffix, VariableSpace variableSpace) Creates a file using "java.io.tmpdir" directoryboolean
fileExists
(String vfsFilename) boolean
fileExists
(String vfsFilename, VariableSpace space) org.apache.commons.vfs2.FileObject
getFileObject
(String vfsFilename) org.apache.commons.vfs2.FileObject
getFileObject
(String vfsFilename, org.apache.commons.vfs2.FileSystemOptions fsOptions) org.apache.commons.vfs2.FileObject
getFileObject
(String vfsFilename, VariableSpace space) org.apache.commons.vfs2.FileObject
getFileObject
(String vfsFilename, VariableSpace space, org.apache.commons.vfs2.FileSystemOptions fsOptions) org.apache.commons.vfs2.FileSystemOptions
getFileSystemOptions
(String scheme, String vfsFilename, VariableSpace space, org.apache.commons.vfs2.FileSystemOptions fileSystemOptions) getFriendlyURI
(String filename) getFriendlyURI
(String filename, VariableSpace space) getInputStream
(String vfsFilename) getInputStream
(String vfsFilename, VariableSpace space) getOutputStream
(String vfsFilename, boolean append) getOutputStream
(String vfsFilename, VariableSpace space, boolean append) getOutputStream
(String vfsFilename, VariableSpace space, org.apache.commons.vfs2.FileSystemOptions fsOptions, boolean append) getOutputStream
(org.apache.commons.vfs2.FileObject fileObject, boolean append) getTextFileContent
(String vfsFilename, String charSetName) Read a text file (like an XML document).getTextFileContent
(String vfsFilename, VariableSpace space, String charSetName) void
reset()
resets the VariableSpaceorg.apache.commons.vfs2.FileName
resolveURI
(String vfsFilename) Resolves the given URI to a file name.
-
Field Details
-
CONNECTION
- See Also:
-
-
Method Details
-
getFileObject
public org.apache.commons.vfs2.FileObject getFileObject(String vfsFilename) throws KettleFileException - Specified by:
getFileObject
in interfaceIKettleVFS
- Throws:
KettleFileException
-
getFileObject
public org.apache.commons.vfs2.FileObject getFileObject(String vfsFilename, VariableSpace space) throws KettleFileException - Specified by:
getFileObject
in interfaceIKettleVFS
- Throws:
KettleFileException
-
getFileObject
public org.apache.commons.vfs2.FileObject getFileObject(String vfsFilename, org.apache.commons.vfs2.FileSystemOptions fsOptions) throws KettleFileException - Specified by:
getFileObject
in interfaceIKettleVFS
- Throws:
KettleFileException
-
getFileObject
public org.apache.commons.vfs2.FileObject getFileObject(String vfsFilename, VariableSpace space, org.apache.commons.vfs2.FileSystemOptions fsOptions) throws KettleFileException - Specified by:
getFileObject
in interfaceIKettleVFS
- Throws:
KettleFileException
-
resolveURI
Description copied from interface:IKettleVFS
Resolves the given URI to a file name.- Specified by:
resolveURI
in interfaceIKettleVFS
- Parameters:
vfsFilename
- The URI to resolve.- Returns:
- A
FileName
that matches the URI; nevernull
. - Throws:
KettleFileException
- if this is not possible.
-
getFileSystemOptions
public org.apache.commons.vfs2.FileSystemOptions getFileSystemOptions(String scheme, String vfsFilename, VariableSpace space, org.apache.commons.vfs2.FileSystemOptions fileSystemOptions) throws IOException - Specified by:
getFileSystemOptions
in interfaceIKettleVFS
- Throws:
IOException
-
getFriendlyURI
- Specified by:
getFriendlyURI
in interfaceIKettleVFS
-
getFriendlyURI
- Specified by:
getFriendlyURI
in interfaceIKettleVFS
-
getTextFileContent
Description copied from interface:IKettleVFS
Read a text file (like an XML document). WARNING DO NOT USE FOR DATA FILES.- Specified by:
getTextFileContent
in interfaceIKettleVFS
- 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:
KettleFileException
-
getTextFileContent
public String getTextFileContent(String vfsFilename, VariableSpace space, String charSetName) throws KettleFileException - Specified by:
getTextFileContent
in interfaceIKettleVFS
- Throws:
KettleFileException
-
fileExists
- Specified by:
fileExists
in interfaceIKettleVFS
- Throws:
KettleFileException
-
fileExists
- Specified by:
fileExists
in interfaceIKettleVFS
- Throws:
KettleFileException
-
getInputStream
- Specified by:
getInputStream
in interfaceIKettleVFS
- Throws:
KettleFileException
-
getInputStream
public InputStream getInputStream(String vfsFilename, VariableSpace space) throws KettleFileException - Specified by:
getInputStream
in interfaceIKettleVFS
- Throws:
KettleFileException
-
getOutputStream
public OutputStream getOutputStream(org.apache.commons.vfs2.FileObject fileObject, boolean append) throws IOException - Specified by:
getOutputStream
in interfaceIKettleVFS
- Throws:
IOException
-
getOutputStream
- Specified by:
getOutputStream
in interfaceIKettleVFS
- Throws:
KettleFileException
-
getOutputStream
public OutputStream getOutputStream(String vfsFilename, VariableSpace space, boolean append) throws KettleFileException - Specified by:
getOutputStream
in interfaceIKettleVFS
- Throws:
KettleFileException
-
getOutputStream
public OutputStream getOutputStream(String vfsFilename, VariableSpace space, org.apache.commons.vfs2.FileSystemOptions fsOptions, boolean append) throws KettleFileException - Specified by:
getOutputStream
in interfaceIKettleVFS
- Throws:
KettleFileException
-
createTempFile
public org.apache.commons.vfs2.FileObject createTempFile(String prefix, KettleVFS.Suffix suffix) throws KettleFileException Description copied from interface:IKettleVFS
Creates a file using "java.io.tmpdir" directory- Specified by:
createTempFile
in interfaceIKettleVFS
- Parameters:
prefix
- - file name- Returns:
- FileObject
- Throws:
KettleFileException
-
createTempFile
public org.apache.commons.vfs2.FileObject createTempFile(String prefix, KettleVFS.Suffix suffix, VariableSpace variableSpace) throws KettleFileException Description copied from interface:IKettleVFS
Creates a file using "java.io.tmpdir" directory- Specified by:
createTempFile
in interfaceIKettleVFS
- Parameters:
prefix
- - file namesuffix
- - file extensionvariableSpace
- is used to get system variables- Returns:
- FileObject
- Throws:
KettleFileException
-
createTempFile
public org.apache.commons.vfs2.FileObject createTempFile(String prefix, KettleVFS.Suffix suffix, String directory) throws KettleFileException - Specified by:
createTempFile
in interfaceIKettleVFS
- Parameters:
prefix
- - file namesuffix
- - file extensiondirectory
- - directory where file will be created- Returns:
- FileObject
- Throws:
KettleFileException
-
createTempFile
public org.apache.commons.vfs2.FileObject createTempFile(String prefix, String suffix, String directory) throws KettleFileException - Specified by:
createTempFile
in interfaceIKettleVFS
- Throws:
KettleFileException
-
createTempFile
public org.apache.commons.vfs2.FileObject createTempFile(String prefix, KettleVFS.Suffix suffix, String directory, VariableSpace space) throws KettleFileException - Specified by:
createTempFile
in interfaceIKettleVFS
- Parameters:
prefix
- - file namedirectory
- path to directory where file will be createdspace
- is used to get system variables- Returns:
- FileObject
- Throws:
KettleFileException
-
createTempFile
public org.apache.commons.vfs2.FileObject createTempFile(String prefix, String suffix, String directory, VariableSpace space) throws KettleFileException - Specified by:
createTempFile
in interfaceIKettleVFS
- Throws:
KettleFileException
-
reset
public void reset()Description copied from interface:IKettleVFS
resets the VariableSpace- Specified by:
reset
in interfaceIKettleVFS
-