Class AsynchronousUploadHandler

    • Constructor Detail

      • AsynchronousUploadHandler

        public AsynchronousUploadHandler()
    • Method Detail

      • canUploadFiles

        public java.lang.String canUploadFiles​(javax.servlet.http.HttpServletRequest request,
                                               java.lang.String strFieldName,
                                               java.util.List<org.apache.commons.fileupload.FileItem> listFileItemsToUpload,
                                               java.util.Locale locale)
        Description copied from interface: IAsyncUploadHandler
        Check if the file can be uploaded or not.
        Parameters:
        request - The request
        strFieldName - the field name
        listFileItemsToUpload - the list of files to upload
        locale - the locale
        Returns:
        The error message if any, or null if the files can be uploaded.
      • getListUploadedFiles

        public java.util.List<org.apache.commons.fileupload.FileItem> getListUploadedFiles​(java.lang.String strFieldName,
                                                                                           javax.servlet.http.HttpSession session)
        Description copied from interface: IAsyncUploadHandler
        Gets the list of upload files for a given field and a given session. The order of files in the list must be the upload order. Their index in this list (from 0 to the list size) will be used to identify them.
        Parameters:
        strFieldName - the field name
        session - The session of the current user
        Returns:
        the fileItem found, null otherwise.
      • addFileItemToUploadedFilesList

        public void addFileItemToUploadedFilesList​(org.apache.commons.fileupload.FileItem fileItem,
                                                   java.lang.String strFieldName,
                                                   javax.servlet.http.HttpServletRequest request)
        Description copied from interface: IAsyncUploadHandler
        Add a file item to the list of uploaded files
        Parameters:
        fileItem - the file item
        strFieldName - the field name
        request - the request
      • getHandlerName

        public java.lang.String getHandlerName()
        Description copied from interface: IAsyncUploadHandler
        Get the name of the handler. The name of the handler must be unique. The handler name must only contain alphabetic characters (no point, no space, no coma, no #, ...).
        Returns:
        The name of the handler
      • removeSessionFiles

        public void removeSessionFiles​(javax.servlet.http.HttpSession session)
        Cleans up all files associated with the specified session. Implementations must delete each physical temporary file, typically by calling FileItem.delete(), and remove the corresponding session entry from their internal file-item map as part of the same cleanup operation.
        Parameters:
        session - the terminated session