Package hudson.util
Class MultipartFormDataParser
java.lang.Object
hudson.util.MultipartFormDataParser
- All Implemented Interfaces:
- AutoCloseable
Wraps commons file-upload and handles a "multipart/form-data" form submission
 (that often includes file upload.)
- Author:
- Kohsuke Kawaguchi
- 
Constructor SummaryConstructorsConstructorDescriptionMultipartFormDataParser(jakarta.servlet.http.HttpServletRequest request) MultipartFormDataParser(jakarta.servlet.http.HttpServletRequest request, int maxParts) MultipartFormDataParser(jakarta.servlet.http.HttpServletRequest request, int maxParts, long maxPartSize, long maxSize) MultipartFormDataParser(javax.servlet.http.HttpServletRequest request) Deprecated.
- 
Method SummaryModifier and TypeMethodDescriptionvoidcleanUp()If any file is created on the disk, delete them all.voidclose()Alias forcleanUp().org.apache.commons.fileupload.FileItemgetFileItem(String key) Deprecated.org.apache.commons.fileupload2.core.FileItemgetFileItem2(String key) static booleanisMultiPartForm(String contentType) Checks a Content-Type string to assert if it is "multipart/form-data".
- 
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
 
- 
MultipartFormDataParserpublic 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 Deprecated.- Throws:
- javax.servlet.ServletException
 
 
- 
- 
Method Details- 
get
- 
getFileItem2
- 
getFileItemDeprecated.
- 
cleanUppublic 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.
- 
closepublic void close()Alias forcleanUp().- Specified by:
- closein interface- AutoCloseable
 
- 
isMultiPartFormChecks a Content-Type string to assert if it is "multipart/form-data".- Parameters:
- contentType- Content-Type string.
- Returns:
- trueif the content type is "multipart/form-data", otherwise- false.
- Since:
- 1.620
 
 
- 
MultipartFormDataParser(HttpServletRequest)