public class DbxFileObject
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.
|
static java.text.DateFormat |
DATE_FORMAT_LAST_MODIFIED
The format of the "lastModified" attribute.
|
protected com.dropbox.core.DbxEntry |
dbxEntry
The underlying Dropbox file/folder.
|
protected DbxFileSystem |
fileSystem
The underlying file system.
|
protected boolean |
inRefresh
Helper to avoid multiple refreshing.
|
protected java.util.Properties |
props
The parsed metadata from
DbxEntry . |
protected java.lang.String |
relPath
The relative path on the Dropbox server.
|
Constructor and Description |
---|
DbxFileObject(org.apache.commons.vfs2.provider.AbstractFileName name,
DbxFileSystem 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 Dropbox).
|
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
public static final java.text.DateFormat DATE_FORMAT_LAST_MODIFIED
protected final DbxFileSystem fileSystem
protected java.lang.String relPath
protected boolean inRefresh
protected com.dropbox.core.DbxEntry dbxEntry
protected java.util.Properties props
DbxEntry
.protected java.util.Map<java.lang.String,java.lang.Object> attributes
public DbxFileObject(org.apache.commons.vfs2.provider.AbstractFileName name, DbxFileSystem 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-2014 Leisenfels UG. All rights reserved.