|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FileInteraction
Interaction
interface of the FileService
.
Method Summary | |
---|---|
boolean |
copy(String fromPath,
String toPath,
boolean overwrite)
Copies a file or folder. |
void |
createDirectory(String directoryPath)
Creates a directory. |
void |
delete(String filePath)
Deletes a file or folder. |
List<String> |
getChildren(String filePath)
Lists all child elements of the given folder. |
List<String> |
getChildren(String filePath,
FileFilter filter)
Lists all child elements of the given folder which match the filter. |
List<String> |
getChildren(String filePath,
String filterRegex)
Lists all child elements of the given folder which match the given regular expression. |
InputStream |
getInputStreamForFile(String filePath)
Creates an InputStream for accessing the content of a file. |
BufferedReader |
getReaderForTextFile(String filePath)
Creates a Reader for accessing the content of a text file. |
String |
getRootFolder()
Provides the root folder of the service instance. |
boolean |
move(String fromPath,
String toPath,
boolean overwrite)
Renames or moves a file or folder. |
byte[] |
readBinaryFile(String filePath)
Reads a binary file and provides its content as an array of bytes. |
String |
readTextFile(String filePath)
Reads a text file and provides its content as String. |
String |
waitForFirstMatch(String parentPath,
FileFilter filter)
Polls the given directory until the filter finds a match or a timeout is exceeded. |
void |
waitUntilExists(String elementType,
String filePath)
Polls the file system for a given file until it is found or a timeout is exceeded. |
void |
waitUntilNotExists(String filePath)
Polls the file system for a given file until it has disappeared or a timeout is exceeded. |
boolean |
writeBinaryFile(String filePath,
byte[] bytes,
boolean overwrite)
Creates a binary file with the provided content. |
boolean |
writeBinaryFile(String filePath,
InputStream source,
boolean overwrite)
Creates a binary file and writes to it all content provided by the source InputStream . |
boolean |
writeTextFile(String filePath,
Reader source,
boolean overwrite)
Creates a text file and writes to it all content provided by the source Reader. |
boolean |
writeTextFile(String filePath,
String text,
boolean overwrite)
Creates a text file with the provided content. |
Methods inherited from interface org.aludratest.service.Action |
---|
createAttachments, createDebugAttachments, setSystemConnector |
Method Detail |
---|
String getRootFolder()
FileService
.List<String> getChildren(String filePath)
filePath
- the path of the file of which to get children
List
of the child objects of the given fileList<String> getChildren(String filePath, String filterRegex)
filePath
- the path of the file of which to get the childrenfilterRegex
-
List
of the child objects of the given fileList<String> getChildren(String filePath, FileFilter filter)
filePath
- the path of the file of which to get the childrenfilter
-
List
of the child objects of the given filevoid createDirectory(String directoryPath)
directoryPath
- the path of the directory to createboolean move(String fromPath, String toPath, boolean overwrite)
fromPath
- the file/folder to rename/movetoPath
- the new name/location of the file/folderoverwrite
- flag which indicates if an existing file may be overwritten by the operation
org.aludratest.service.file.exception.FilePresentException
- if a file was already present and overwriting was disabled.boolean copy(String fromPath, String toPath, boolean overwrite)
fromPath
- the file/folder to copytoPath
- the name/location of the copyoverwrite
- flag which indicates if an existing file may be overwritten by the operation
org.aludratest.service.file.exception.FilePresentException
- if a file was already present and overwriting was disabled.void delete(String filePath)
filePath
- the path of the file to deleteboolean writeTextFile(String filePath, String text, boolean overwrite)
filePath
- the path of the file to savetext
- the text to save as file contentoverwrite
- flag which indicates if an existing file may be overwritten by the operation
org.aludratest.service.file.exception.FilePresentException
- if a file was already present and overwriting was disabled.boolean writeTextFile(String filePath, Reader source, boolean overwrite)
filePath
- the path of the file to savesource
- a Reader
which provides the file contentoverwrite
- flag which indicates if an existing file may be overwritten by the operation
org.aludratest.service.file.exception.FilePresentException
- if a file was already present and overwriting was disabled.boolean writeBinaryFile(String filePath, byte[] bytes, boolean overwrite)
filePath
- the path of the file to savebytes
- the file content to writeoverwrite
- flag which indicates if an existing file may be overwritten by the operation
org.aludratest.service.file.exception.FilePresentException
- if a file was already present and overwriting was disabled.boolean writeBinaryFile(String filePath, InputStream source, boolean overwrite)
InputStream
.
filePath
- the path of the file to savesource
- an InputStream
which provides the content to write to the fileoverwrite
- flag which indicates if an existing file may be overwritten by the operation
org.aludratest.service.file.exception.FilePresentException
- if a file was already present and overwriting was disabled.String readTextFile(String filePath)
filePath
- the path of the file to read
BufferedReader getReaderForTextFile(String filePath)
Reader
for accessing the content of a text file.
filePath
- the path of the file to read
byte[] readBinaryFile(String filePath)
filePath
- the path of the file to read
InputStream getInputStreamForFile(String filePath)
InputStream
for accessing the content of a file.
filePath
- the path of the file for which to get an input stream
InputStream
for accessing the filevoid waitUntilExists(String elementType, String filePath)
FileServiceConfiguration
.
elementType
- filePath
- the path of the file for which to wait
AutomationException
- if the file was not found within the timeoutvoid waitUntilNotExists(String filePath)
FileServiceConfiguration
.
filePath
- the path of the file for which to wait until absence
AutomationException
- if the file was not found within the timeoutString waitForFirstMatch(String parentPath, FileFilter filter)
FileServiceConfiguration
.
parentPath
- the path of the directory in which to search for the filefilter
- a filter object that decides which file is to be accepted
AutomationException
- if the file was not found within the timeout
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |