Class JakartaMultiPartRequest


  • public class JakartaMultiPartRequest
    extends com.opensymphony.webwork.dispatcher.multipart.MultiPartRequest

    Multipart form data request adapter for Jakarta's file upload package.

    This class has been imported from Webwork 2.1.5 and been modified to:

    • support the latest Jakarta Commons Fileupload API
    • mimmick the way the Pell multipart library reports excess upload size, an IO exception is thrown to be collected by the MultiPartRequestWrapper. The format of the message is unfortunately relied upon by our error reporting mechanisms and needs to be preserved between the implementations.
    Author:
    Bruce Ritchie
    See Also:
    GeneralUtil.getUploadFileTooLargeMessage(String)
    • Constructor Detail

      • JakartaMultiPartRequest

        public JakartaMultiPartRequest​(javax.servlet.http.HttpServletRequest servletRequest,
                                       String saveDir,
                                       int maxSize)
                                throws IOException
        Creates a new request wrapper to handle multi-part data using methods adapted from Jason Pell's multipart classes (see class description).
        Parameters:
        maxSize - maximum size post allowed
        saveDir - the directory to save off the file
        servletRequest - the request containing the multipart
        Throws:
        IOException - is thrown if encoding fails.
    • Method Detail

      • getFileParameterNames

        public Enumeration getFileParameterNames()
        Specified by:
        getFileParameterNames in class com.opensymphony.webwork.dispatcher.multipart.MultiPartRequest
      • getContentType

        public String[] getContentType​(String fieldName)
        Specified by:
        getContentType in class com.opensymphony.webwork.dispatcher.multipart.MultiPartRequest
      • getFile

        public File[] getFile​(String fieldName)
        Specified by:
        getFile in class com.opensymphony.webwork.dispatcher.multipart.MultiPartRequest
      • getFileNames

        public String[] getFileNames​(String fieldName)
        Specified by:
        getFileNames in class com.opensymphony.webwork.dispatcher.multipart.MultiPartRequest
      • getFilesystemName

        public String[] getFilesystemName​(String fieldName)
        Specified by:
        getFilesystemName in class com.opensymphony.webwork.dispatcher.multipart.MultiPartRequest
      • getParameter

        public String getParameter​(String name)
        Specified by:
        getParameter in class com.opensymphony.webwork.dispatcher.multipart.MultiPartRequest
      • getParameterNames

        public Enumeration getParameterNames()
        Specified by:
        getParameterNames in class com.opensymphony.webwork.dispatcher.multipart.MultiPartRequest
      • getParameterValues

        public String[] getParameterValues​(String name)
        Specified by:
        getParameterValues in class com.opensymphony.webwork.dispatcher.multipart.MultiPartRequest
      • getErrors

        public List getErrors()