All Packages Class Hierarchy This Package Previous Next Index
Interface org.jos.fs.FileSystem
- public interface FileSystem
Generic interface to a file system
File name policies:
- Path names don't begin with a separator and don't end with one
- Separator is java.io.File.separator
- Special directories (. and ..) are not allowed (JavaIO handles these)
- A case-insensitive FS has to accept uppercase, lowercase or any combination;
a case-insensitive-not-case-preserving FS may return any case combination
Note that this interface does some things differently than java.io.File
methods. While the latter return a boolean to indicate completion or error,
FileSystem methods return nothing, and throw an IOException in case of
an error. While this may be less efficient (throwing exceptions is quite
slow in most VMs), it is more flexible since the detailed error message
can be processed.
Any implementation of this interface must be thread-safe!
- Version:
- JOS-FileSystem 4 Preview (25-Mar-98)
- Author:
- Stefan Reich
- See Also:
- FSManager
-
CASEPOLICY_INSENSITIVE_NOT_PRESERVING
- case policy: pathes are case insensitive, and case is not preserved
-
CASEPOLICY_INSENSITIVE_PRESERVING
- case policy: pathes are case insensitive, but case is preserved
-
CASEPOLICY_MIXED
- different case policies inside a branch
-
CASEPOLICY_SENSITIVE
- case policy: pathes are case sensitive
-
CASEPOLICY_UNKNOWN
- case policy: unknown
-
addFileSystemListener(FileSystemListener)
-
-
delete(String)
-
-
dirList(String)
-
-
getBranchInfo(String)
- if branch doesn't exist, the result is undefined
-
getCasePolicyForDir(String)
- if dir doesn't exist, the result is undefined
-
getFileInfo(String)
- returns null if file wasn't found; if a different error occurs, it throws
an IOException
-
getMedium()
-
-
mkdir(String)
-
-
openFile(String, boolean, boolean)
- require: readAccess || writeAccess == true
-
removeFileSystemListener(FileSystemListener)
-
-
rename(String, String)
-
CASEPOLICY_SENSITIVE
public static final int CASEPOLICY_SENSITIVE
- case policy: pathes are case sensitive
CASEPOLICY_INSENSITIVE_PRESERVING
public static final int CASEPOLICY_INSENSITIVE_PRESERVING
- case policy: pathes are case insensitive, but case is preserved
CASEPOLICY_INSENSITIVE_NOT_PRESERVING
public static final int CASEPOLICY_INSENSITIVE_NOT_PRESERVING
- case policy: pathes are case insensitive, and case is not preserved
CASEPOLICY_MIXED
public static final int CASEPOLICY_MIXED
- different case policies inside a branch
CASEPOLICY_UNKNOWN
public static final int CASEPOLICY_UNKNOWN
- case policy: unknown
getBranchInfo
public abstract FSBranchInfo getBranchInfo(String branch)
- if branch doesn't exist, the result is undefined
getCasePolicyForDir
public abstract int getCasePolicyForDir(String dir)
- if dir doesn't exist, the result is undefined
getMedium
public abstract Medium getMedium()
- Returns:
- the Medium that this file system runs on - can be null
getFileInfo
public abstract FSFileInfo getFileInfo(String path) throws IOException
- returns null if file wasn't found; if a different error occurs, it throws
an IOException
delete
public abstract void delete(String path) throws IOException
rename
public abstract void rename(String from,
String to) throws IOException
mkdir
public abstract void mkdir(String path) throws IOException
dirList
public abstract String[] dirList(String path) throws IOException
- Returns:
- not null
openFile
public abstract FSFile openFile(String file,
boolean readAccess,
boolean writeAccess) throws IOException
- require: readAccess || writeAccess == true
- Returns:
- opened file (not null)
addFileSystemListener
public abstract void addFileSystemListener(FileSystemListener l)
removeFileSystemListener
public abstract void removeFileSystemListener(FileSystemListener l)
All Packages Class Hierarchy This Package Previous Next Index