Interface FileResult

    • Method Detail

      • getFlavors

        default java.util.List<ResultFlavor> getFlavors()
        Defined the types of data this Result contains.
        Specified by:
        getFlavors in interface Result
        Returns:
        the ResultFlavor of this Result.
      • getFileSize

        long getFileSize()
                  throws java.lang.Exception
        Returns the size of this result in bytes.
        Returns:
        the size in bytes
        Throws:
        java.lang.Exception - if the result data makes problems
        Since:
        taskplanner 3.0
      • getFileContent

        @Nonnull
        java.io.InputStream getFileContent()
                                    throws java.lang.Exception
        Get a stream to access the data of this result.

        Note that this method is called multiple times when more than one action processed 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:
        java.lang.Exception - if there is a problem accessing the data
        Since:
        taskplanner 3.0
      • getFileContentType

        @Nullable
        java.lang.String getFileContentType()
                                     throws java.lang.Exception
        Get the MIME type this result has.
        Returns:
        the content type of this result. When null, 'application/octet-stream' is to be used.
        Throws:
        java.lang.Exception - if the type is could not be determined due to an IO problem
        Since:
        taskplanner 3.0
      • getFileName

        @Nonnull
        java.lang.String getFileName()
        Returns a human readable name of this result, typically a file name.

        It depends on the Result-implementation and on the ResultAction whether and where this appears. E.g. in an email this will be the name of the attached file of this is a LocalFileResult, if this is a StringTextResult it will not appear in the email.

        Returns:
        a name for this result.
        Since:
        taskplanner 3.0