Package au.id.villar.web.mfd
Class MultipartProcessor
java.lang.Object
au.id.villar.web.mfd.MultipartProcessor
Utility class to read a multipart body from and HTTP request.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidprocess(String boundary, InputStream input, MultipartProcessorListener listener) Runs the process of reading multipart body.
-
Method Details
-
process
public static void process(String boundary, InputStream input, MultipartProcessorListener listener) throws IOException Runs the process of reading multipart body. For each part in the multipart request, the provided listener will be called.- Parameters:
boundary- The boundary field as specified in the Content-Type header.input- TheInputStreamrepresenting the http body.listener- TheMultipartProcessorListenerto be invoked on each part.- Throws:
IOException- If the providedInputStreamthrows this exception, or if it is detected that the body is not actually multipart type.
-