Public Member Functions | |
void | addFilePart (String fieldName, File uploadFile) throws IOException |
void | addFormField (String name, String value) |
void | addHeaderField (String name, String value) |
List< String > | finish () throws IOException |
MultipartUtility (String requestURL, String token, String charset) throws IOException | |
Private Attributes | |
final String | boundary |
String | charset |
HttpURLConnection | httpConn |
OutputStream | outputStream |
PrintWriter | writer |
Static Private Attributes | |
static final String | LINE_FEED = "\r\n" |
This utility class provides an abstraction layer for sending multipart HTTP POST requests to a web server.
Definition at line 25 of file MultipartUtility.java.
com.introlab.rtabmap.MultipartUtility.MultipartUtility | ( | String | requestURL, |
String | token, | ||
String | charset | ||
) | throws IOException [inline] |
This constructor initializes a new HTTP POST request with content type is set to multipart/form-data
requestURL | |
charset |
IOException |
Definition at line 40 of file MultipartUtility.java.
void com.introlab.rtabmap.MultipartUtility.addFilePart | ( | String | fieldName, |
File | uploadFile | ||
) | throws IOException [inline] |
Adds a upload file section to the request
fieldName | name attribute in <input type="file" name="..."> |
uploadFile | a File to be uploaded |
IOException |
Definition at line 79 of file MultipartUtility.java.
void com.introlab.rtabmap.MultipartUtility.addFormField | ( | String | name, |
String | value | ||
) | [inline] |
Adds a form field to the request
name | field name |
value | field value |
Definition at line 64 of file MultipartUtility.java.
void com.introlab.rtabmap.MultipartUtility.addHeaderField | ( | String | name, |
String | value | ||
) | [inline] |
Adds a header field to the request.
name | - name of the header field |
value | - value of the header field |
Definition at line 113 of file MultipartUtility.java.
List<String> com.introlab.rtabmap.MultipartUtility.finish | ( | ) | throws IOException [inline] |
Completes the request and receives response from the server.
IOException |
Definition at line 124 of file MultipartUtility.java.
final String com.introlab.rtabmap.MultipartUtility.boundary [private] |
Definition at line 26 of file MultipartUtility.java.
String com.introlab.rtabmap.MultipartUtility.charset [private] |
Definition at line 29 of file MultipartUtility.java.
HttpURLConnection com.introlab.rtabmap.MultipartUtility.httpConn [private] |
Definition at line 28 of file MultipartUtility.java.
final String com.introlab.rtabmap.MultipartUtility.LINE_FEED = "\r\n" [static, private] |
Definition at line 27 of file MultipartUtility.java.
OutputStream com.introlab.rtabmap.MultipartUtility.outputStream [private] |
Definition at line 30 of file MultipartUtility.java.
PrintWriter com.introlab.rtabmap.MultipartUtility.writer [private] |
Definition at line 31 of file MultipartUtility.java.