com.ibm.portal.resolver.data
Interface MultipartDataSource

All Superinterfaces:
Addressable, DataSource, DataSourceFragment, Disposable, TimeStamped

public interface MultipartDataSource
extends DataSource

Support for producing multipart responses. The data provider streams the data to the MultipartOutputStream.

Since:
6.1.0
Note:
This interface is designed to be implemented by clients.

Field Summary
static java.lang.String CONTENT_TYPE_MULTIPART
          Mime type for multipart messages
static java.lang.String KEY_MIME_BOUNDARY
          Name of the mime key that specifies the multipart boundary
 
Fields inherited from interface com.ibm.portal.resolver.data.DataSource
CONTENT_TYPE_UNKNOWN, CREATION_UNKNOWN, EXPIRATION_UNKNOWN, LAST_MODIFICATION_UNKNOWN, MAX_AGE_INFINITE, MAX_AGE_NONE, ROOT_DATE
 
Fields inherited from interface com.ibm.portal.resolver.data.Addressable
EMPTY_PARAMETERS
 
Method Summary
 java.lang.String getContentType()
          Mime type of the data.
 MultipartOutputStream write(MultipartOutputStream out)
          Copies the complete data onto the target stream.
 
Methods inherited from interface com.ibm.portal.resolver.data.DataSource
getCreated, getExpiration, getLastModified
 
Methods inherited from interface com.ibm.portal.resolver.data.Addressable
getParameters, getURI
 
Methods inherited from interface com.ibm.portal.Disposable
dispose
 

Field Detail

CONTENT_TYPE_MULTIPART

static final java.lang.String CONTENT_TYPE_MULTIPART
Mime type for multipart messages

Since:
6.1.0.3
See Also:
Constant Field Values

KEY_MIME_BOUNDARY

static final java.lang.String KEY_MIME_BOUNDARY
Name of the mime key that specifies the multipart boundary

Since:
6.1.0.3
See Also:
Constant Field Values
Method Detail

getContentType

java.lang.String getContentType()
Mime type of the data. The return value must be a MultipartStream.VALUE_MULTIPART primary mime-type that contains the MultipartStream.KEY_MIME_BOUNDARY multipart boundary, e.g. "multipart/mixed; boundary=47874839".

Specified by:
getContentType in interface DataSource
Returns:
mime type string, not null
See Also:
StreamFactory#createMultipartBoundary(int)

write

MultipartOutputStream write(MultipartOutputStream out)
                            throws java.io.IOException
Copies the complete data onto the target stream. The target stream should NOT be closed.

Parameters:
out - target stream to receive the data.
Returns:
reference to the target stream to allow method chaining
Throws:
java.io.IOException - - if the copy operation failed