public class S3FileObject
extends org.apache.commons.vfs2.provider.AbstractFileObject
implements org.apache.commons.vfs2.FileObject
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,java.lang.Object> |
attributes
The attributes specific for cloud file systems (e.g.
|
protected S3FileSystem |
fileSystem
The underlying file system.
|
protected boolean |
inRefresh
Helper to avoid multiple refreshing.
|
protected java.lang.String |
relPath
The relative path on the Amazon S3 server without leading slash, folders end with '/'.
|
protected com.amazonaws.services.s3.model.Bucket |
s3Bucket
The underlying Amazon S3 parent container.
|
protected com.amazonaws.services.s3.model.S3ObjectInputStream |
s3InputStream
Input streams are recycled by the S3 API, implement workaround for this.
|
protected com.amazonaws.services.s3.model.S3Object |
s3Object
The underlying Amazon S3 object,
null for folders. |
Constructor and Description |
---|
S3FileObject(org.apache.commons.vfs2.provider.AbstractFileName name,
S3FileSystem filesystem)
Constructor method.
|
Modifier and Type | Method and Description |
---|---|
protected void |
doCreateFolder()
Creates this file as a folder.
|
protected void |
doDelete()
Deletes the file.
|
protected void |
doDetach()
Detach from the file system.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
doGetAttributes()
Returns the attributes specific for cloud file systems (e.g.
|
protected long |
doGetContentSize()
Returns the size of the file content (in bytes).
|
protected java.io.InputStream |
doGetInputStream()
Creates an input stream to read the file content from.
|
protected long |
doGetLastModifiedTime()
Gets the last modification date and time.
|
protected java.io.OutputStream |
doGetOutputStream(boolean append)
Creates an output stream to write the file content to.
|
protected org.apache.commons.vfs2.RandomAccessContent |
doGetRandomAccessContent(org.apache.commons.vfs2.util.RandomAccessMode mode)
Provides the instance to model random access for files.
|
protected org.apache.commons.vfs2.FileType |
doGetType()
Determines the type of this file, returns
null if the file does not exist. |
protected java.lang.String[] |
doListChildren()
Lists the children of this file.
|
protected org.apache.commons.vfs2.FileObject[] |
doListChildrenResolved()
Lists the children of this file.
|
protected void |
doRename(org.apache.commons.vfs2.FileObject newfile)
Rename the file.
|
protected void |
doSetAttribute(java.lang.String attrName,
java.lang.Object value)
Sets an attribute of this cloud file.
|
protected boolean |
doSetLastModifiedTime(long modtime)
Sets the last modified time of this file (not supported by Amazon S3).
|
protected void |
finalize()
Clean-up method to help the gc.
|
VFSLib |
getVFSLib()
Provides the VFSLib instance for this filesystem.
|
protected void |
onChange()
Called when the type or content of this file changes.
|
void |
refresh()
Refresh this file.
|
protected void |
statSelf()
Determines the type of this file.
|
canRenameTo, childrenChanged, close, copyFrom, createFile, createFolder, delete, delete, doAttach, doCreateFileContent, doGetCertificates, doIsHidden, doIsReadable, doIsSameFile, doIsWriteable, doRemoveAttribute, endOutput, exists, findFiles, findFiles, getChild, getChildren, getContent, getFileContentInfoFactory, getFileOperations, getFileSystem, getInputStream, getName, getOutputStream, getOutputStream, getParent, getRandomAccessContent, getType, getURL, handleChanged, handleCreate, handleDelete, holdObject, injectType, isAttached, isContentOpen, isHidden, isReadable, isSameFile, isWriteable, moveTo, notifyAllStreamsClosed, onChildrenChanged, resolveFile, resolveFile, toString
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
canRenameTo, close, copyFrom, createFile, createFolder, delete, delete, exists, findFiles, findFiles, getChild, getChildren, getContent, getFileOperations, getFileSystem, getName, getParent, getType, getURL, isAttached, isContentOpen, isHidden, isReadable, isWriteable, moveTo, resolveFile, resolveFile
protected final S3FileSystem fileSystem
protected java.lang.String relPath
protected boolean inRefresh
protected com.amazonaws.services.s3.model.Bucket s3Bucket
protected com.amazonaws.services.s3.model.S3Object s3Object
null
for folders.protected java.util.Map<java.lang.String,java.lang.Object> attributes
protected com.amazonaws.services.s3.model.S3ObjectInputStream s3InputStream
public S3FileObject(org.apache.commons.vfs2.provider.AbstractFileName name, S3FileSystem filesystem) throws org.apache.commons.vfs2.FileSystemException
name
- The file namefilesystem
- The file systemjava.lang.NullPointerException
- If a parameter is null
org.apache.commons.vfs2.FileSystemException
- If something goes wrongprotected void finalize() throws java.lang.Throwable
finalize
in class org.apache.commons.vfs2.provider.AbstractFileObject
java.lang.Throwable
- Error indicationprotected void doDetach() throws java.lang.Exception
doDetach
in class org.apache.commons.vfs2.provider.AbstractFileObject
java.lang.Exception
- If something goes wrongpublic void refresh() throws org.apache.commons.vfs2.FileSystemException
refresh
in interface org.apache.commons.vfs2.FileObject
refresh
in class org.apache.commons.vfs2.provider.AbstractFileObject
org.apache.commons.vfs2.FileSystemException
- If something goes wrongprotected org.apache.commons.vfs2.FileType doGetType() throws java.lang.Exception
null
if the file does not exist.
doGetType
in class org.apache.commons.vfs2.provider.AbstractFileObject
java.lang.Exception
- If something goes wrongprotected void statSelf() throws java.lang.Exception
java.lang.Exception
- If something goes wrongprotected void onChange() throws java.lang.Exception
onChange
in class org.apache.commons.vfs2.provider.AbstractFileObject
java.lang.Exception
- If something goes wrongprotected void doCreateFolder() throws java.lang.Exception
doCreateFolder
in class org.apache.commons.vfs2.provider.AbstractFileObject
java.lang.Exception
- If something goes wrongprotected long doGetLastModifiedTime() throws java.lang.Exception
doGetLastModifiedTime
in class org.apache.commons.vfs2.provider.AbstractFileObject
java.lang.Exception
- If something goes wrongprotected boolean doSetLastModifiedTime(long modtime) throws java.lang.Exception
doSetLastModifiedTime
in class org.apache.commons.vfs2.provider.AbstractFileObject
modtime
- Last modification time in millisecondsjava.lang.Exception
- If something goes wrongprotected void doDelete() throws java.lang.Exception
doDelete
in class org.apache.commons.vfs2.provider.AbstractFileObject
java.lang.Exception
- If something goes wrongprotected void doRename(org.apache.commons.vfs2.FileObject newfile) throws java.lang.Exception
doRename
in class org.apache.commons.vfs2.provider.AbstractFileObject
java.lang.Exception
- If something goes wrongprotected org.apache.commons.vfs2.FileObject[] doListChildrenResolved() throws java.lang.Exception
doListChildrenResolved
in class org.apache.commons.vfs2.provider.AbstractFileObject
java.lang.Exception
- If something goes wrongprotected java.lang.String[] doListChildren() throws java.lang.Exception
doListChildren
in class org.apache.commons.vfs2.provider.AbstractFileObject
java.lang.Exception
- If something goes wrongprotected long doGetContentSize() throws java.lang.Exception
doGetContentSize
in class org.apache.commons.vfs2.provider.AbstractFileObject
java.lang.Exception
- If something goes wrongprotected org.apache.commons.vfs2.RandomAccessContent doGetRandomAccessContent(org.apache.commons.vfs2.util.RandomAccessMode mode) throws java.lang.Exception
doGetRandomAccessContent
in class org.apache.commons.vfs2.provider.AbstractFileObject
java.lang.Exception
- If something goes wrongprotected java.io.InputStream doGetInputStream() throws java.lang.Exception
doGetInputStream
in class org.apache.commons.vfs2.provider.AbstractFileObject
java.lang.Exception
- If something goes wrongprotected java.io.OutputStream doGetOutputStream(boolean append) throws java.lang.Exception
doGetOutputStream
in class org.apache.commons.vfs2.provider.AbstractFileObject
append
- Not supported currently, always created freshlyjava.lang.Exception
- If something goes wrongpublic VFSLib getVFSLib()
protected java.util.Map<java.lang.String,java.lang.Object> doGetAttributes() throws java.lang.Exception
doGetAttributes
in class org.apache.commons.vfs2.provider.AbstractFileObject
java.lang.Exception
protected void doSetAttribute(java.lang.String attrName, java.lang.Object value) throws java.lang.Exception
doSetAttribute
in class org.apache.commons.vfs2.provider.AbstractFileObject
attrName
- The name (ATTR_CONTENT_LENGTH|...)value
- The valuejava.lang.Exception
Copyright © 2005-2023 Leisenfels GmbH. All rights reserved.