Class ConnectionFileObject
- java.lang.Object
-
- org.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
-
- org.pentaho.di.connections.vfs.provider.ConnectionFileObject
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Comparable<org.apache.commons.vfs2.FileObject>
,Iterable<org.apache.commons.vfs2.FileObject>
,org.apache.commons.vfs2.FileObject
,AliasedFileObject
public class ConnectionFileObject extends org.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem> implements AliasedFileObject
The FileObject implementation for the PVFS (Pentaho VFS) vfs provider. The purpose of ConnectionFileObject is to represent a named connection FileObject. ConnectionFileObject holds a reference to the resolved FileObject and delegates metadata calls to that reference object, but for other calls, such as getChildren, ConnectionFileObject resolves the child FileObjects, but converts them to pvfs FileObjects to maintain named connection information.
-
-
Constructor Summary
Constructors Constructor Description ConnectionFileObject(org.apache.commons.vfs2.provider.AbstractFileName name, ConnectionFileSystem fs, org.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem> resolvedFileObject, String domain)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canRenameTo(org.apache.commons.vfs2.FileObject newfile)
void
close()
void
copyFrom(org.apache.commons.vfs2.FileObject file, org.apache.commons.vfs2.FileSelector selector)
void
createFile()
void
createFolder()
boolean
delete()
int
delete(org.apache.commons.vfs2.FileSelector selector)
int
deleteAll()
protected long
doGetContentSize()
protected InputStream
doGetInputStream()
protected org.apache.commons.vfs2.FileType
doGetType()
protected String[]
doListChildren()
boolean
exists()
String
getAELSafeURIString()
Returns the original file object URI but swaps s3:// for s3a:// when neededorg.apache.commons.vfs2.FileObject
getChild(String name)
org.apache.commons.vfs2.FileObject[]
getChildren()
Resolve children from the delegated vfs provider then convert to PVFSorg.apache.commons.vfs2.FileContent
getContent()
org.apache.commons.vfs2.operations.FileOperations
getFileOperations()
InputStream
getInputStream()
String
getOriginalURIString()
Returns the string that contains original file object URI.OutputStream
getOutputStream()
OutputStream
getOutputStream(boolean bAppend)
org.apache.commons.vfs2.RandomAccessContent
getRandomAccessContent(org.apache.commons.vfs2.util.RandomAccessMode mode)
org.apache.commons.vfs2.FileObject
getResolvedFileObject()
org.apache.commons.vfs2.FileType
getType()
void
holdObject(Object strongRef)
boolean
isAttached()
boolean
isContentOpen()
boolean
isExecutable()
boolean
isFile()
boolean
isFolder()
boolean
isHidden()
boolean
isReadable()
boolean
isWriteable()
void
moveTo(org.apache.commons.vfs2.FileObject destFile)
void
refresh()
-
Methods inherited from class org.apache.commons.vfs2.provider.AbstractFileObject
childrenChanged, compareTo, doAttach, doCreateFileContent, doCreateFolder, doDelete, doDetach, doGetAttributes, doGetCertificates, doGetInputStream, doGetLastModifiedTime, doGetOutputStream, doGetRandomAccessContent, doIsExecutable, doIsHidden, doIsReadable, doIsSameFile, doIsSymbolicLink, doIsWriteable, doListChildrenResolved, doRemoveAttribute, doRename, doSetAttribute, doSetExecutable, doSetLastModifiedTime, doSetReadable, doSetWritable, endOutput, finalize, findFiles, findFiles, getAbstractFileSystem, getFileContentInfoFactory, getFileSystem, getInputStream, getName, getParent, getPublicURIString, getURL, handleChanged, handleCreate, handleDelete, injectType, isSameFile, isSymbolicLink, iterator, listFiles, notifyAllStreamsClosed, onChange, onChildrenChanged, resolveFile, resolveFile, setExecutable, setReadable, setWritable, toString
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
DELIMITER
public static final String DELIMITER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ConnectionFileObject
public ConnectionFileObject(org.apache.commons.vfs2.provider.AbstractFileName name, ConnectionFileSystem fs, org.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem> resolvedFileObject, String domain)
-
-
Method Detail
-
doGetContentSize
protected long doGetContentSize() throws Exception
- Specified by:
doGetContentSize
in classorg.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
- Throws:
Exception
-
doGetInputStream
protected InputStream doGetInputStream() throws Exception
- Overrides:
doGetInputStream
in classorg.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
- Throws:
Exception
-
doGetType
protected org.apache.commons.vfs2.FileType doGetType() throws Exception
- Specified by:
doGetType
in classorg.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
- Throws:
Exception
-
doListChildren
protected String[] doListChildren() throws Exception
- Specified by:
doListChildren
in classorg.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
- Throws:
Exception
-
canRenameTo
public boolean canRenameTo(org.apache.commons.vfs2.FileObject newfile)
- Specified by:
canRenameTo
in interfaceorg.apache.commons.vfs2.FileObject
- Overrides:
canRenameTo
in classorg.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
-
close
public void close() throws org.apache.commons.vfs2.FileSystemException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceorg.apache.commons.vfs2.FileObject
- Overrides:
close
in classorg.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
- Throws:
org.apache.commons.vfs2.FileSystemException
-
copyFrom
public void copyFrom(org.apache.commons.vfs2.FileObject file, org.apache.commons.vfs2.FileSelector selector) throws org.apache.commons.vfs2.FileSystemException
- Specified by:
copyFrom
in interfaceorg.apache.commons.vfs2.FileObject
- Overrides:
copyFrom
in classorg.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
- Throws:
org.apache.commons.vfs2.FileSystemException
-
createFile
public void createFile() throws org.apache.commons.vfs2.FileSystemException
- Specified by:
createFile
in interfaceorg.apache.commons.vfs2.FileObject
- Overrides:
createFile
in classorg.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
- Throws:
org.apache.commons.vfs2.FileSystemException
-
createFolder
public void createFolder() throws org.apache.commons.vfs2.FileSystemException
- Specified by:
createFolder
in interfaceorg.apache.commons.vfs2.FileObject
- Overrides:
createFolder
in classorg.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
- Throws:
org.apache.commons.vfs2.FileSystemException
-
delete
public boolean delete() throws org.apache.commons.vfs2.FileSystemException
- Specified by:
delete
in interfaceorg.apache.commons.vfs2.FileObject
- Overrides:
delete
in classorg.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
- Throws:
org.apache.commons.vfs2.FileSystemException
-
delete
public int delete(org.apache.commons.vfs2.FileSelector selector) throws org.apache.commons.vfs2.FileSystemException
- Specified by:
delete
in interfaceorg.apache.commons.vfs2.FileObject
- Overrides:
delete
in classorg.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
- Throws:
org.apache.commons.vfs2.FileSystemException
-
deleteAll
public int deleteAll() throws org.apache.commons.vfs2.FileSystemException
- Specified by:
deleteAll
in interfaceorg.apache.commons.vfs2.FileObject
- Overrides:
deleteAll
in classorg.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
- Throws:
org.apache.commons.vfs2.FileSystemException
-
exists
public boolean exists() throws org.apache.commons.vfs2.FileSystemException
- Specified by:
exists
in interfaceorg.apache.commons.vfs2.FileObject
- Overrides:
exists
in classorg.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
- Throws:
org.apache.commons.vfs2.FileSystemException
-
getChild
public org.apache.commons.vfs2.FileObject getChild(String name) throws org.apache.commons.vfs2.FileSystemException
- Specified by:
getChild
in interfaceorg.apache.commons.vfs2.FileObject
- Overrides:
getChild
in classorg.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
- Throws:
org.apache.commons.vfs2.FileSystemException
-
getChildren
public org.apache.commons.vfs2.FileObject[] getChildren() throws org.apache.commons.vfs2.FileSystemException
Resolve children from the delegated vfs provider then convert to PVFS- Specified by:
getChildren
in interfaceorg.apache.commons.vfs2.FileObject
- Overrides:
getChildren
in classorg.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
- Returns:
- File objects with PVFS scheme
- Throws:
org.apache.commons.vfs2.FileSystemException
- File doesn't exist
-
getContent
public org.apache.commons.vfs2.FileContent getContent() throws org.apache.commons.vfs2.FileSystemException
- Specified by:
getContent
in interfaceorg.apache.commons.vfs2.FileObject
- Overrides:
getContent
in classorg.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
- Throws:
org.apache.commons.vfs2.FileSystemException
-
getFileOperations
public org.apache.commons.vfs2.operations.FileOperations getFileOperations() throws org.apache.commons.vfs2.FileSystemException
- Specified by:
getFileOperations
in interfaceorg.apache.commons.vfs2.FileObject
- Overrides:
getFileOperations
in classorg.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
- Throws:
org.apache.commons.vfs2.FileSystemException
-
getInputStream
public InputStream getInputStream() throws org.apache.commons.vfs2.FileSystemException
- Overrides:
getInputStream
in classorg.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
- Throws:
org.apache.commons.vfs2.FileSystemException
-
getOutputStream
public OutputStream getOutputStream() throws org.apache.commons.vfs2.FileSystemException
- Overrides:
getOutputStream
in classorg.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
- Throws:
org.apache.commons.vfs2.FileSystemException
-
getOutputStream
public OutputStream getOutputStream(boolean bAppend) throws org.apache.commons.vfs2.FileSystemException
- Overrides:
getOutputStream
in classorg.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
- Throws:
org.apache.commons.vfs2.FileSystemException
-
getRandomAccessContent
public org.apache.commons.vfs2.RandomAccessContent getRandomAccessContent(org.apache.commons.vfs2.util.RandomAccessMode mode) throws org.apache.commons.vfs2.FileSystemException
- Overrides:
getRandomAccessContent
in classorg.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
- Throws:
org.apache.commons.vfs2.FileSystemException
-
getType
public org.apache.commons.vfs2.FileType getType() throws org.apache.commons.vfs2.FileSystemException
- Specified by:
getType
in interfaceorg.apache.commons.vfs2.FileObject
- Overrides:
getType
in classorg.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
- Throws:
org.apache.commons.vfs2.FileSystemException
-
holdObject
public void holdObject(Object strongRef)
- Overrides:
holdObject
in classorg.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
-
isAttached
public boolean isAttached()
- Specified by:
isAttached
in interfaceorg.apache.commons.vfs2.FileObject
- Overrides:
isAttached
in classorg.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
-
isContentOpen
public boolean isContentOpen()
- Specified by:
isContentOpen
in interfaceorg.apache.commons.vfs2.FileObject
- Overrides:
isContentOpen
in classorg.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
-
isExecutable
public boolean isExecutable() throws org.apache.commons.vfs2.FileSystemException
- Specified by:
isExecutable
in interfaceorg.apache.commons.vfs2.FileObject
- Overrides:
isExecutable
in classorg.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
- Throws:
org.apache.commons.vfs2.FileSystemException
-
isFile
public boolean isFile() throws org.apache.commons.vfs2.FileSystemException
- Specified by:
isFile
in interfaceorg.apache.commons.vfs2.FileObject
- Overrides:
isFile
in classorg.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
- Throws:
org.apache.commons.vfs2.FileSystemException
-
isFolder
public boolean isFolder() throws org.apache.commons.vfs2.FileSystemException
- Specified by:
isFolder
in interfaceorg.apache.commons.vfs2.FileObject
- Overrides:
isFolder
in classorg.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
- Throws:
org.apache.commons.vfs2.FileSystemException
-
isHidden
public boolean isHidden() throws org.apache.commons.vfs2.FileSystemException
- Specified by:
isHidden
in interfaceorg.apache.commons.vfs2.FileObject
- Overrides:
isHidden
in classorg.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
- Throws:
org.apache.commons.vfs2.FileSystemException
-
isReadable
public boolean isReadable() throws org.apache.commons.vfs2.FileSystemException
- Specified by:
isReadable
in interfaceorg.apache.commons.vfs2.FileObject
- Overrides:
isReadable
in classorg.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
- Throws:
org.apache.commons.vfs2.FileSystemException
-
isWriteable
public boolean isWriteable() throws org.apache.commons.vfs2.FileSystemException
- Specified by:
isWriteable
in interfaceorg.apache.commons.vfs2.FileObject
- Overrides:
isWriteable
in classorg.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
- Throws:
org.apache.commons.vfs2.FileSystemException
-
moveTo
public void moveTo(org.apache.commons.vfs2.FileObject destFile) throws org.apache.commons.vfs2.FileSystemException
- Specified by:
moveTo
in interfaceorg.apache.commons.vfs2.FileObject
- Overrides:
moveTo
in classorg.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
- Throws:
org.apache.commons.vfs2.FileSystemException
-
refresh
public void refresh() throws org.apache.commons.vfs2.FileSystemException
- Specified by:
refresh
in interfaceorg.apache.commons.vfs2.FileObject
- Overrides:
refresh
in classorg.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
- Throws:
org.apache.commons.vfs2.FileSystemException
-
getResolvedFileObject
public org.apache.commons.vfs2.FileObject getResolvedFileObject()
-
getOriginalURIString
public String getOriginalURIString()
Description copied from interface:AliasedFileObject
Returns the string that contains original file object URI.- Specified by:
getOriginalURIString
in interfaceAliasedFileObject
- Returns:
- original URI string
-
getAELSafeURIString
public String getAELSafeURIString()
Description copied from interface:AliasedFileObject
Returns the original file object URI but swaps s3:// for s3a:// when needed- Specified by:
getAELSafeURIString
in interfaceAliasedFileObject
- Returns:
-
-