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()
Returns
true |
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 ResultSaverLibrarypublic String[] getFileExtensions(TextResult result)
ResultSaverResultgetFileExtensions in interface ResultSaver<TextResult>result - the resultpublic boolean writeOutput(TextResult result, File path)
ResultSaverwriteOutput in interface ResultSaver<TextResult>result - the resultpath - the output filepublic boolean isAtomic()
ResultSavertrue if this ResultSaver is for storing atomic Results.isAtomic in interface ResultSaver<TextResult>ResultSaver is for storing atomic Results.public boolean writeOutput(TextResult result, StringBuffer buf)
ResultSaverStringBufferwriteOutput in interface ResultSaver<TextResult>result - the resultbuf - the buffer