public interface FileSystem
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ANY_PATH_SEPARATOR
Regexp pattern for matching any path separators
|
static int |
ERR_BAD_ADDRESS
The Progress code for "bad address".
|
static int |
ERR_BAD_FILE_NUM
The Progress code for "bad file number".
|
static int |
ERR_DIR_NOT_EMPTY
The Progress code for "directory not empty".
|
static int |
ERR_FILE_EXISTS
The Progress code for "file exists".
|
static int |
ERR_FILE_TABLE_OVERFLOW
The Progress code for "file table overflow".
|
static int |
ERR_FILE_TOO_LARGE
The Progress code for "file too large".
|
static int |
ERR_INTERRUPTED
The Progress code for "interrupted system call".
|
static int |
ERR_IO
The Progress code for "I/O error".
|
static int |
ERR_IS_DIR
The Progress code for "is a directory".
|
static int |
ERR_NO_ERROR
The Progress code for "no error".
|
static int |
ERR_NO_MORE_PROCESSES
The Progress code for "no more processes".
|
static int |
ERR_NO_SPACE_ON_DEVICE
The Progress code for "no space left on device".
|
static int |
ERR_NO_SUCH_DEVICE
The Progress code for "not such device".
|
static int |
ERR_NO_SUCH_FILE_OR_DIR
The Progress code for "no such file or directory".
|
static int |
ERR_NOT_DIR
The Progress code for "not a directory".
|
static int |
ERR_NOT_ENOUGH_CORE
The Progress code for "not enough core memory".
|
static int |
ERR_NOT_OWNER
The Progress code for "not owner".
|
static int |
ERR_PERM_DENIED
The Progress code for "permission denied".
|
static int |
ERR_TOO_MANY_FILES
The Progress code for "too many open files".
|
static int |
ERR_UNKNOWN
The Progress code for "unknown error".
|
Modifier and Type | Method and Description |
---|---|
FileInfo |
accessFileInfo(java.lang.String name)
Access file system details regarding a specific file.
|
int |
copy(java.lang.String source,
java.lang.String target,
boolean overwrite)
Copies (or appends) the specified source file to or over the target
file.
|
int |
delete(java.lang.String[] list,
boolean recursive)
Deletes each of the directories or files specified.
|
int |
delete(java.lang.String target,
boolean recursive)
Deletes the specified file system entity, if necessary using recursion
to delete all contents (if it is a directory) first.
|
byte[] |
getFileContents(java.lang.String filename)
Get the file contents from the client-side file system.
|
java.lang.String |
getFileSeparator()
Get the file separator for the system.
|
java.lang.String |
getPathSeparator()
Get the path separator for the system.
|
java.lang.String |
getProperty(java.lang.String key)
Get the system property (user-defined properties can be specified
at the Java command line) associated with the passed key.
|
java.lang.String |
getRootList()
Get the comma-separated list of filesystem roots (drive letters on
platforms that support the concept, otherwise returns the equivalent
of the empty string).
|
java.lang.String |
getWorkingDirectory()
Gets the working directory.
|
int |
mkdir(java.lang.String[] dirs)
Creates each of the directories requested, if it doesn't exist and all
path segments up to the last segment do exist.
|
int |
rename(java.lang.String source,
java.lang.String target)
Renames (and moves if the path is different) the specified source file
to the target filename (and path).
|
java.lang.String |
searchPath(java.lang.String filename)
Search for the given file in each directory listed in the path
previously specified via
setSearchPath(java.lang.String[], boolean) . |
void |
setLegacyFileSystemParameters(java.lang.String fileSeparator,
boolean caseSensitive,
java.util.Map<java.lang.String,java.lang.String> pathMap,
java.lang.String[] paths,
boolean areLegacyPathsNotResolved)
Sets the legacy file system parameters to be used by the client.
|
void |
setSearchPath(java.lang.String[] paths,
boolean caseSens)
Initializes the path for subsequent searches by
searchPath(java.lang.String) . |
void |
setWorkingDirectory(java.lang.String newWorkingDir)
Sets the working directory.
|
static final int ERR_NO_ERROR
static final int ERR_NOT_OWNER
static final int ERR_NO_SUCH_FILE_OR_DIR
static final int ERR_INTERRUPTED
static final int ERR_IO
static final int ERR_BAD_FILE_NUM
static final int ERR_NO_MORE_PROCESSES
static final int ERR_NOT_ENOUGH_CORE
static final int ERR_PERM_DENIED
static final int ERR_BAD_ADDRESS
static final int ERR_FILE_EXISTS
static final int ERR_NO_SUCH_DEVICE
static final int ERR_NOT_DIR
static final int ERR_IS_DIR
static final int ERR_FILE_TABLE_OVERFLOW
static final int ERR_TOO_MANY_FILES
static final int ERR_FILE_TOO_LARGE
static final int ERR_NO_SPACE_ON_DEVICE
static final int ERR_DIR_NOT_EMPTY
static final int ERR_UNKNOWN
static final java.lang.String ANY_PATH_SEPARATOR
FileInfo accessFileInfo(java.lang.String name)
name
- The relative or absolute filename for which to obtain
information.null
if the file was not found.java.lang.String getRootList() throws java.io.IOException
java.io.IOException
java.lang.String getWorkingDirectory()
java.lang.String getProperty(java.lang.String key)
null
if the
property does not exist.java.lang.String getFileSeparator()
java.lang.String getPathSeparator()
int mkdir(java.lang.String[] dirs)
dirs
- The list of directories to create.ERR_NO_ERROR
if no problems
occur).int rename(java.lang.String source, java.lang.String target)
source
- The name of the source file or directory.target
- The name of the target file or directory. If this is a
directory name for a directory that already exists and the
source
is a file, then the source file name will
be used as the target file in the directory given.ERR_NO_ERROR
if no problems
occur).void setSearchPath(java.lang.String[] paths, boolean caseSens)
searchPath(java.lang.String)
.paths
- The list of paths to search for files specified by relative
filename.caseSens
- true
if the legacy system had a case-sensitive
file-system.java.lang.String searchPath(java.lang.String filename)
setSearchPath(java.lang.String[], boolean)
. If the file system
object exists and is a file, then the filename is returned. If the path
contains an empty string or a '.', then the current directory is
searched, otherwise only the listed directories are searched.
If the filename is specified as an absolute name, this specific filename is checked and no path searching is done.
filename
- The absolute or relative filename for which to search.null
is returned.void setWorkingDirectory(java.lang.String newWorkingDir)
newWorkingDir
- A new working directory to set.int copy(java.lang.String source, java.lang.String target, boolean overwrite)
overwrite
parameter. If any error occurs, no exception
will be thrown.source
- The name of the source file. Must NOT be a directory name.
Must be an existing file.target
- The name of the target file. If this is a directory name,
the source file name will be used as the target file in
the directory given.overwrite
- If true
this is a copy, otherwise it is an
append.ERR_NO_ERROR
if no problems
occur).int delete(java.lang.String target, boolean recursive)
target
- The target file or directory to delete.recursive
- Recursively decend through all subdirectories, deleting
the entire subtree.ERR_NO_ERROR
if no problems
occur).int delete(java.lang.String[] list, boolean recursive)
recursive
flag is true
. If any error occurs,
no exception will be thrown, the deletion process just continues. The
last error will be the one returned even if there were prior successful
deletes or other failures.list
- The list of files and directories to delete.recursive
- Recursively decend through all subdirectories, deleting
the entire subtree.ERR_NO_ERROR
if no problems
occur).byte[] getFileContents(java.lang.String filename) throws java.io.IOException
filename
- Name of the file in the client-side file system (relatively to the current
directory on the client side).java.io.IOException
- If file cannot not be found or read, or is too large.void setLegacyFileSystemParameters(java.lang.String fileSeparator, boolean caseSensitive, java.util.Map<java.lang.String,java.lang.String> pathMap, java.lang.String[] paths, boolean areLegacyPathsNotResolved)
fileSeparator
- The legacy file separatorcaseSensitive
- The legacy case sensitive modepathMap
- The legacy path mappaths
- The list of paths to search for files specified by relative
filename.areLegacyPathsNotResolved
- The true value of this parameter indicates that legacy path names must be resolved
on the host system, and false value means that legacy path names are not required
to be resolved.