org.jboss.resteasy.plugins.providers.multipart
Class MultipartRelatedOutput
java.lang.Object
org.jboss.resteasy.plugins.providers.multipart.MultipartOutput
org.jboss.resteasy.plugins.providers.multipart.MultipartRelatedOutput
public class MultipartRelatedOutput
- extends MultipartOutput
Represents a multipart/related (RFC2387) outgoing mime message. A
multipart/related message is used to hold a root or start part and other
parts which are referenced from the root part. All parts have a unique id.
The type and the id of the start part is presented in parameters in the
message content-type header.
Usage is the same as with MultipartOutput
:
MultipartRelatedDataOutput mrdo = new MultipartRelatedDataOutput();
mrdo.addPart(...);
The first added part will be used as root. The root parts content-type will
be used as the type parameter of the content-type of the mime message.
For parts without Content-ID header a unique id will be generated during
serialization.
- Version:
- $Revision: 1 $
- Author:
- Attila Kiraly
Method Summary |
OutputPart |
addPart(java.lang.Object entity,
MediaType mediaType,
java.lang.String contentId,
java.lang.String contentTransferEncoding)
Used to add parts to the multipart output message. |
OutputPart |
getRootPart()
The part that will be used as the root. |
java.lang.String |
getStartInfo()
Returns the start-info parameter of the Content-Type. |
void |
setStartInfo(java.lang.String startInfo)
Sets the start-info parameter of the Content-Type. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MultipartRelatedOutput
public MultipartRelatedOutput()
getRootPart
public OutputPart getRootPart()
- The part that will be used as the root.
- Returns:
- the first in the list of added parts.
addPart
public OutputPart addPart(java.lang.Object entity,
MediaType mediaType,
java.lang.String contentId,
java.lang.String contentTransferEncoding)
- Used to add parts to the multipart output message.
- Parameters:
entity
- the object representing the part's bodymediaType
- the Content-Type of the partcontentId
- the Content-ID to be used as identification for the current
part, optional, if null one will be generatedcontentTransferEncoding
- The value to be used for the Content-Transfer-Encoding header
field of the part. It's optional, if you don't want to set
this pass null. Example values are: "7bit",
"quoted-printable", "base64", "8bit", "binary"
- Returns:
getStartInfo
public java.lang.String getStartInfo()
- Returns the start-info parameter of the Content-Type. This is an optional
parameter.
As described in RFC2387:
3.3. The Start-Info Parameter
Additional information can be provided to an application by the
start-info parameter. It contains either a string or points, via a
content-ID, to another MIME entity in the message. A typical use might be
to provide additional command line parameters or a MIME entity giving
auxiliary information for processing the compound object.
Applications that use Multipart/Related must specify the interpretation
of start-info. User Agents shall provide the parameter's value to the
processing application. Processes can distinguish a start-info reference
from a token or quoted-string by examining the first non-white-space
character, ">" indicates a reference.
- Returns:
- the currently configured start-info
setStartInfo
public void setStartInfo(java.lang.String startInfo)
- Sets the start-info parameter of the Content-Type. This is an optional
parameter.
As described in RFC2387:
3.3. The Start-Info Parameter
Additional information can be provided to an application by the
start-info parameter. It contains either a string or points, via a
content-ID, to another MIME entity in the message. A typical use might be
to provide additional command line parameters or a MIME entity giving
auxiliary information for processing the compound object.
Applications that use Multipart/Related must specify the interpretation
of start-info. User Agents shall provide the parameter's value to the
processing application. Processes can distinguish a start-info reference
from a token or quoted-string by examining the first non-white-space
character, ">" indicates a reference.
* @param startInfo the value to be set
Copyright © 2010. All Rights Reserved.