public class VFSFileSystem extends FileSystem
FileSystem.DirectoryEntry, FileSystem.FileSystemOfflineExceptionlogger, loggerUrl, NULL, PROP_CASE_INSENSITIVE, properties| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected void |
copyStream(java.io.InputStream is,
java.io.OutputStream out,
ProgressMonitor monitor)
copies data from in to out, sending the number of bytesTransferred to the monitor.
|
static VFSFileSystem |
createVFSFileSystem(java.net.URI root) |
static VFSFileSystem |
createVFSFileSystem(java.net.URI root,
boolean createFolder) |
protected void |
downloadFile(java.lang.String filename,
java.io.File f,
java.io.File partfile,
ProgressMonitor monitor)
Transfers the file from the remote store to a local copy f.
|
protected void |
finalize() |
protected java.util.concurrent.locks.Lock |
getDownloadLock(java.lang.String filename,
java.io.File f,
ProgressMonitor monitor)
Request lock to download file.
|
FileObject |
getFileObject(java.lang.String filename)
return the FileObject that corresponds to the name.
|
java.io.File |
getLocalRoot()
return the folder that is a local copy of the filesystem.
|
protected org.apache.commons.vfs.FileObject |
getVFSFileObject() |
boolean |
isDirectory(java.lang.String filename)
return true if the name is a directory.
|
boolean |
isLocal() |
java.lang.String[] |
listDirectory(java.lang.String directory)
return a list of files and folders in the directory.
|
java.lang.String[] |
listDirectory(java.lang.String directory,
java.lang.String regex)
returns a list of the names of the files in a directory that match regex.
|
create, create, create, create, create, create, createFileSystem, getExceptionHandler, getListing, getListing, getProperty, getRootURI, listDirectory, listDirectory, listDirectoryDeep, peek, peekInstances, recreate, recreate, registerFileSystemFactory, reset, reset, setExceptionHandler, settings, splitUrl, toCanonicalFilename, toCanonicalFolderName, toCanonicalFolderNamepublic void close()
public static VFSFileSystem createVFSFileSystem(java.net.URI root) throws FileSystem.FileSystemOfflineException, java.net.UnknownHostException
FileSystem.FileSystemOfflineExceptionjava.net.UnknownHostExceptionpublic static VFSFileSystem createVFSFileSystem(java.net.URI root, boolean createFolder) throws FileSystem.FileSystemOfflineException, java.net.UnknownHostException
FileSystem.FileSystemOfflineExceptionjava.net.UnknownHostExceptionprotected org.apache.commons.vfs.FileObject getVFSFileObject()
throws FileSystemException
FileSystemExceptionpublic FileObject getFileObject(java.lang.String filename)
FileSystemgetFileObject in class FileSystemfilename - the file name within the filesystempublic boolean isDirectory(java.lang.String filename)
throws java.io.IOException
FileSystemisDirectory in class FileSystemfilename - the namejava.io.IOExceptionpublic java.lang.String[] listDirectory(java.lang.String directory)
throws java.io.IOException
listDirectory in class FileSystemdirectory - java.io.IOExceptionfor listings constrained by regular expressions.public java.lang.String[] listDirectory(java.lang.String directory,
java.lang.String regex)
throws java.io.IOException
FileSystemlistDirectory in class FileSystemdirectory - the directoryregex - regular expressionjava.io.IOExceptionpublic java.io.File getLocalRoot()
FileSystemgetLocalRoot in class FileSystempublic boolean isLocal()
protected java.util.concurrent.locks.Lock getDownloadLock(java.lang.String filename,
java.io.File f,
ProgressMonitor monitor)
throws java.io.IOException
filename - the filename with in the filesystem.f - the File which will be the local copy.monitor - a monitor for the download. If a MutatorLock is returned, then
the monitor is not touched, but other threads may use it to keep track
of the download progress.java.io.FileNotFoundException - if the file wasn't found after another thread loaded the file.java.io.IOExceptionprotected void copyStream(java.io.InputStream is,
java.io.OutputStream out,
ProgressMonitor monitor)
throws java.io.IOException
is - the input stream source of dataout - the output stream to where the data is copied.monitor - monitor for the transfer, where only setTaskProgress and isCancelled are called.java.io.IOException - if the transfer is interrupted.protected void downloadFile(java.lang.String filename,
java.io.File f,
java.io.File partfile,
ProgressMonitor monitor)
throws java.io.IOException
filename - the name of the file, relative to the filesystem.f - the file to where the file is downloaded.partfile - the temporary file during download.monitor - progress monitorjava.io.IOExceptionprotected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwable