|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.das2.util.filesystem.FileSystem
org.das2.util.filesystem.WebFileSystem
public abstract class WebFileSystem
Base class for HTTP and FTP-based filesystems. A local cache is kept of the files.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.das2.util.filesystem.FileSystem |
---|
FileSystem.DirectoryEntry, FileSystem.FileSystemOfflineException |
Field Summary | |
---|---|
protected java.io.File |
localRoot
|
protected boolean |
offline
|
static java.lang.String |
PROP_OFFLINE
if true, then the remote filesystem is not accessible, but local cache copies may be accessed. |
protected WebProtocol |
protocol
plug-in template for implementation. |
Fields inherited from class org.das2.util.filesystem.FileSystem |
---|
logger, PROP_CASE_INSENSITIVE, properties |
Constructor Summary | |
---|---|
protected |
WebFileSystem(java.net.URL root,
java.io.File localRoot)
Creates a new instance of WebFileSystem |
Method Summary | |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
|
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. |
protected abstract 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. |
static java.io.File |
getDownloadDirectory()
|
FileObject |
getFileObject(java.lang.String filename)
return the FileObject that corresponds to the name. |
java.lang.String |
getLocalName(java.io.File file)
return the name of the File within the FileSystem, where File is a local file within the local copy of the filesystem. |
java.lang.String |
getLocalName(java.net.URL url)
|
java.io.File |
getLocalRoot()
return the folder that is a local copy of the filesystem. |
java.lang.String |
getLocalRootAbsPath()
Deprecated. use getLocalRoot().getAbsolutePath() |
java.net.URL |
getURL(java.lang.String filename)
|
boolean |
isAppletMode()
|
abstract boolean |
isDirectory(java.lang.String filename)
|
boolean |
isOffline()
|
abstract java.lang.String[] |
listDirectory(java.lang.String directory)
returns a list of the names of the files in a 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. |
protected static java.io.File |
localRoot(java.net.URL root)
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
|
void |
setAppletMode(boolean applet)
|
void |
setOffline(boolean offline)
|
java.lang.String |
toString()
|
Methods inherited from class org.das2.util.filesystem.FileSystem |
---|
create, createFileSystem, getProperty, getRootURL, registerFileSystemFactory, settings, splitUrl, toCanonicalFilename, toCanonicalFolderName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final java.io.File localRoot
protected WebProtocol protocol
protected boolean offline
public static final java.lang.String PROP_OFFLINE
Constructor Detail |
---|
protected WebFileSystem(java.net.URL root, java.io.File localRoot)
Method Detail |
---|
public static java.io.File getDownloadDirectory()
public boolean isOffline()
public void setOffline(boolean offline)
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
protected static java.io.File localRoot(java.net.URL root)
protected abstract void downloadFile(java.lang.String filename, java.io.File f, java.io.File partfile, ProgressMonitor monitor) throws java.io.IOException
partfile
- the temporary file during download.
java.io.IOException
public java.lang.String getLocalRootAbsPath()
public java.io.File getLocalRoot()
FileSystem
getLocalRoot
in class FileSystem
public abstract boolean isDirectory(java.lang.String filename) throws java.io.IOException
isDirectory
in class FileSystem
java.io.IOException
public abstract java.lang.String[] listDirectory(java.lang.String directory) throws java.io.IOException
FileSystem
listDirectory
in class FileSystem
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
java.io.IOException
public java.net.URL getURL(java.lang.String filename)
public java.lang.String getLocalName(java.io.File file)
public java.lang.String getLocalName(java.net.URL url)
public FileObject getFileObject(java.lang.String filename)
FileSystem
getFileObject
in class FileSystem
protected void copyStream(java.io.InputStream is, java.io.OutputStream out, ProgressMonitor monitor) throws java.io.IOException
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isAppletMode()
public void setAppletMode(boolean applet)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |