Package com.atlan.net
Class MultipartProcessor
java.lang.Object
com.atlan.net.MultipartProcessor
Currently unused — may be useful longer-term for endpoints that need to upload files (TBC).
-
Constructor Summary
ConstructorDescriptionMultipartProcessor
(OutputStream outputStream, String boundary, Charset charset) Constructs a new multipart body builder. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addFileField
(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.void
addFormField
(String name, String value) Adds a form field to the multipart message.void
finish()
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
-