Package com.bea.wli.sb.sources
Class MimeSource
java.lang.Object
com.bea.wli.sb.sources.MimeSource
- All Implemented Interfaces:
com.bea.wli.sb.sources.ContentTypeAwareSource,com.bea.wli.sb.sources.RefCountedSource,Source,Serializable
public class MimeSource
extends Object
implements Source, com.bea.wli.sb.sources.RefCountedSource, com.bea.wli.sb.sources.ContentTypeAwareSource, Serializable
Source representing arbitrary content with headers. Essentially this is a Source
that represents a MIME part. Headers must conform to RFC822 whereas the Source can
be any type of source.
The serialization format for this Source is a fully-compliant MIME package. This source is also cognizant of Content-Transfer-Encoding, and it will perform the proper encoding of the underlying content stream if the header is present. Note that this means that the Source provided to the constructor should be in raw form and should not be already encoded.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringtransform option that tells the source not to include the MIME multipart headers when returning source content as a streamFields inherited from interface com.bea.wli.sb.sources.Source
DEFAULT_CHARACTER_SET_ENCODING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRef()voiddispose()com.bea.wli.sb.sources.HeadersgetInputStream(TransformOptions options) Returns streaming byte-baseed representation of the Source's content.voidwriteTo(OutputStream out, TransformOptions options) Serializes the Source's content to a byte-based stream.
-
Field Details
-
EXCLUDE_HEADERS
transform option that tells the source not to include the MIME multipart headers when returning source content as a stream- See Also:
-
-
Constructor Details
-
MimeSource
-
-
Method Details
-
getHeaders
public com.bea.wli.sb.sources.Headers getHeaders() -
getContent
-
getContentType
- Specified by:
getContentTypein interfacecom.bea.wli.sb.sources.ContentTypeAwareSource
-
getInputStream
Description copied from interface:SourceReturns streaming byte-baseed representation of the Source's content. The representation of that serialization is entirely up to the Source. Note that this method may involve an internal transformation, although it should not in any way change the underlying content.- Specified by:
getInputStreamin interfaceSource- Parameters:
options- Options used to affect the serialization- Returns:
- an InputStream for retrieving the serialized content
- Throws:
IOExceptionTransformException
-
writeTo
public void writeTo(OutputStream out, TransformOptions options) throws IOException, TransformException Description copied from interface:SourceSerializes the Source's content to a byte-based stream. The representation of that serialization is entirely up to the Source. The Source is forbidden from closing the provided OutputStream, although it is allowed to flush it. However, flushing the stream should be left to the caller, if possible.Note that this method may involve an internal transformation, although it should not in any way change the underlying content.
- Specified by:
writeToin interfaceSource- Parameters:
out- the OutputStream to which serialized content will be writtenoptions- TransformOptions used to affect the serialization- Throws:
IOExceptionTransformException
-
addRef
public void addRef()- Specified by:
addRefin interfacecom.bea.wli.sb.sources.RefCountedSource
-
dispose
- Specified by:
disposein interfacecom.bea.wli.sb.sources.RefCountedSource- Throws:
IOException
-