Class RemoteBuilderEndPoint

    • Method Detail

      • processQueuedTransaction

        protected boolean processQueuedTransaction​(int code,
                                                   ReadTransaction trans)
        This method must be implemented in all extending classes.
        Specified by:
        processQueuedTransaction in class AbstractEndPoint
        Parameters:
        code - The transaction code.
        trans - The transaction.
        Returns:
        true if the transaction has been processed, false otherwise.
      • onClientPropsCreated

        protected void onClientPropsCreated​(PropCnr root)
        Called when the root is created from a transaction from the client. Override to perform some additional processing such as adding server environment, etc.
        Overrides:
        onClientPropsCreated in class AbstractEndPoint
      • isAccepted

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

        public 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.
        Specified by:
        getAlternateAcceptor in interface IWSUploaderAcceptor
        Returns:
        The IWSUploaderAcceptor instance registered for the target URL, or null for default.
      • getUploadDirectory

        public java.io.File getUploadDirectory​(java.io.File defaultDir,
                                               java.util.List<WSUploadPart> parts)
        Gets the directory where to store the files.
        Specified by:
        getUploadDirectory in interface IWSUploaderAcceptor
        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

        public boolean onUploaded​(java.util.List<WSUploadPart> parts)
                           throws java.io.IOException
        Called when the upload has completed.
        Specified by:
        onUploaded in interface IWSUploaderAcceptor
        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.