Package io.fusionauth.http.io
Class MultipartStream
java.lang.Object
io.fusionauth.http.io.MultipartStream
Handles the multipart body encoding and file uploads.
- Author:
- Brian Pontarelli
-
Constructor Summary
ConstructorsConstructorDescriptionMultipartStream(InputStream input, byte[] boundary, int bufSize) Constructs aMultipartStreamwith a custom size buffer. -
Method Summary
-
Constructor Details
-
MultipartStream
Constructs aMultipartStreamwith a custom size buffer.Note that the buffer must be at least big enough to contain the boundary string, plus 4 characters for CR/LF and double dash, plus at least one byte of data. Too small a buffer size setting will degrade performance.
- Parameters:
input- TheInputStreamto serve as a data source.boundary- The token used for dividing the stream intoencapsulations.bufSize- The size of the buffer to be used, in bytes.- Throws:
IllegalArgumentException- If the buffer size is too small
-
-
Method Details
-
process
public void process(Map<String, List<String>> parameters, List<FileInfo> files) throws IOException, ParseExceptionCompletely processes the multipart body and puts the parameters and files into the given collections.- Parameters:
parameters- The parameters.files- The files.- Throws:
IOException- If any I/O operation failed.ParseException- If the input is not a proper multipart body and could not be processed.
-