Package hudson.util

Class MultipartFormDataParser

java.lang.Object
hudson.util.MultipartFormDataParser
All Implemented Interfaces:
AutoCloseable

public class MultipartFormDataParser extends Object implements AutoCloseable
Wraps commons file-upload and handles a "multipart/form-data" form submission (that often includes file upload.)
Author:
Kohsuke Kawaguchi
  • Constructor Details

    • MultipartFormDataParser

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public MultipartFormDataParser(jakarta.servlet.http.HttpServletRequest request, int maxParts, long maxPartSize, long maxSize) throws jakarta.servlet.ServletException
      Throws:
      jakarta.servlet.ServletException
    • MultipartFormDataParser

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public MultipartFormDataParser(jakarta.servlet.http.HttpServletRequest request, int maxParts) throws jakarta.servlet.ServletException
      Throws:
      jakarta.servlet.ServletException
    • MultipartFormDataParser

      public MultipartFormDataParser(jakarta.servlet.http.HttpServletRequest request) throws jakarta.servlet.ServletException
      Throws:
      jakarta.servlet.ServletException
    • MultipartFormDataParser

      @Deprecated public MultipartFormDataParser(javax.servlet.http.HttpServletRequest request) throws javax.servlet.ServletException
      Throws:
      javax.servlet.ServletException
  • Method Details

    • get

      public String get(String key)
    • getFileItem2

      public org.apache.commons.fileupload2.core.FileItem getFileItem2(String key)
    • getFileItem

      @Deprecated public org.apache.commons.fileupload.FileItem getFileItem(String key)
      Deprecated.
    • cleanUp

      public void cleanUp()
      If any file is created on the disk, delete them all. Even if this method is not called, the resource will be still cleaned up later by GC.
    • close

      public void close()
      Alias for cleanUp().
      Specified by:
      close in interface AutoCloseable
    • isMultiPartForm

      public static boolean isMultiPartForm(@CheckForNull String contentType)
      Checks a Content-Type string to assert if it is "multipart/form-data".
      Parameters:
      contentType - Content-Type string.
      Returns:
      true if the content type is "multipart/form-data", otherwise false.
      Since:
      1.620