psdi.webclient.system.controller

Class MPEncodedFormData



  • public class MPEncodedFormData
    extends MPFormData
    • Constructor Detail

      • MPEncodedFormData

        public MPEncodedFormData(javax.servlet.http.HttpServletRequest req)
                          throws MXException
        Throws:
        MXException
    • Method Detail

      • readRequest

        protected void readRequest(javax.servlet.http.HttpServletRequest request)
                            throws java.io.IOException,
                                   MXException
        Reads the encoded form data from the request.
        Overrides:
        readRequest in class MPFormData
        Parameters:
        request - The servlet request containing the encoded form data.
        Throws:
        java.io.IOException - if the uploaded content is larger than maxSize or there's a problem parsing the request
        MXException
      • readNextPart

        protected boolean readNextPart(psdi.webclient.system.controller.MPInputStreamHandler in,
                                       java.lang.String boundary)
                                throws java.io.IOException
        Reads the next part of the posted form. The form is encoded in multiple parts, each separated by a boundary string.
        Overrides:
        readNextPart in class MPFormData
        Parameters:
        in - The input stream containing the parts to be read in.
        boundary - The boundary text used to separate each part.
        Returns:
        a flag indicating whether this is the last part
        Throws:
        java.io.IOException - if there's a problem reading or parsing the request
      • fixFileName

        protected java.lang.String fixFileName(java.lang.String name)
        Take the user supplied file name, replace any odd characters with underscore and add .jpg to the end if not already there.
        Parameters:
        name - The file name to be cleaned and prepared for use.
        Returns:
        The cleaned file name.
      • extractNonfileDispositionInfo

        protected java.lang.String[] extractNonfileDispositionInfo(java.lang.String line)
                                                            throws java.io.IOException
        Extracts and returns disposition info from a line, as a String array with elements: disposition, name. Throws an IOException if the line is malformed.
        Parameters:
        line - The line of text containing the content to be parsed.
        Returns:
        The array of strings containing the names and values of the form elements.
        Throws:
        java.io.IOException - Thrown if the information is malformed.