@@ -29,7 +29,7 @@ public Multipart() {
2929
3030 /**
3131 * Get the multipart boundary for use in the request header
32- * @return
32+ * @return The multipart boundary
3333 */
3434 public String boundary () {
3535 return boundary ;
@@ -40,7 +40,7 @@ public String boundary() {
4040 * @param name The name of the part
4141 * @param contentType The MIME type (text/html, text/plain, etc.)
4242 * @param content The string content to include
43- * @throws IOException
43+ * @throws IOException Throws an exception if the output stream cannot be written to
4444 */
4545 public void addPart (String name , String contentType , String content ) throws IOException {
4646 addPart (name , contentType , content .getBytes ());
@@ -51,7 +51,7 @@ public void addPart(String name, String contentType, String content) throws IOEx
5151 * @param name The name of the part
5252 * @param contentType The MIME type (text/html, video/mp4, etc.)
5353 * @param byteArray The byte[] contents of the resource
54- * @throws IOException
54+ * @throws IOException Throws an exception if the output stream cannot be written to
5555 */
5656 public void addPart (String name , String contentType , byte [] byteArray ) throws IOException {
5757 String partContent = addBoundary ();
@@ -69,7 +69,7 @@ public void addPart(String name, String contentType, byte[] byteArray) throws IO
6969 * Add an HTML part to the multipart body
7070 * @param name The name of the part
7171 * @param content The HTML body for the part
72- * @throws IOException
72+ * @throws IOException Throws an exception if the output stream cannot be written to
7373 */
7474 public void addHtmlPart (String name , String content ) throws IOException {
7575 addPart (name , "text/html" , content );
@@ -79,7 +79,7 @@ public void addHtmlPart(String name, String content) throws IOException {
7979 * Add an image part to the multipart body
8080 * @param name The name of the part
8181 * @param imageFile The image file
82- * @throws IOException
82+ * @throws IOException Throws an exception if the output stream cannot be written to
8383 */
8484 public void addImagePart (String name , java .io .File imageFile ) throws IOException {
8585 addFilePart (name , "image/jpeg" , imageFile );
@@ -90,7 +90,7 @@ public void addImagePart(String name, java.io.File imageFile) throws IOException
9090 * @param name The name of the part
9191 * @param contentType The MIME type of the file (application/pdf, video/mp4, etc.)
9292 * @param file The file
93- * @throws IOException
93+ * @throws IOException Throws an exception if the output stream cannot be written to
9494 */
9595 public void addFilePart (String name , String contentType , java .io .File file ) throws IOException {
9696 InputStream fileStream = new FileInputStream (file );
@@ -100,15 +100,15 @@ public void addFilePart(String name, String contentType, java.io.File file) thro
100100
101101 /**
102102 * Adds a boundary at the beginning of a new part
103- * @return
103+ * @return The boundary
104104 */
105105 private String addBoundary () {
106106 return "--" + boundary + RETURN ;
107107 }
108108
109109 /**
110110 * Adds a boundary at the end of the multipart body
111- * @return
111+ * @return The boundary
112112 */
113113 private String addEnding () {
114114 return "--" + boundary + "--" ;
@@ -117,7 +117,7 @@ private String addEnding() {
117117 /**
118118 * Returns a full multipart body byte array
119119 * @return The byte[] representation of the multipart object
120- * @throws IOException
120+ * @throws IOException Throws an exception if the output stream cannot be written to
121121 */
122122 public byte [] content () throws IOException {
123123 ByteArrayOutputStream finalStream = out ;
@@ -129,7 +129,7 @@ public byte[] content() throws IOException {
129129 * Helper method to convert an InputStream to a byte[]
130130 * @param in The input stream to convert
131131 * @return The byte[]
132- * @throws IOException
132+ * @throws IOException Throws an exception if the output stream cannot be written to
133133 */
134134 private byte [] getByteArray (InputStream in ) throws IOException {
135135 ByteArrayOutputStream buffer = new ByteArrayOutputStream ();
0 commit comments