Multipart Class
- java.
lang. Object - com.
microsoft. graph. core. Multipart
- com.
public class Multipart
Helper for submitting multipart data This follows the Network Working Group's RFC on multipart/form-data posting format: https://www.ietf.org/rfc/rfc2388.txt
Field Summary
| Modifier and Type | Field and Description |
|---|---|
| static final java.lang.String |
MULTIPART_ENCODING
Default encoding for multi-part requests |
Constructor Summary
| Constructor | Description |
|---|---|
| Multipart() |
Create a new multipart object |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| void |
addFilePart(String name, String contentType, File file)
Add a file part to the multipart body |
| void |
addFormData(String name, String contentType, byte[] byteArray)
Add a part to the multipart body |
| void |
addHtmlPart(String name, byte[] content)
Add an HTML part to the multipart body |
| void |
addPart(String contentType, byte[] byteArray)
Add a part to the multipart body |
| void |
addPart(Map<String,String> headers, byte[] content)
Add a part to the multipart body |
| byte[] |
content()
Returns a full multipart body byte array |
| static java.lang.String |
createContentHeaderValue(String contentValue, Map<String,String> contentDispParameter)
Create content headers value and parameter |
| java.lang.String |
getBoundary()
Get the multipart boundary for use in the request header |
| java.lang.String |
getContentType()
Get the content |
|
Header |
header()
Get the Content-Type header to send the multipart request |
| void |
setBoundary(String boundary)
Set the multipart boundary for use in the request header |
| void |
setContentType(String contentType)
Set the content |
Methods inherited from java.lang.Object
Field Details
MULTIPART_ENCODING
public static final String MULTIPART_ENCODING
Default encoding for multi-part requests
Constructor Details
Multipart
public Multipart()
Create a new multipart object
Method Details
addFilePart
public void addFilePart(String name, String contentType, File file)
Add a file part to the multipart body
Parameters:
Throws:
addFormData
public void addFormData(String name, String contentType, byte[] byteArray)
Add a part to the multipart body
Parameters:
Throws:
addHtmlPart
public void addHtmlPart(String name, byte[] content)
Add an HTML part to the multipart body
Parameters:
Throws:
addPart
public void addPart(String contentType, byte[] byteArray)
Add a part to the multipart body
Parameters:
Throws:
addPart
public void addPart(Map
Add a part to the multipart body
Parameters:
Throws:
content
public byte[] content()
Returns a full multipart body byte array
Returns:
Throws:
createContentHeaderValue
public static String createContentHeaderValue(String contentValue, Map
Create content headers value and parameter
Parameters:
Returns:
getBoundary
public String getBoundary()
Get the multipart boundary for use in the request header
Returns:
getContentType
public String getContentType()
Get the contentType for use in the request header
Returns:
header
public HeaderOption header()
Get the Content-Type header to send the multipart request
Returns:
setBoundary
public void setBoundary(String boundary)
Set the multipart boundary for use in the request header
Parameters:
setContentType
public void setContentType(String contentType)
Set the contentType for use in the request header
Parameters: