Interface MultiPartRequest
- All Known Implementing Classes:
AbstractMultiPartRequest
,JakartaMultiPartRequest
,JakartaStreamMultiPartRequest
public interface MultiPartRequest
Abstract wrapper class HTTP requests to handle multi-part data.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanUp()
Cleans up all uploaded file, should be called at the end of requestString[]
getContentType
(String fieldName) Returns the content type(s) of the file(s) associated with the specified field name (as supplied by the client browser), or null if no files are associated with the given field name.Returns a list of error messages that may have occurred while processing the request.Returns aUploadedFile
object for the filename specified or null if no files are associated with the given field name.String[]
getFileNames
(String fieldName) Returns a String[] of file names for files associated with the specified input field nameReturns an enumeration of the parameter names for uploaded filesString[]
getFilesystemName
(String fieldName) Returns the file system name(s) of files associated with the given field name or null if no files are associated with the given field name.getParameter
(String name) Returns the specified request parameter.Returns an enumeration of String parameter names.String[]
getParameterValues
(String name) Returns a list of all parameter values associated with a parameter name.void
-
Method Details
-
parse
- Throws:
IOException
-
getFileParameterNames
Enumeration<String> getFileParameterNames()Returns an enumeration of the parameter names for uploaded files- Returns:
- an enumeration of the parameter names for uploaded files
-
getContentType
Returns the content type(s) of the file(s) associated with the specified field name (as supplied by the client browser), or null if no files are associated with the given field name.- Parameters:
fieldName
- input field name- Returns:
- an array of content encoding for the specified input field name or null if no content type was specified.
-
getFile
Returns aUploadedFile
object for the filename specified or null if no files are associated with the given field name.- Parameters:
fieldName
- input field name- Returns:
- a UploadedFile[] object for files associated with the specified input field name
-
getFileNames
Returns a String[] of file names for files associated with the specified input field name- Parameters:
fieldName
- input field name- Returns:
- a String[] of file names for files associated with the specified input field name
-
getFilesystemName
Returns the file system name(s) of files associated with the given field name or null if no files are associated with the given field name.- Parameters:
fieldName
- input field name- Returns:
- the file system name(s) of files associated with the given field name
-
getParameter
Returns the specified request parameter.- Parameters:
name
- the name of the parameter to get- Returns:
- the parameter or null if it was not found.
-
getParameterNames
Enumeration<String> getParameterNames()Returns an enumeration of String parameter names.- Returns:
- an enumeration of String parameter names.
-
getParameterValues
Returns a list of all parameter values associated with a parameter name. If there is only one parameter value per name the resulting array will be of length 1. If the parameter doesn't exist, null should be returned instead of empty array.- Parameters:
name
- the name of the parameter.- Returns:
- an array of all values associated with the parameter name.
-
getErrors
List<LocalizedMessage> getErrors()Returns a list of error messages that may have occurred while processing the request. If there are no errors, an empty list is returned. If the underlying implementation (ie: cos, jakarta, etc) cannot support providing these errors, an empty list is also returned. This list of errors is reported back to theMultiPartRequestWrapper
's errors field.- Returns:
- a list of Strings that represent various errors during parsing
-
cleanUp
void cleanUp()Cleans up all uploaded file, should be called at the end of request
-