Package com.stripe.net
Class MultipartProcessor
- java.lang.Object
-
- com.stripe.net.MultipartProcessor
-
public class MultipartProcessor extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description MultipartProcessor(java.io.OutputStream outputStream, java.lang.String boundary, java.nio.charset.Charset charset)Constructs a new multipart body builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFileField(java.lang.String name, java.lang.String fileName, java.io.InputStream inputStream)Adds a file field to the multipart message, but takes in an InputStream instead of just a file to read bytes from.voidaddFormField(java.lang.String name, java.lang.String value)Adds a form field to the multipart message.voidfinish()Adds the final boundary to the multipart message and closes streams.
-
-
-
Method Detail
-
addFormField
public void addFormField(java.lang.String name, java.lang.String value)Adds a form field to the multipart message.- Parameters:
name- field namevalue- field value
-
addFileField
public void addFileField(java.lang.String name, java.lang.String fileName, java.io.InputStream inputStream) throws java.io.IOExceptionAdds a file field to the multipart message, but takes in an InputStream instead of just a file to read bytes from.- Parameters:
name- Field namefileName- Name of the "file" being uploaded.inputStream- Stream of bytes to use in place of a file.- Throws:
java.io.IOException- Thrown when writing / reading from streams fails.
-
finish
public void finish() throws java.io.IOExceptionAdds the final boundary to the multipart message and closes streams.- Throws:
java.io.IOException
-
-