org.das2.util.filesystem.FileSystem
Filesystems provide an abstraction layer so that clients can access
any hierarchy of files in a implementation-independent way. For example,
remote filesystems accessible via HTTP are accessible through the same
interface as a local filesystem.
PROP_CASE_INSENSITIVE
Boolean.TRUE if the filesystem ignores case, such as Windows local filesystem.
getExceptionHandler
getExceptionHandler( ) → ExceptionHandler
return the exception handler.
Returns:
the exception handler.
search for examples
view on GitHub
view source
getListing
getListing( org.das2.util.filesystem.FileSystem.DirectoryEntry[] des ) → String
part of the refactoring to cache time stamps as well, this convenience method returns the old string.
This returns des.name, plus '/' if it's a directory.
Parameters
des - array of directory entries.
Returns:
des.name, and
search for examples
view on GitHub
view source
getRootURI
getRootURI( ) → URI
return the URI identifying the root of the filesystem.
Returns:
java.net.URI
search for examples
view on GitHub
view source
listDirectoryDeep
listDirectoryDeep( String directory, String regex ) → String
do a deep listing of directories, resolving wildcards along the way. Note this
can be quite expensive, so be careful when levels are too deep.
Parameters
directory - location within the filesystem.
regex - regular expression (.*\.dat) (not a glob like *.dat).
Returns:
the entire path of each matching name, including the directory within the filesystem.
search for examples
view on GitHub
view source
peekInstances
peekInstances( ) → FileSystem
return a copy of all cached filesystems
Returns:
org.das2.util.filesystem.FileSystem[]
search for examples
view on GitHub
view source
recreate
recreate( java.net.URI root ) → FileSystem
creates a FileSystem, removing and recreating it if it was in the cache.
Parameters
root -
Returns:
org.das2.util.filesystem.FileSystem
search for examples
view on GitHub
view source
registerFileSystemFactory
registerFileSystemFactory( String proto, org.das2.util.filesystem.FileSystemFactory factory ) → void
register a code for handling a filesystem type. For example, an
FTP implementation can be registered to handle URIs like "ftp://autoplot.org/"
Parameters
proto - protocol identifier, like "ftp" "http" or "sftp"
factory - the factory which will handle the URI.
Returns:
void (returns nothing)
search for examples
view on GitHub
view source
setExceptionHandler
setExceptionHandler( org.das2.util.ExceptionHandler eh ) → void
set the exception handler that is called when exceptions occur.
Parameters
eh - the exception handler.
Returns:
void (returns nothing)
search for examples
view on GitHub
view source
settings
settings( ) → FileSystemSettings
access the file system settings.
Returns:
the single settings object.
search for examples
view on GitHub
view source
splitUrl
splitUrl( String surl ) → String
returns a String[5]:
[0] is proto "http://"
[1] will be the host
[2] is proto + path
[3] is proto + path + file
[4] is file ext
[5] is params, not including ?.
The URL must start with one of file:, ftp://, http://, https://, sftp://
and "c:" is interpreted as "file:///c:..."
Parameters
surl - a URL string to parse.
Returns:
the parsed URL.
search for examples
view on GitHub
view source
toCanonicalFilename
toCanonicalFilename( String filename ) → String
returns the canonical name /a/b/c.dat of a string that
may contain backslashes and might not have the leading /
and trailing slashes. Also, double slashes (//) are
removed. Even for Windows files, forward slashes are used.
Parameters
filename - name
Returns:
name with \ converted to /, etc.
search for examples
view on GitHub
view source
toCanonicalFolderName
toCanonicalFolderName( String name ) → String
returns the canonical name (/a/b/) of a string that
may contain backslashes and might not have the leading /
and trailing slashes. Also, double slashes (//) are
removed. Note this is the name of the FileObject
within the FileSystem.
Parameters
name - folder name
Returns:
name with \ converted to /, etc.
search for examples
view on GitHub
view source