Package com.blackrook.small.multipart
Class MultipartFormDataParser
java.lang.Object
com.blackrook.small.multipart.MultipartParser
com.blackrook.small.multipart.MultipartFormDataParser
Parser for multipart form requests.
- Author:
- Matthew Tropiano
-
Field Summary
Fields inherited from class com.blackrook.small.multipart.MultipartParser
HEADER_DISPOSITION, HEADER_TYPE, NEWLINE, NEWLINE_BYTES, PIECE_BOUNDARY, PIECE_CHARSET
-
Constructor Summary
-
Method Summary
Methods inherited from class com.blackrook.small.multipart.MultipartParser
addPart, generateTempFile, getPartList, isMultipart, iterator, parse, parseContentType, parseDisposition, scanDataUntilBoundary, scanLine
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
MultipartFormDataParser
public MultipartFormDataParser()Creates a new form-data parser.
-
-
Method Details
-
parseData
protected void parseData(javax.servlet.ServletInputStream sis, File outputDir, String startBoundary, String endBoundary, byte[] startBoundaryBytes) throws MultipartParserException, UnsupportedEncodingException Description copied from class:MultipartParser
Parses the servlet content and generates parts.- Specified by:
parseData
in classMultipartParser
- Parameters:
sis
- the input servlet stream.outputDir
- the output directorystartBoundary
- the boundary string for each part.endBoundary
- the last boundary string.startBoundaryBytes
- the boundary string for each part as bytes in the correct encoding.- Throws:
MultipartParserException
- if something is malformed in the request body.UnsupportedEncodingException
- if the part encoding is not supported.
-