org.das2.util.filesystem
Class HttpFileSystem

java.lang.Object
  extended by org.das2.util.filesystem.FileSystem
      extended by org.das2.util.filesystem.WebFileSystem
          extended by org.das2.util.filesystem.HttpFileSystem

public class HttpFileSystem
extends WebFileSystem


Nested Class Summary
 
Nested classes/interfaces inherited from class org.das2.util.filesystem.FileSystem
FileSystem.DirectoryEntry, FileSystem.FileSystemOfflineException
 
Field Summary
 
Fields inherited from class org.das2.util.filesystem.WebFileSystem
localRoot, offline, PROP_OFFLINE, protocol
 
Fields inherited from class org.das2.util.filesystem.FileSystem
logger, PROP_CASE_INSENSITIVE, properties
 
Method Summary
static HttpFileSystem createHttpFileSystem(java.net.URL root)
           
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  java.util.Map<java.lang.String,java.lang.Object> getHeadMeta(java.lang.String f)
          this is introduced to support checking if the symbol foo/bar is a folder by checking for a 303 redirect.
 boolean isDirectory(java.lang.String filename)
          dumb method looks for / in parent directory's listing.
 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.
 
Methods inherited from class org.das2.util.filesystem.WebFileSystem
addPropertyChangeListener, copyStream, getDownloadDirectory, getFileObject, getLocalName, getLocalName, getLocalRoot, getLocalRootAbsPath, getURL, isAppletMode, isOffline, localRoot, removePropertyChangeListener, setAppletMode, setOffline, 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
 

Method Detail

createHttpFileSystem

public static HttpFileSystem createHttpFileSystem(java.net.URL root)
                                           throws FileSystem.FileSystemOfflineException
Throws:
FileSystem.FileSystemOfflineException

downloadFile

protected void downloadFile(java.lang.String filename,
                            java.io.File f,
                            java.io.File partFile,
                            ProgressMonitor monitor)
                     throws java.io.IOException
Description copied from class: WebFileSystem
Transfers the file from the remote store to a local copy f. This should only be used within the class and subclasses, clients should use getFileObject( String ).getFile(). Subclasses implementing this should download data to partfile, then rename partfile to f after the download is complete.

Specified by:
downloadFile in class WebFileSystem
partFile - the temporary file during download.
Throws:
java.io.IOException

getHeadMeta

protected java.util.Map<java.lang.String,java.lang.Object> getHeadMeta(java.lang.String f)
                                                                throws java.io.IOException
this is introduced to support checking if the symbol foo/bar is a folder by checking for a 303 redirect. EXIST->Boolean REAL_NAME->String

Parameters:
f -
Throws:
java.io.IOException

isDirectory

public boolean isDirectory(java.lang.String filename)
                    throws java.io.IOException
dumb method looks for / in parent directory's listing. Since we have to list the parent, then IOException can be thrown.

Specified by:
isDirectory in class WebFileSystem
Throws:
java.io.IOException

listDirectory

public java.lang.String[] listDirectory(java.lang.String directory)
                                 throws java.io.IOException
Description copied from class: FileSystem
returns a list of the names of the files in a directory. Names ending in "/" are themselves directories, and the "/" is not part of the name. This is optional, and a directory may or may not be tagged with the trailing slash.

Specified by:
listDirectory in class WebFileSystem
Throws:
java.io.IOException

listDirectory

public java.lang.String[] listDirectory(java.lang.String directory,
                                        java.lang.String regex)
                                 throws java.io.IOException
Description copied from class: FileSystem
returns a list of the names of the files in a directory that match regex. Trailing slashes on directory names are not part of the name and need not be part of the regex.

Overrides:
listDirectory in class WebFileSystem
Throws:
java.io.IOException