Interface IWSUploaderAcceptor

  • All Known Implementing Classes:
    RemoteBuilderEndPoint

    public interface IWSUploaderAcceptor
    Interface that handles accepting uploads of files. A client session must be configured to accept file uploads from that particular client and prepares the destination as to what is accepted and where to.
    Author:
    Christopher Mindus
    • Method Detail

      • isAccepted

        boolean isAccepted​(HttpServletRequest request)
        Checks if the uploader service would accept this upload request or not.
        Parameters:
        request - The request.
        Returns:
        true if accepted, false otherwise.
      • getAlternateAcceptor

        default IWSUploaderAcceptor getAlternateAcceptor​(HttpServletRequest request)
        Checks if the service wishes to return an alternate uploader. This can only be done once and the new instance's "getAlternateAcceptor(request)" will not be called.
        Returns:
        The IWSUploaderAcceptor instance registered for the target URL, or null for default.
      • getUploadDirectory

        java.io.File getUploadDirectory​(java.io.File defaultDir,
                                        java.util.List<WSUploadPart> parts)
        Gets the directory where to store the files.
        Parameters:
        defaultDir - The default directory where to place the files.
        parts - The parts that would be saved to disk.
        Returns:
        The directory where to store the files, or null to reject the request.
      • onUploaded

        boolean onUploaded​(java.util.List<WSUploadPart> parts)
                    throws java.io.IOException
        Called when the upload has completed.
        Parameters:
        parts - The parts that have been written to disk.
        Returns:
        true To delete the files, false to keep them. If an IOException is thrown, the default is to delete the files!
        Throws:
        java.io.IOException - If there are error e.g. reading the files.