Class HdfsFileObject

java.lang.Object
org.apache.commons.vfs2.provider.AbstractFileObject<HdfsFileSystem>
org.apache.commons.vfs2.provider.hdfs.HdfsFileObject
All Implemented Interfaces:
Closeable, AutoCloseable, Comparable<org.apache.commons.vfs2.FileObject>, Iterable<org.apache.commons.vfs2.FileObject>, org.apache.commons.vfs2.FileObject

public class HdfsFileObject extends org.apache.commons.vfs2.provider.AbstractFileObject<HdfsFileSystem>
A VFS representation of an HDFS file.
Since:
2.1
  • Field Summary

    Fields inherited from class org.apache.commons.vfs2.provider.AbstractFileObject

    DEFAULT_BUFFER_SIZE

    Fields inherited from interface org.apache.commons.vfs2.FileObject

    EMPTY_ARRAY
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    HdfsFileObject(org.apache.commons.vfs2.provider.AbstractFileName name, HdfsFileSystem fs, org.apache.hadoop.fs.FileSystem hdfs, org.apache.hadoop.fs.Path path)
    Constructs a new HDFS FileObject
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canRenameTo(org.apache.commons.vfs2.FileObject newfile)
     
    protected void
     
    protected void
     
    protected void
     
    protected Map<String,Object>
     
    protected long
     
    protected InputStream
    doGetInputStream(int bufferSize)
     
    protected long
     
    protected OutputStream
    doGetOutputStream(boolean append)
     
    protected org.apache.commons.vfs2.RandomAccessContent
    doGetRandomAccessContent(org.apache.commons.vfs2.util.RandomAccessMode mode)
     
    protected org.apache.commons.vfs2.FileType
     
    protected boolean
     
    protected boolean
     
    protected boolean
     
    protected String[]
     
    protected org.apache.commons.vfs2.FileObject[]
     
    protected void
     
    protected void
    doRename(org.apache.commons.vfs2.FileObject newfile)
     
    protected void
    doSetAttribute(String attrName, Object value)
     
    protected boolean
    doSetLastModifiedTime(long modtime)
     
    boolean
     

    Methods inherited from class org.apache.commons.vfs2.provider.AbstractFileObject

    childrenChanged, close, compareTo, copyFrom, createFile, createFolder, delete, delete, deleteAll, doCreateFileContent, doDetach, doGetCertificates, doGetInputStream, doIsExecutable, doIsSameFile, doIsSymbolicLink, doSetExecutable, doSetReadable, doSetWritable, endOutput, finalize, findFiles, findFiles, getAbstractFileSystem, getChild, getChildren, getContent, getFileContentInfoFactory, getFileOperations, getFileSystem, getInputStream, getInputStream, getName, getOutputStream, getOutputStream, getParent, getPublicURIString, getRandomAccessContent, getType, getURL, handleChanged, handleCreate, handleDelete, holdObject, injectType, isAttached, isContentOpen, isExecutable, isFile, isFolder, isHidden, isReadable, isSameFile, isSymbolicLink, isWriteable, iterator, listFiles, moveTo, notifyAllStreamsClosed, onChange, onChildrenChanged, refresh, 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 org.apache.commons.vfs2.FileObject

    getPath, getURI

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Constructor Details

    • HdfsFileObject

      protected HdfsFileObject(org.apache.commons.vfs2.provider.AbstractFileName name, HdfsFileSystem fs, org.apache.hadoop.fs.FileSystem hdfs, org.apache.hadoop.fs.Path path)
      Constructs a new HDFS FileObject
      Parameters:
      name - FileName
      fs - HdfsFileSystem instance
      hdfs - Hadoop FileSystem instance
      path - Path to the file in HDFS
  • Method Details

    • 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<HdfsFileSystem>
      See Also:
      • AbstractFileObject.canRenameTo(org.apache.commons.vfs2.FileObject)
    • doAttach

      protected void doAttach() throws Exception
      Overrides:
      doAttach in class org.apache.commons.vfs2.provider.AbstractFileObject<HdfsFileSystem>
      Throws:
      Exception
      See Also:
      • AbstractFileObject.doAttach()
    • doCreateFolder

      protected void doCreateFolder() throws Exception
      Overrides:
      doCreateFolder in class org.apache.commons.vfs2.provider.AbstractFileObject<HdfsFileSystem>
      Throws:
      Exception
      Since:
      2.7.0
      See Also:
      • AbstractFileObject.doCreateFolder()
    • doDelete

      protected void doDelete() throws Exception
      Overrides:
      doDelete in class org.apache.commons.vfs2.provider.AbstractFileObject<HdfsFileSystem>
      Throws:
      Exception
      Since:
      2.7.0
      See Also:
      • AbstractFileObject.doDelete()
    • doGetAttributes

      protected Map<String,Object> doGetAttributes() throws Exception
      Overrides:
      doGetAttributes in class org.apache.commons.vfs2.provider.AbstractFileObject<HdfsFileSystem>
      Throws:
      Exception
      See Also:
      • AbstractFileObject.doGetAttributes()
    • doGetContentSize

      protected long doGetContentSize() throws Exception
      Specified by:
      doGetContentSize in class org.apache.commons.vfs2.provider.AbstractFileObject<HdfsFileSystem>
      Throws:
      Exception
      See Also:
      • AbstractFileObject.doGetContentSize()
    • doGetInputStream

      protected InputStream doGetInputStream(int bufferSize) throws Exception
      Overrides:
      doGetInputStream in class org.apache.commons.vfs2.provider.AbstractFileObject<HdfsFileSystem>
      Throws:
      Exception
      See Also:
      • AbstractFileObject.doGetInputStream(int)
    • doGetLastModifiedTime

      protected long doGetLastModifiedTime() throws Exception
      Overrides:
      doGetLastModifiedTime in class org.apache.commons.vfs2.provider.AbstractFileObject<HdfsFileSystem>
      Throws:
      Exception
      See Also:
      • AbstractFileObject.doGetLastModifiedTime()
    • doGetOutputStream

      protected OutputStream doGetOutputStream(boolean append) throws Exception
      Overrides:
      doGetOutputStream in class org.apache.commons.vfs2.provider.AbstractFileObject<HdfsFileSystem>
      Throws:
      Exception
      Since:
      2.7.0
      See Also:
      • AbstractFileObject.doGetOutputStream(boolean)
    • doGetRandomAccessContent

      protected org.apache.commons.vfs2.RandomAccessContent doGetRandomAccessContent(org.apache.commons.vfs2.util.RandomAccessMode mode) throws Exception
      Overrides:
      doGetRandomAccessContent in class org.apache.commons.vfs2.provider.AbstractFileObject<HdfsFileSystem>
      Throws:
      Exception
      See Also:
      • (org.apache.commons.vfs2.util.RandomAccessMode)
    • doGetType

      protected org.apache.commons.vfs2.FileType doGetType() throws Exception
      Specified by:
      doGetType in class org.apache.commons.vfs2.provider.AbstractFileObject<HdfsFileSystem>
      Throws:
      Exception
      See Also:
      • AbstractFileObject.doGetType()
    • doIsHidden

      protected boolean doIsHidden() throws Exception
      Overrides:
      doIsHidden in class org.apache.commons.vfs2.provider.AbstractFileObject<HdfsFileSystem>
      Throws:
      Exception
      See Also:
      • AbstractFileObject.doIsHidden()
    • doIsReadable

      protected boolean doIsReadable() throws Exception
      Overrides:
      doIsReadable in class org.apache.commons.vfs2.provider.AbstractFileObject<HdfsFileSystem>
      Throws:
      Exception
      See Also:
      • AbstractFileObject.doIsReadable()
    • doIsWriteable

      protected boolean doIsWriteable() throws Exception
      Overrides:
      doIsWriteable in class org.apache.commons.vfs2.provider.AbstractFileObject<HdfsFileSystem>
      Throws:
      Exception
      See Also:
      • AbstractFileObject.doIsWriteable()
    • doListChildren

      protected String[] doListChildren() throws Exception
      Specified by:
      doListChildren in class org.apache.commons.vfs2.provider.AbstractFileObject<HdfsFileSystem>
      Throws:
      Exception
      See Also:
      • AbstractFileObject.doListChildren()
    • doListChildrenResolved

      protected org.apache.commons.vfs2.FileObject[] doListChildrenResolved() throws Exception
      Overrides:
      doListChildrenResolved in class org.apache.commons.vfs2.provider.AbstractFileObject<HdfsFileSystem>
      Throws:
      Exception
      See Also:
      • AbstractFileObject.doListChildrenResolved()
    • doRemoveAttribute

      protected void doRemoveAttribute(String attrName) throws Exception
      Overrides:
      doRemoveAttribute in class org.apache.commons.vfs2.provider.AbstractFileObject<HdfsFileSystem>
      Throws:
      Exception
      See Also:
      • AbstractFileObject.doRemoveAttribute(String)
    • doRename

      protected void doRename(org.apache.commons.vfs2.FileObject newfile) throws Exception
      Overrides:
      doRename in class org.apache.commons.vfs2.provider.AbstractFileObject<HdfsFileSystem>
      Throws:
      Exception
      Since:
      2.7.0
      See Also:
      • AbstractFileObject.doRename(FileObject)
    • doSetAttribute

      protected void doSetAttribute(String attrName, Object value) throws Exception
      Overrides:
      doSetAttribute in class org.apache.commons.vfs2.provider.AbstractFileObject<HdfsFileSystem>
      Throws:
      Exception
      See Also:
      • AbstractFileObject.doSetAttribute(String, Object)
    • doSetLastModifiedTime

      protected boolean doSetLastModifiedTime(long modtime) throws Exception
      Overrides:
      doSetLastModifiedTime in class org.apache.commons.vfs2.provider.AbstractFileObject<HdfsFileSystem>
      Throws:
      Exception
      See Also:
      • AbstractFileObject.doSetLastModifiedTime(long)
    • 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<HdfsFileSystem>
      Returns:
      boolean true if file exists, false if not
      Throws:
      org.apache.commons.vfs2.FileSystemException
      See Also:
      • AbstractFileObject.exists()