Package rife.servlet

Class MultipartRequest

java.lang.Object
rife.servlet.MultipartRequest

public class MultipartRequest extends Object
Parses a multipart/form-data request body into parameters and uploaded files, with the upload limits and the upload path of the engine configuration.
Since:
1.11.0
  • Constructor Details

    • MultipartRequest

      public MultipartRequest(String contentType, InputStream input) throws MultipartRequestException
      Parses a multipart body.
      Parameters:
      contentType - the content type of the request, with its boundary
      input - the body of the request
      Throws:
      MultipartRequestException - when the body can't be parsed or exceeds the upload limits
      Since:
      1.11.0
  • Method Details

    • isValidContentType

      public static boolean isValidContentType(String type)
      Checks whether a content type is the one of a multipart form.
      Parameters:
      type - the content type
      Returns:
      true if it's multipart/form-data; or

      false otherwise

      Since:
      1.11.0
    • getParameterMap

      public Map<String,String[]> getParameterMap()
      Retrieves the parameters of the request.
      Returns:
      the parameters by name
      Since:
      1.11.0
    • getFileMap

      public Map<String,UploadedFile[]> getFileMap()
      Retrieves the uploaded files of the request.
      Returns:
      the uploaded files by name
      Since:
      1.11.0