public class GDriveFileObject
extends org.apache.commons.vfs2.provider.AbstractFileObject
implements org.apache.commons.vfs2.FileObject
| Modifier and Type | Field and Description |
|---|---|
protected GDriveFileSystem |
fileSystem
The underlying file system.
|
protected com.google.api.services.drive.model.File |
googleFile
The underlying Google® Drive file/folder.
|
protected boolean |
inRefresh
Helper to avoid multiple refreshing.
|
protected java.lang.String |
relPath
The relative path on the Google® Drive server.
|
protected java.lang.String |
rootID
The shared ID of the Google® Drive root folder.
|
| Constructor and Description |
|---|
GDriveFileObject(org.apache.commons.vfs2.provider.AbstractFileName name,
GDriveFileSystem 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 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 boolean |
doSetLastModifiedTime(long modtime)
Sets the last modified time of this file.
|
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, doGetAttributes, doGetCertificates, doIsHidden, doIsReadable, doIsSameFile, doIsWriteable, doRemoveAttribute, doSetAttribute, endOutput, exists, finalize, 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, toStringclone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitcanRenameTo, 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, resolveFileprotected final GDriveFileSystem fileSystem
protected java.lang.String relPath
protected boolean inRefresh
protected com.google.api.services.drive.model.File googleFile
protected java.lang.String rootID
public GDriveFileObject(org.apache.commons.vfs2.provider.AbstractFileName name,
GDriveFileSystem filesystem)
throws org.apache.commons.vfs2.FileSystemException
name - The file namefilesystem - The file systemjava.lang.NullPointerException - If a parameter is nullorg.apache.commons.vfs2.FileSystemException - If something goes wrongprotected void doDetach()
throws java.lang.Exception
doDetach in class org.apache.commons.vfs2.provider.AbstractFileObjectjava.lang.Exception - If something goes wrongpublic void refresh()
throws org.apache.commons.vfs2.FileSystemException
refresh in interface org.apache.commons.vfs2.FileObjectrefresh in class org.apache.commons.vfs2.provider.AbstractFileObjectorg.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.AbstractFileObjectjava.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.AbstractFileObjectjava.lang.Exception - If something goes wrongprotected void doCreateFolder()
throws java.lang.Exception
doCreateFolder in class org.apache.commons.vfs2.provider.AbstractFileObjectjava.lang.Exception - If something goes wrongprotected long doGetLastModifiedTime()
throws java.lang.Exception
doGetLastModifiedTime in class org.apache.commons.vfs2.provider.AbstractFileObjectjava.lang.Exception - If something goes wrongprotected boolean doSetLastModifiedTime(long modtime)
throws java.lang.Exception
doSetLastModifiedTime in class org.apache.commons.vfs2.provider.AbstractFileObjectmodtime - 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.AbstractFileObjectjava.lang.Exception - If something goes wrongGDriveFileSystemConfigBuilder.setUseTrash(FileSystemOptions, Boolean)protected void doRename(org.apache.commons.vfs2.FileObject newfile)
throws java.lang.Exception
exists() etc. is called.
doRename in class org.apache.commons.vfs2.provider.AbstractFileObjectjava.lang.Exception - If something goes wrongprotected org.apache.commons.vfs2.FileObject[] doListChildrenResolved()
throws java.lang.Exception
doListChildrenResolved in class org.apache.commons.vfs2.provider.AbstractFileObjectjava.lang.Exception - If something goes wrongprotected java.lang.String[] doListChildren()
throws java.lang.Exception
doListChildren in class org.apache.commons.vfs2.provider.AbstractFileObjectjava.lang.Exception - If something goes wrongprotected long doGetContentSize()
throws java.lang.Exception
doGetContentSize in class org.apache.commons.vfs2.provider.AbstractFileObjectjava.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.AbstractFileObjectjava.lang.Exception - If something goes wrongprotected java.io.InputStream doGetInputStream()
throws java.lang.Exception
doGetInputStream in class org.apache.commons.vfs2.provider.AbstractFileObjectjava.lang.Exception - If something goes wrongprotected java.io.OutputStream doGetOutputStream(boolean append)
throws java.lang.Exception
doGetOutputStream in class org.apache.commons.vfs2.provider.AbstractFileObjectappend - Append? Create freshly otherwise.java.lang.Exception - If something goes wrongpublic VFSLib getVFSLib()
Copyright © 2005-2013 Leisenfels UG. All rights reserved.