Package com.stripe.net
Class MultipartProcessor
java.lang.Object
com.stripe.net.MultipartProcessor
-
Constructor Summary
ConstructorsConstructorDescriptionMultipartProcessor(OutputStream outputStream, String boundary, Charset charset) Constructs a new multipart body builder. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFileField(String name, String fileName, 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(String name, String value) Adds a form field to the multipart message.voidfinish()Adds the final boundary to the multipart message and closes streams.
-
Constructor Details
-
MultipartProcessor
public MultipartProcessor(OutputStream outputStream, String boundary, Charset charset) throws IOException Constructs a new multipart body builder.- Throws:
IOException
-
-
Method Details
-
addFormField
Adds a form field to the multipart message.- Parameters:
name- field namevalue- field value
-
addFileField
Adds 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:
IOException- Thrown when writing / reading from streams fails.
-
finish
Adds the final boundary to the multipart message and closes streams.- Throws:
IOException
-