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 Summary
ConstructorDescriptionMultipartFormDataParser
(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 Summary
Modifier and TypeMethodDescriptionvoid
cleanUp()
If any file is created on the disk, delete them all.void
close()
Alias forcleanUp()
.org.apache.commons.fileupload.FileItem
getFileItem
(String key) Deprecated.org.apache.commons.fileupload2.core.FileItem
getFileItem2
(String key) static boolean
isMultiPartForm
(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
-
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 Deprecated.- Throws:
javax.servlet.ServletException
-
-
Method Details
-
get
-
getFileItem2
-
getFileItem
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 forcleanUp()
.- Specified by:
close
in interfaceAutoCloseable
-
isMultiPartForm
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", otherwisefalse
.- Since:
- 1.620
-
MultipartFormDataParser(HttpServletRequest)