|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.api.client.http.MultipartRelatedContent
public final class MultipartRelatedContent
Serializes MIME Multipart/Related content as specified by RFC 2387: The MIME Multipart/Related Content-type.
Limitations:
"boundary"Sample usage:
static void setMediaWithMetadataContent(HttpRequest request,
AtomContent atomContent, InputStreamContent imageContent) {
MultipartRelatedContent content =
MultipartRelatedContent.forRequest(request);
content.parts.add(atomContent);
content.parts.add(imageContent);
}
| Field Summary | |
|---|---|
String |
boundary
Boundary string to use. |
Collection<HttpContent> |
parts
Collection of HTTP content parts. |
| Constructor Summary | |
|---|---|
MultipartRelatedContent()
|
|
| Method Summary | |
|---|---|
static MultipartRelatedContent |
forRequest(HttpRequest request)
Returns a new multi-part content serializer as the content for the given HTTP request. |
String |
getEncoding()
Returns the content encoding (for example "gzip") or null for none. |
long |
getLength()
Returns the content length or less than zero if not known. |
String |
getType()
Returns the content type or null for none. |
boolean |
retrySupported()
Returns whether or not retry is supported on this content type. |
void |
writeTo(OutputStream out)
Writes the content to the given output stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public String boundary
"END_OF_PART".
public Collection<HttpContent> parts
By default, it is an empty list. Note that the content type for each part is required, so
HttpContent.getType() must not be null.
| Constructor Detail |
|---|
public MultipartRelatedContent()
| Method Detail |
|---|
public static MultipartRelatedContent forRequest(HttpRequest request)
It also sets the HttpHeaders.mimeVersion of headers to
"1.0".
request - HTTP request
public void writeTo(OutputStream out)
throws IOException
HttpContent
writeTo in interface HttpContentIOExceptionpublic String getEncoding()
HttpContent"gzip") or null for none.
getEncoding in interface HttpContentpublic long getLength()
HttpContent
getLength in interface HttpContentpublic String getType()
HttpContentnull for none.
getType in interface HttpContentpublic boolean retrySupported()
HttpContent
retrySupported in interface HttpContent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||