|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface FsConnection
The File System Connection Interface.
| Method Summary | |
|---|---|
void |
close()
Initiates close of the connection handle at the application level. |
boolean |
createFile(String file)
Creates a new, empty file named by the given parameter file
if and only if a file with this name does not yet exist. |
String |
createTempFile()
Creates an empty file in the default temporary-file directory. |
String |
createTempFile(String dir)
Creates an empty file in the supplied dir directory. |
boolean |
deleteFile(String file)
Deletes the supplied file or directory file. |
FileInputStream |
getFileInputStream(String file)
Returns a FileInputStream instance. |
RandomAccessFile |
getRandomAccessFile(String file,
String mode)
Returns a random access file. |
boolean |
isExists(String file)
Tests whether the givent file or directory file exists. |
String[] |
listFiles(String dir)
Returns an array of strings naming the files and directories in the directory dir. |
void |
moveFile(String src,
String dest)
Moves the file src to dest. |
void |
renameFile(String from,
String to)
Renames the supplied file from to to. |
String |
renameToTempFile(String file)
Renames the as parameter passed file file to a temp file in
the default temporary-file directory. |
| Method Detail |
|---|
void close()
throws ResourceException
ResourceException - thrown if close on a connection handle fails.
Any invalid connection close invocation should also throw this exception.
boolean isExists(String file)
throws ResourceException
file exists.
file - The file or directory to be checked.
file
exists; false otherwise.
ResourceException - The Security method denies read access to
the file or directory file.
boolean deleteFile(String file)
throws ResourceException
file.
file - The file or directory to be deleted.
ResourceException - If a security manager does not allow the file to
be deleted.
void renameFile(String from,
String to)
throws ResourceException
from to to.
from - The file to be renamed.to - The new file name.
ResourceException - Thrown to indicate that the file
from could not be deleted. For example: The Security
method denies write access to the file or directory to.
void moveFile(String src,
String dest)
throws ResourceException
src to dest.
src - The file to be moved from.dest - The file to be moved to.
ResourceException - Thrown to indicate that the file
src could not be moved to the dest.
For example: The Security method denies write access to the file
or directory dest.
String[] listFiles(String dir)
throws ResourceException
dir.
dir - The directory whose file's list has be retrieved.
dir does not exist or does not
denote a directory, then this method returns null. Otherwise returns the
list of files in the directory dir.
ResourceException - Thrown in error cases.File.list()
RandomAccessFile getRandomAccessFile(String file,
String mode)
throws ResourceException,
FileNotFoundException
file - The system-dependent filenamemode - The access mode
ResourceException - thrown in error cases.
FileNotFoundException - if the file exists but is a directory rather
than a regular file, or cannot be opened or created for any other
reason.
FileInputStream getFileInputStream(String file)
throws ResourceException,
FileNotFoundException
file - The system-dependent filename
ResourceException - thrown in error cases.
FileNotFoundException - If the file does not exist, is a directory
rather than a regular file, or for some other reason cannot be opened
for reading.
String createTempFile()
throws ResourceException
ResourceException - If a security manager does not allow a file to
be created or a file could not be created for some other reasons.
String createTempFile(String dir)
throws ResourceException
dir directory.
dir - The parent directory for the file to be created.
ResourceException - If the supplied dir directory does
not exist, If a security manager does not allow a file to
be created or a file could not be created for some other reasons.
boolean createFile(String file)
throws ResourceException
file
if and only if a file with this name does not yet exist.
Any required parent folders will be created if they do not exist yet.
file - The name of the file to be created.
file does not exist and was
successfully created; false if the named file already exists.
ResourceException - If a security manager does not allow a file to
be created or a file could not be created for some other reasons.
String renameToTempFile(String file)
throws ResourceException
file to a temp file in
the default temporary-file directory.
file - The name of the file to be reanmed.
ResourceException - If a security manager does not allow the file to
be renamed or a temp file to be created; or if a file could not be
renamed for some other reasons.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||