|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.itr_rescue.dataGuard.localFileSystem.JFMFileSystem
public abstract class JFMFileSystem
This class represents the base class for all filesystems.
Constructor Summary | |
---|---|
JFMFileSystem()
Empy constructor. |
Method Summary | |
---|---|
boolean |
canRead(JFMFile file)
Tests whether the application can read the file denoted by the abstract pathname. |
boolean |
canWrite(JFMFile file)
Tests whether the application can modify to the file denoted by the abstract pathname. |
static JFMFileSystem |
createFileSystem(java.lang.String name)
This method searches through the registered filesystems, loads and returns the requested one. |
abstract boolean |
createNewFile(JFMFile parent,
java.lang.String name)
Atomically creates a new, empty file named by the abstract pathname if and only if a file with that name does not yet exist. |
boolean |
delete(JFMFile file)
Deletes the file or directory denoted by the abstract pathname. |
boolean |
exists(JFMFile file)
Tests whether the file or directory denoted by the abstract pathname exists. |
abstract JFMFile |
getDefaultRootDirectory()
The default root directory in the case of filesystems with more than one root directories (like windows) |
abstract JFMFile |
getFile(java.lang.String pathName)
This method returns an JFMFile object based on the pathname provided |
abstract char |
getPathSeparator()
The system-dependent path-separator character. |
java.lang.String |
getPathSeparatorString()
The system-dependent path-separator character, represented as a string for convenience. |
static java.util.Hashtable<java.lang.String,java.lang.String> |
getRegisteredFilesystems()
|
JFMFile |
getRootDriveFile(JFMFile file)
This method returns the root directory of the filesystem of witch the supplied file belongs to. |
abstract char |
getSeparator()
The system-dependent default name-separator character. |
java.lang.String |
getSeparatorString()
The system-dependent default name-separator character, represented as a string for convenience. |
abstract JFMFile |
getStartDirectory()
This method returns the start directory for this filesystem |
boolean |
isLocal()
Tells us if the filesystem is local. |
abstract JFMFile[] |
listFiles(JFMFile rootFile)
Returns an array of abstract pathnames denoting the files in the directory denoted by the abstract pathname. |
abstract JFMFile[] |
listFiles(JFMFile rootFile,
java.io.FilenameFilter filter)
Returns an array of abstract pathnames denoting the files and directories in the directory denoted by this abstract pathname that satisfy the specified filter. |
abstract JFMFile[] |
listRoots()
List the available filesystem roots. |
abstract boolean |
mkdir(JFMFile parent,
java.lang.String name)
Creates the directory named by the abstract pathname denoted by the parameter. |
static void |
registerFilesystems()
This method searches the java path and the plugins directory (a subdirectory of the current directory) for jar's that contain a filesystem plugin. |
abstract boolean |
setLastModified(JFMFile file,
long time)
Sets the last-modified time of the file or directory named by the abstract pathname. |
abstract boolean |
setReadOnly(JFMFile file)
Marks the file or directory named by the abstract pathname so that only read operations are allowed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JFMFileSystem()
Method Detail |
---|
public static java.util.Hashtable<java.lang.String,java.lang.String> getRegisteredFilesystems()
public static void registerFilesystems()
public static JFMFileSystem createFileSystem(java.lang.String name)
name
- The name of the requested filesystem, or null if you accept the default one
public abstract JFMFile getDefaultRootDirectory()
public abstract char getPathSeparator()
path.separator
. This character is used to
separate filenames in a sequence of files given as a path list.
On UNIX systems, this character is ':'
; on Microsoft Windows systems it
is ';'
.
public java.lang.String getPathSeparatorString()
getPathSeparator()
.
public abstract char getSeparator()
file.separator
. On UNIX systems the value of this
field is '/'
; on Microsoft Windows systems it is '\'
.
public java.lang.String getSeparatorString()
getSeparator()
.
public abstract JFMFile[] listRoots()
File.listRoots()
public abstract JFMFile[] listFiles(JFMFile rootFile)
If this abstract pathname does not denote a directory, then this
method returns null
. Otherwise an array of
File
objects is returned, one for each file or directory in
the directory. Pathnames denoting the directory itself and the
directory's parent directory are not included in the result.
There is no guarantee that the name strings in the resulting array will appear in any specific order; they are not, in particular, guaranteed to appear in alphabetical order.
null
if this abstract pathname
does not denote a directory, or if an I/O error occurs.
java.lang.SecurityException
- If a security manager exists and its SecurityManager.checkRead(java.lang.String)
method denies read access to the directorypublic abstract JFMFile[] listFiles(JFMFile rootFile, java.io.FilenameFilter filter)
#listFiles()
method, except
that the pathnames in the returned array must satisfy the filter.
If the given filter
is null
then all
pathnames are accepted. Otherwise, a pathname satisfies the filter
if and only if the value true
results when the
FilenameFilter.accept(java.io.File, java.lang.String)
method of the filter is
invoked on this abstract pathname and the name of a file or
directory in the directory that it denotes.
filter
- A filename filter
null
if this abstract pathname
does not denote a directory, or if an I/O error occurs.
java.lang.SecurityException
- If a security manager exists and its SecurityManager.checkRead(java.lang.String)
method denies read access to the directorypublic abstract boolean mkdir(JFMFile parent, java.lang.String name)
parent
- The parent file that denotes the abstract pathnamename
- The name of the new dir
true
if and only if the directory was
created; false
otherwise
java.lang.SecurityException
- If a security manager exists and its SecurityManager.checkWrite(java.lang.String)
method does not permit the named directory to be createdpublic boolean delete(JFMFile file)
file
- The file that denotes the abstract pathname
true
if and only if the file or directory is
successfully deleted; false
otherwise
java.lang.SecurityException
- If a security manager exists and its SecurityManager.checkDelete(java.lang.String)
method denies
delete access to the filepublic abstract boolean createNewFile(JFMFile parent, java.lang.String name) throws FSException
file
- The file that denotes the abstract pathname
true
if the named file does not exist and was
successfully created; false
if the named file
already exists
FSException
- If an filesystem error occurred
java.lang.SecurityException
- If a security manager exists and its SecurityManager.checkWrite(java.lang.String)
method denies write access to the filepublic abstract boolean setLastModified(JFMFile file, long time)
All platforms support file-modification times to the nearest second,
but some provide more precision. The argument will be truncated to fit
the supported precision. If the operation succeeds and no intervening
operations on the file take place, then the next invocation of the
method will return the (possibly
truncated) org.jfm.md.filesystems.JFMFile#lastModified
time
argument that was passed to this method.
file
- The file that denotes the abstract pathnametime
- The new last-modified time, measured in milliseconds since
the epoch (00:00:00 GMT, January 1, 1970)
true
if and only if the operation succeeded;
false
otherwise
java.lang.IllegalArgumentException
- If the argument is negative
java.lang.SecurityException
- If a security manager exists and its SecurityManager.checkWrite(java.lang.String)
method denies write access to the named filepublic abstract boolean setReadOnly(JFMFile file)
file
- The file that denotes the abstract pathname
true
if and only if the operation succeeded;
false
otherwise
java.lang.SecurityException
- If a security manager exists and its SecurityManager.checkWrite(java.lang.String)
method denies write access to the named filepublic boolean canRead(JFMFile file)
file
- The file that denotes the abstract pathname
true
if and only if the file specified by this
abstract pathname exists and can be read by the
application; false
otherwise
java.lang.SecurityException
- If a security manager exists and its SecurityManager.checkRead(java.lang.String)
method denies read access to the filepublic boolean canWrite(JFMFile file)
file
- The file that denotes the abstract pathname
true
if and only if the file system actually
contains a file denoted by this abstract pathname and
the application is allowed to write to the file;
false
otherwise.
java.lang.SecurityException
- If a security manager exists and its SecurityManager.checkWrite(java.lang.String)
method denies write access to the filepublic boolean exists(JFMFile file)
file
- The file that denotes the abstract pathname
true
if and only if the file or directory denoted
by this abstract pathname exists; false
otherwise
java.lang.SecurityException
- If a security manager exists and its SecurityManager.checkRead(java.lang.String)
method denies read access to the file or directorypublic JFMFile getRootDriveFile(JFMFile file)
If the active filesystem is the local filesystem and is an Windows filesystem, this method should return the drive letter of the drive that this file belongs to. On Unix filesystems it will always return '/'. On other filesystems .... it will return whatever the one that imlements it wants to.
file
- JFMFile the file whoses root we want to find out.
public abstract JFMFile getStartDirectory()
public abstract JFMFile getFile(java.lang.String pathName)
pathName
- String
public boolean isLocal()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |