public class TextResultSaver extends Object implements ResultSaver<TextResult>
ResultSaver
for a TextResult
.
The contents of the TextResult
are saved to disk using the FileParameter.FileRepresentation.getContent()
method.
If the file defined by the contained FileParameter.FileRepresentation
already exists, it is simply copied to the new location.Modifier and Type | Method and Description |
---|---|
String[] |
getFileExtensions(TextResult result)
Returns the file extensions (in descending preference) for storing the given
Result |
boolean |
isAtomic()
|
static void |
register()
Registers this
ResultSaver in the ResultSaverLibrary |
boolean |
writeOutput(TextResult result,
File path)
Writes the output (i.e., the result contents) to the supplied file.
|
boolean |
writeOutput(TextResult result,
StringBuffer buf)
Appends the output (i.e., the result contents) to the supplied
StringBuffer |
public static void register()
ResultSaver
in the ResultSaverLibrary
public String[] getFileExtensions(TextResult result)
ResultSaver
Result
getFileExtensions
in interface ResultSaver<TextResult>
result
- the resultpublic boolean writeOutput(TextResult result, File path)
ResultSaver
writeOutput
in interface ResultSaver<TextResult>
result
- the resultpath
- the output filepublic boolean isAtomic()
ResultSaver
isAtomic
in interface ResultSaver<TextResult>
ResultSaver
is for storing atomic Result
s.public boolean writeOutput(TextResult result, StringBuffer buf)
ResultSaver
StringBuffer
writeOutput
in interface ResultSaver<TextResult>
result
- the resultbuf
- the buffer