Interface FileResult
- All Superinterfaces:
Result
- All Known Implementing Classes:
ByteArrayFileResult, LazyInputStreamFileResult, LocalFileResult
A file result is a result type that has been produced by a
By convention, it always implies the flavor
Not all
Job and is processed by
actions.By convention, it always implies the flavor
FILE.Not all
ResultAction can handle every FileResult; result flavors define the kind of
information/data a FileResult represents, and actions will handle only results they support. A result can
be processed by more than one ResultAction.- Since:
- taskplanner 3.0
-
Method Summary
Modifier and TypeMethodDescription@Nonnull InputStreamGet a stream to access the data of this result.@Nullable StringGet the MIME type this result has.@Nonnull StringReturns a human-readable name of this result, typically a file name.longReturns the size of this result in bytes.default List<ResultFlavor> Defines the types of data this result contains.Methods inherited from interface Result
cleanup, supportsFlavor, supportsOneFlavorOf
-
Method Details
-
getFlavors
Defines the types of data this result contains.- Specified by:
getFlavorsin interfaceResult- Returns:
- the
ResultFlavorvalues of this result
-
getFileSize
-
getFileContent
Get a stream to access the data of this result.Note that this method is called multiple times when more than one
actionprocesses this result. Those calls come one after another: the first action has finished its work (and closed the stream) before the second calls this method.The caller will close the Stream.
- Returns:
- an input stream that can transfer the data of this result
- Throws:
Exception- if there is a problem accessing the data- Since:
- taskplanner 3.0
-
getFileContentType
-
getFileName
@Nonnull String getFileName()Returns a human-readable name of this result, typically a file name.It depends on the
Result-implementation and on theResultActionwhether and where this appears. For example, in an email, this can be used as the name of an attached file.- Returns:
- a name for this result.
- Since:
- taskplanner 3.0
-