org.das2.util.filesystem
Class LocalFileSystem
java.lang.Object
org.das2.util.filesystem.FileSystem
org.das2.util.filesystem.LocalFileSystem
public class LocalFileSystem
- extends FileSystem
Constructor Summary |
protected |
LocalFileSystem(java.net.URL root)
Note the String used to create the URL should have either one or three slashes:
file:/home/jbf or file:///home/jbf but not
file://home/jbf
Also, on Windows, /c:/documents and settings/jbf/ is okay. |
Method Summary |
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. |
boolean |
isDirectory(java.lang.String filename)
|
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. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
LocalFileSystem
protected LocalFileSystem(java.net.URL root)
throws FileSystem.FileSystemOfflineException
- Note the String used to create the URL should have either one or three slashes:
file:/home/jbf or file:///home/jbf but not
file://home/jbf
Also, on Windows, /c:/documents and settings/jbf/ is okay.
- Throws:
FileSystem.FileSystemOfflineException
isDirectory
public boolean isDirectory(java.lang.String filename)
- Specified by:
isDirectory
in class FileSystem
listDirectory
public java.lang.String[] listDirectory(java.lang.String directory)
- 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 FileSystem
listDirectory
public java.lang.String[] listDirectory(java.lang.String directory,
java.lang.String regex)
- 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.
- Specified by:
listDirectory
in class FileSystem
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
getFileObject
public FileObject getFileObject(java.lang.String filename)
- Description copied from class:
FileSystem
- return the FileObject that corresponds to the name.
- Specified by:
getFileObject
in class FileSystem
getLocalRoot
public java.io.File getLocalRoot()
- Description copied from class:
FileSystem
- return the folder that is a local copy of the filesystem.
For LocalFilesystem, this is the same as the filesystem. For remote
filesystems, this is a folder within their home directory.
Note File.getAbsolutePath() returns the string representation of this root.
- Specified by:
getLocalRoot
in class FileSystem
- Returns:
- the folder that is a local copy of the filesystem.