Interface FileUploadPlugin


  • public interface FileUploadPlugin
    Plugin interface for handling uploaded files for job execution.
    Since:
    2/15/17
    • Method Detail

      • initialize

        void initialize()
        Initializes the plugin before use
      • uploadFile

        java.lang.String uploadFile​(java.io.InputStream content,
                                    long length,
                                    java.lang.String refid,
                                    java.util.Map<java.lang.String,​java.lang.String> config)
                             throws java.io.IOException
        Upload a file for the given job and file input name, and return an identifier to reference the uploaded file.
        Parameters:
        content - content
        length - data length
        refid - unique identifier for the file
        Returns:
        identifier
        Throws:
        java.io.IOException
      • retrieveFile

        void retrieveFile​(java.lang.String ref,
                          java.io.OutputStream out)
                   throws java.io.IOException
        Retrieve the file by reference
        Parameters:
        ref - ref
        out - outputstream to write it to
        Throws:
        java.io.IOException
      • retrieveLocalFile

        java.io.File retrieveLocalFile​(java.lang.String ref)
                                throws java.io.IOException
        Retrieve the file if it is available locally, otherwise return null
        Parameters:
        ref - ref
        Returns:
        local file, or null if not directly available
        Throws:
        java.io.IOException
      • retrieveFile

        java.io.InputStream retrieveFile​(java.lang.String ref)
        Retrieve the file by reference
        Parameters:
        ref - ref
        Returns:
        inputstream to read the file
      • removeFile

        boolean removeFile​(java.lang.String reference)
        Remove the file
        Parameters:
        reference -
        Returns:
      • transitionState

        FileUploadPlugin.InternalState transitionState​(java.lang.String reference,
                                                       FileUploadPlugin.ExternalState state)
        Transition between states, allows plugin to determine behavior
        Parameters:
        reference - reference
        state - the new external state of the file
        Returns:
        the new internal state of the file