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<FileObject>
,Iterable<FileObject>
,FileObject
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
ConstructorsModifierConstructorDescriptionprotected
HdfsFileObject
(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 TypeMethodDescriptionboolean
canRenameTo
(FileObject newfile) protected void
doAttach()
protected void
protected void
doDelete()
protected long
protected InputStream
doGetInputStream
(int bufferSize) protected long
protected OutputStream
doGetOutputStream
(boolean append) protected RandomAccessContent
protected FileType
protected boolean
protected boolean
protected boolean
protected String[]
protected FileObject[]
protected void
doRemoveAttribute
(String attrName) protected void
doRename
(FileObject newfile) protected void
doSetAttribute
(String attrName, Object value) protected boolean
doSetLastModifiedTime
(long modtime) boolean
exists()
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(AbstractFileName name, HdfsFileSystem fs, org.apache.hadoop.fs.FileSystem hdfs, org.apache.hadoop.fs.Path path) Constructs a new HDFS FileObject- Parameters:
name
- FileNamefs
- HdfsFileSystem instancehdfs
- Hadoop FileSystem instancepath
- Path to the file in HDFS
-
-
Method Details
-
canRenameTo
- Specified by:
canRenameTo
in interfaceFileObject
- Overrides:
canRenameTo
in classAbstractFileObject<HdfsFileSystem>
- See Also:
-
doAttach
- Overrides:
doAttach
in classAbstractFileObject<HdfsFileSystem>
- Throws:
Exception
- See Also:
-
doCreateFolder
- Overrides:
doCreateFolder
in classAbstractFileObject<HdfsFileSystem>
- Throws:
Exception
- Since:
- 2.7.0
- See Also:
-
doDelete
- Overrides:
doDelete
in classAbstractFileObject<HdfsFileSystem>
- Throws:
Exception
- Since:
- 2.7.0
- See Also:
-
doGetAttributes
- Overrides:
doGetAttributes
in classAbstractFileObject<HdfsFileSystem>
- Throws:
Exception
- See Also:
-
doGetContentSize
- Specified by:
doGetContentSize
in classAbstractFileObject<HdfsFileSystem>
- Throws:
Exception
- See Also:
-
doGetInputStream
- Overrides:
doGetInputStream
in classAbstractFileObject<HdfsFileSystem>
- Throws:
Exception
- See Also:
-
doGetLastModifiedTime
- Overrides:
doGetLastModifiedTime
in classAbstractFileObject<HdfsFileSystem>
- Throws:
Exception
- See Also:
-
doGetOutputStream
- Overrides:
doGetOutputStream
in classAbstractFileObject<HdfsFileSystem>
- Throws:
Exception
- Since:
- 2.7.0
- See Also:
-
doGetRandomAccessContent
- Overrides:
doGetRandomAccessContent
in classAbstractFileObject<HdfsFileSystem>
- Throws:
Exception
- See Also:
-
doGetType
- Specified by:
doGetType
in classAbstractFileObject<HdfsFileSystem>
- Throws:
Exception
- See Also:
-
doIsHidden
- Overrides:
doIsHidden
in classAbstractFileObject<HdfsFileSystem>
- Throws:
Exception
- See Also:
-
doIsReadable
- Overrides:
doIsReadable
in classAbstractFileObject<HdfsFileSystem>
- Throws:
Exception
- See Also:
-
doIsWriteable
- Overrides:
doIsWriteable
in classAbstractFileObject<HdfsFileSystem>
- Throws:
Exception
- See Also:
-
doListChildren
- Specified by:
doListChildren
in classAbstractFileObject<HdfsFileSystem>
- Throws:
Exception
- See Also:
-
doListChildrenResolved
- Overrides:
doListChildrenResolved
in classAbstractFileObject<HdfsFileSystem>
- Throws:
Exception
- See Also:
-
doRemoveAttribute
- Overrides:
doRemoveAttribute
in classAbstractFileObject<HdfsFileSystem>
- Throws:
Exception
- See Also:
-
doRename
- Overrides:
doRename
in classAbstractFileObject<HdfsFileSystem>
- Throws:
Exception
- Since:
- 2.7.0
- See Also:
-
doSetAttribute
- Overrides:
doSetAttribute
in classAbstractFileObject<HdfsFileSystem>
- Throws:
Exception
- See Also:
-
doSetLastModifiedTime
- Overrides:
doSetLastModifiedTime
in classAbstractFileObject<HdfsFileSystem>
- Throws:
Exception
- See Also:
-
exists
- Specified by:
exists
in interfaceFileObject
- Overrides:
exists
in classAbstractFileObject<HdfsFileSystem>
- Returns:
- boolean true if file exists, false if not
- Throws:
FileSystemException
- See Also:
-