Public Member Functions | Private Attributes | Static Private Attributes
com.introlab.rtabmap.MultipartUtility Class Reference

List of all members.

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"

Detailed Description

This utility class provides an abstraction layer for sending multipart HTTP POST requests to a web server.

Author:
www.codejava.net http://www.codejava.net/java-se/networking/upload-files-by-sending-multipart-request-programmatically

Definition at line 25 of file MultipartUtility.java.


Constructor & Destructor Documentation

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

Parameters:
requestURL
charset
Exceptions:
IOException

Definition at line 40 of file MultipartUtility.java.


Member Function Documentation

void com.introlab.rtabmap.MultipartUtility.addFilePart ( String  fieldName,
File  uploadFile 
) throws IOException [inline]

Adds a upload file section to the request

Parameters:
fieldNamename attribute in <input type="file" name="...">
uploadFilea File to be uploaded
Exceptions:
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

Parameters:
namefield name
valuefield 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.

Parameters:
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.

Returns:
a list of Strings as response in case the server returned status OK, otherwise an exception is thrown.
Exceptions:
IOException

Definition at line 124 of file MultipartUtility.java.


Member Data Documentation

Definition at line 26 of file MultipartUtility.java.

Definition at line 29 of file MultipartUtility.java.

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.

Definition at line 30 of file MultipartUtility.java.

Definition at line 31 of file MultipartUtility.java.


The documentation for this class was generated from the following file:


rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Jun 6 2019 21:59:40