public class VFSFileObject extends FileObject
| Modifier | Constructor and Description |
|---|---|
protected |
VFSFileObject(VFSFileSystem fs,
org.apache.commons.vfs.FileObject f)
Create a das2 FileObject from the given VFS FileObject
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canRead()
returns true if the file can be read by the client.
|
boolean |
canWrite() |
void |
close() |
void |
createFile()
Create the file named by this VFSFileObject.
|
void |
createFolder()
Create a folder named by this VFSFileObject.
|
void |
delete()
Deletes the file.
|
boolean |
exists()
returns true if the file exists.
|
java.nio.channels.ReadableByteChannel |
getChannel(ProgressMonitor monitor)
opens a Channel, perhaps transferring the file to a local cache first.
|
FileObject[] |
getChildren()
returns objects within a folder.
|
java.io.File |
getFile(ProgressMonitor monitor)
gets a File object that can be opened by the client.
|
java.io.InputStream |
getInputStream(ProgressMonitor monitor)
opens an inputStream, perhaps transferring the file to a
cache first.
|
java.lang.String |
getNameExt()
returns the canonical name of the file within the filesystem.
|
java.io.OutputStream |
getOutputStream(boolean append) |
FileObject |
getParent()
returns the parent FileObject (a folder).
|
long |
getSize()
returns the size of the file.
|
boolean |
isData()
returns true if the file is a data file that to be used
reading or writing data.
|
boolean |
isFolder()
indicates the type of FileObject
|
boolean |
isLocal()
returns true if the file is locally available, meaning clients can
call getFile() and the readable File reference will be available in
interactive time.
|
boolean |
isReadOnly()
true is the file is read-only.
|
boolean |
isRoot()
returns true if this is the root of the filesystem it came from.
|
java.util.Date |
lastModified()
returns the Date when the file was last modified.
|
getCapability, getChannel, getFile, getInputStream, removeLocalFileprotected VFSFileObject(VFSFileSystem fs, org.apache.commons.vfs.FileObject f)
fs - f - public boolean canRead()
FileObjectcanRead in class FileObjectpublic FileObject[] getChildren() throws java.io.IOException
FileObjectgetChildren in class FileObjectjava.io.IOExceptionpublic java.io.InputStream getInputStream(ProgressMonitor monitor) throws java.io.FileNotFoundException, java.io.IOException
FileObjectgetInputStream in class FileObjectmonitor - for monitoring the download. The monitor won't be used when the access
is immediate, for example with local FileObjects.java.io.FileNotFoundException - if the file doesn't exist.java.io.IOExceptionpublic java.nio.channels.ReadableByteChannel getChannel(ProgressMonitor monitor) throws java.io.FileNotFoundException, java.io.IOException
FileObjectgetChannel in class FileObjectmonitor - for monitoring the download. The monitor won't be used when the access
is immediate, for example with local FileObjects.java.io.FileNotFoundException - if the file doesn't exist.java.io.IOExceptionpublic java.io.File getFile(ProgressMonitor monitor) throws java.io.FileNotFoundException, java.io.IOException
FileObjectgetFile in class FileObjectmonitor - for monitoring the download. The monitor won't be used when the access
is immediate, for example with local FileObjects.java.io.FileNotFoundException - if the file doesn't exist.java.io.IOException - if the file cannot be made localpublic FileObject getParent()
FileObjectgetParent in class FileObjectpublic long getSize()
FileObjectgetSize in class FileObjectpublic boolean isData()
FileObjectisData in class FileObjectpublic boolean isFolder()
FileObjectisFolder in class FileObjectpublic boolean isReadOnly()
FileObjectisReadOnly in class FileObjectpublic boolean isRoot()
FileObjectisRoot in class FileObjectpublic boolean isLocal()
FileObjectisLocal in class FileObjectpublic boolean exists()
FileObjectexists in class FileObjectpublic java.lang.String getNameExt()
FileObjectgetNameExt in class FileObjectpublic java.util.Date lastModified()
FileObjectlastModified in class FileObjectpublic boolean canWrite()
throws java.io.IOException
java.io.IOExceptionpublic void createFolder()
throws java.io.IOException
java.io.IOException - If parent folder is read-only, or other error creating this
folder or ancestors, or if folder name exists as file.public void createFile()
throws java.io.IOException
java.io.IOException - If parent folder is read-only, or error creating ancestor
folders, or if file exists and is a folder.public void delete()
throws java.io.IOException
java.io.IOException - If the file is a non-empty folder, or is read-only,
or on other error during deletion.public java.io.OutputStream getOutputStream(boolean append)
throws java.io.IOException
java.io.IOExceptionpublic void close()
throws java.io.IOException
java.io.IOException