Class 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.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String DELIMITER  
      • Fields inherited from class org.apache.commons.vfs2.provider.AbstractFileObject

        DEFAULT_BUFFER_SIZE
    • 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 class org.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
        Throws:
        Exception
      • doGetType

        protected org.apache.commons.vfs2.FileType doGetType()
                                                      throws Exception
        Specified by:
        doGetType in class org.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
        Throws:
        Exception
      • canRenameTo

        public boolean canRenameTo​(org.apache.commons.vfs2.FileObject newfile)
        Specified by:
        canRenameTo in interface org.apache.commons.vfs2.FileObject
        Overrides:
        canRenameTo in class org.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
      • close

        public void close()
                   throws org.apache.commons.vfs2.FileSystemException
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Specified by:
        close in interface org.apache.commons.vfs2.FileObject
        Overrides:
        close in class org.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 interface org.apache.commons.vfs2.FileObject
        Overrides:
        copyFrom in class org.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 interface org.apache.commons.vfs2.FileObject
        Overrides:
        createFile in class org.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 interface org.apache.commons.vfs2.FileObject
        Overrides:
        createFolder in class org.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 interface org.apache.commons.vfs2.FileObject
        Overrides:
        delete in class org.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 interface org.apache.commons.vfs2.FileObject
        Overrides:
        delete in class org.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 interface org.apache.commons.vfs2.FileObject
        Overrides:
        deleteAll in class org.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 interface org.apache.commons.vfs2.FileObject
        Overrides:
        exists in class org.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 interface org.apache.commons.vfs2.FileObject
        Overrides:
        getChild in class org.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 interface org.apache.commons.vfs2.FileObject
        Overrides:
        getChildren in class org.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 interface org.apache.commons.vfs2.FileObject
        Overrides:
        getContent in class org.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 interface org.apache.commons.vfs2.FileObject
        Overrides:
        getFileOperations in class org.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 class org.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 class org.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 class org.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 class org.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 interface org.apache.commons.vfs2.FileObject
        Overrides:
        getType in class org.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
        Throws:
        org.apache.commons.vfs2.FileSystemException
      • holdObject

        public void holdObject​(Object strongRef)
        Overrides:
        holdObject in class org.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
      • isAttached

        public boolean isAttached()
        Specified by:
        isAttached in interface org.apache.commons.vfs2.FileObject
        Overrides:
        isAttached in class org.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
      • isContentOpen

        public boolean isContentOpen()
        Specified by:
        isContentOpen in interface org.apache.commons.vfs2.FileObject
        Overrides:
        isContentOpen in class org.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
      • isExecutable

        public boolean isExecutable()
                             throws org.apache.commons.vfs2.FileSystemException
        Specified by:
        isExecutable in interface org.apache.commons.vfs2.FileObject
        Overrides:
        isExecutable in class org.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 interface org.apache.commons.vfs2.FileObject
        Overrides:
        isFile in class org.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 interface org.apache.commons.vfs2.FileObject
        Overrides:
        isFolder in class org.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 interface org.apache.commons.vfs2.FileObject
        Overrides:
        isHidden in class org.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 interface org.apache.commons.vfs2.FileObject
        Overrides:
        isReadable in class org.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 interface org.apache.commons.vfs2.FileObject
        Overrides:
        isWriteable in class org.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 interface org.apache.commons.vfs2.FileObject
        Overrides:
        moveTo in class org.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 interface org.apache.commons.vfs2.FileObject
        Overrides:
        refresh in class org.apache.commons.vfs2.provider.AbstractFileObject<ConnectionFileSystem>
        Throws:
        org.apache.commons.vfs2.FileSystemException
      • getResolvedFileObject

        public org.apache.commons.vfs2.FileObject getResolvedFileObject()