public class VFSFileSystem extends FileSystem
FileSystem.DirectoryEntry, FileSystem.FileSystemOfflineException
logger, 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, toCanonicalFolderName
public void close()
public static VFSFileSystem createVFSFileSystem(java.net.URI root) throws FileSystem.FileSystemOfflineException, java.net.UnknownHostException
FileSystem.FileSystemOfflineException
java.net.UnknownHostException
public static VFSFileSystem createVFSFileSystem(java.net.URI root, boolean createFolder) throws FileSystem.FileSystemOfflineException, java.net.UnknownHostException
FileSystem.FileSystemOfflineException
java.net.UnknownHostException
protected org.apache.commons.vfs.FileObject getVFSFileObject() throws FileSystemException
FileSystemException
public FileObject getFileObject(java.lang.String filename)
FileSystem
getFileObject
in class FileSystem
filename
- the file name within the filesystempublic boolean isDirectory(java.lang.String filename) throws java.io.IOException
FileSystem
isDirectory
in class FileSystem
filename
- the namejava.io.IOException
public java.lang.String[] listDirectory(java.lang.String directory) throws java.io.IOException
listDirectory
in class FileSystem
directory
- java.io.IOException
public java.lang.String[] listDirectory(java.lang.String directory, java.lang.String regex) throws java.io.IOException
FileSystem
listDirectory
in class FileSystem
directory
- the directoryregex
- regular expressionjava.io.IOException
public java.io.File getLocalRoot()
FileSystem
getLocalRoot
in class FileSystem
public 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.IOException
protected 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.IOException
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable