public interface IFileSystemSession
| Modifier and Type | Method and Description |
|---|---|
void |
changeFolder(String path)
Changes the current working folder to the given folder.
|
void |
createFile(String name,
Object content)
Creates a file with the given name and the given content.
|
void |
createFolder(String name)
Creates the folder with the given name.
|
String |
getCurrentFolder()
Returns the current working folder.
|
Object |
getFile(String name)
Returns the content of the file with the given name.
|
String[] |
getFolderContent(String folder)
Returns the content of a folder as an array of strings.
|
Iterator |
getFolderIterator(String folder)
Returns an iterator for walking through the folders content.
|
boolean |
isFolder(String folder)
Tests if the given folder exists in the file system.
|
void |
moveFile(String source,
String destination)
Moves the given file to the given destination.
|
void |
removeFile(String name)
Removes the file with the name relative to the current working folder, if
the file does not start with /.
|
void |
removeFolder(String name)
Removes the folder with the given name.
|
void createFolder(String name) throws FileExistsException, InvalidNameException
name - the name for the new folderFileExistsException - -
if the folder already existsInvalidNameException - -
if the name is not a valid folder namevoid removeFolder(String name) throws NoSuchFileException, InvalidNameException
name - the name of the folder to be removedNoSuchFileException - -
if the folder does not existsInvalidNameException - -
if folder is /boolean isFolder(String folder)
folder - the folder to search and testvoid changeFolder(String path) throws NoSuchFileException, InvalidNameException
path - the path for the new working folderNoSuchFileException - -
if the given folder does not existInvalidNameException - -
if the given file name is not validString getCurrentFolder()
String[] getFolderContent(String folder) throws NoSuchFileException, InvalidNameException
folder - the name of the folderNoSuchFileExceptionInvalidNameExceptionIterator getFolderIterator(String folder) throws NoSuchFileException, InvalidNameException
folder - the name of the folderNoSuchFileExceptionInvalidNameExceptionvoid createFile(String name, Object content) throws FileExistsException, InvalidContentException, NoSuchFileException, InvalidNameException
name - the name for the new filecontent - the file content, can be nullFileExistsException - -
if the file name is already in useInvalidContentException - -
if the file content is nullNoSuchFolderException - -
if the folder does not existInvalidNameException - -
if the file name is not valid, e.g. ends with /NoSuchFileExceptionvoid removeFile(String name) throws NoSuchFileException, InvalidNameException
name - the file name that has to be removedNoSuchFileException - -
if the given file was not foundInvalidNameException - -
if the given file name is not validObject getFile(String name) throws NoSuchFileException, InvalidNameException
name - the name of the fileNoSuchFileException - -
if the file was not foundInvalidNameException - -
if the given file name is not validvoid moveFile(String source, String destination) throws NoSuchFileException, FileExistsException, InvalidNameException
source - the source filedestination - the destination fileNoSuchFileException - -
if the source file does not existsFileExistsException - -
if the destination file already existsInvalidNameException - -
if the given file name is not valid