Interface FileResult
- All Superinterfaces:
Result
- All Known Implementing Classes:
ByteArrayFileResult,LazyInputStreamFileResult,LocalFileResult
A file result is result type which 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 each 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>Defined the types of data this Result contains.Methods inherited from interface com.inet.taskplanner.server.api.result.Result
cleanup, supportsFlavor, supportsOneFlavorOf
-
Method Details
-
getFlavors
Defined the types of data this Result contains.- Specified by:
getFlavorsin interfaceResult- Returns:
- the
ResultFlavorof this Result.
-
getFileSize
Returns the size of this result in bytes.- Returns:
- the size in bytes
- Throws:
Exception- if the result data makes problems- Since:
- taskplanner 3.0
-
getFileContent
Get a stream to access the data of this result.Note that this method is called multiple times when more than one
actionprocessed this result. Those calls come one after another: the first has finished it's work (closed the stream) when the second calls this method.The caller will close the Stream.
- Returns:
- an InputStream which can transfer the data of this result
- Throws:
Exception- if there is a problem accessing the data- Since:
- taskplanner 3.0
-
getFileContentType
Get the MIME type this result has.- Returns:
- the content type of this result. When null, 'application/octet-stream' is to be used.
- Throws:
Exception- if the type is could not be determined due to an IO problem- Since:
- taskplanner 3.0
-
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. E.g. in an email this will be the name of the attached file of this is aLocalFileResult, if this is aStringTextResultit will not appear in the email.- Returns:
- a name for this result.
- Since:
- taskplanner 3.0
-