Class MultipartStreamParser
java.lang.Object
jodd.http.upload.MultipartStreamParser
Generic, serlvets-free multipart request input stream parser.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FileUploadFactoryprivate booleanprotected Map<String, FileUpload[]> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns uploaded file.Returns parameter names of all uploaded files.Returns all uploaded files the given request parameter has.getParameter(String paramName) Returns single value of a parameter.Returns the names of the parameters contained in this request.String[]getParameterValues(String paramName) Returns all values all of the values the given request parameter has.booleanisParsed()Returnstrueif multi-part request is already loaded.voidparseRequestStream(InputStream inputStream, String encoding) Extracts uploaded files and parameters from the request data.protected voidputFile(String name, FileUpload value) protected voidputParameter(String name, String value) protected voidputParameters(String name, String[] values) protected voidSets the loaded flag that indicates that input stream is loaded and parsed.
-
Field Details
-
fileUploadFactory
-
requestParameters
-
requestFiles
-
parsed
private boolean parsed
-
-
Constructor Details
-
MultipartStreamParser
public MultipartStreamParser() -
MultipartStreamParser
-
-
Method Details
-
setParsed
Sets the loaded flag that indicates that input stream is loaded and parsed. Throws an exception if stream already loaded.- Throws:
IOException
-
isParsed
public boolean isParsed()Returnstrueif multi-part request is already loaded. -
putFile
-
putParameters
-
putParameter
-
parseRequestStream
Extracts uploaded files and parameters from the request data.- Throws:
IOException
-
getParameter
-
getParameterNames
-
getParameterValues
-
getFile
Returns uploaded file.- Parameters:
paramName- parameter name of the uploaded file- Returns:
- uploaded file or
nullif parameter name not found
-
getFiles
Returns all uploaded files the given request parameter has. -
getFileParameterNames
-