SilverStream
Application Server 3.5

com.sssw.srv.mail
Class AgoMIMEPartByteStream

java.lang.Object
 |
 +--com.sssw.srv.mail.AgoMIMEPart
       |
       +--com.sssw.srv.mail.AgoMIMEPartByteStream
Direct Known Subclasses:
AgoMIMEPartApplication, AgoMIMEPartAudio, AgoMIMEPartImage, AgoMIMEPartVideo

public abstract class AgoMIMEPartByteStream
extends AgoMIMEPart

An abstract subclass of AgoMIMEPart. It is the base class for other MIME parts whose value is represented as a stream of bytes (e.g., AgoMIMEPartApplication, AgoMIMEPartAudio, AgoMIMEPartImage, and AgoMIMEPartVideo).


Constructor Summary
AgoMIMEPartByteStream(String type, String subtype, String contentdisposition)
          A constructor for the AgoMIMEPartByteStream class.
AgoMIMEPartByteStream(String type, String subtype, String contentdisposition, AgoRFC822HeaderFieldSet headerfieldset)
          A constructor for the AgoMIMEPartByteStream class.
AgoMIMEPartByteStream(String type, String subtype, String contentdisposition, AgoRFC822HeaderFieldSet headerfieldset, AgoEncodingIdentifier encodingidentifier)
          A constructor for the AgoMIMEPartByteStream class.
AgoMIMEPartByteStream(String type, String subtype, String contentdisposition, AgoRFC822HeaderFieldSet headerfieldset, AgoEncodingIdentifier encodingidentifier, AgoByteStore value)
          A constructor for the AgoMIMEPartByteStream class.
 
Method Summary
 AgoMIMEHeaderField contentDispositionHeaderField()
          Returns the content disposition header or null if it is not available.
 AgoMIMEHeaderField contentTransferEncodingHeaderField()
          Returns a header field for the content transfer encoding header or null if it is not available.
 AgoMIMEHeaderField contentTypeHeaderField()
          Returns an AgoMIMEHeaderField for the content type.
 String getContentDisposition()
          Returns the content disposition as a String.
 AgoEncodingIdentifier getEncodingIdentifier()
          Returns the identifier of the encoding mechanism.
 AgoByteStore getValue()
          Returns the value or body of this MIME part.
 void setContentDisposition(String contentdisposition)
          Sets the content disposition of a MIME part.
 void setEncodingIdentifier(AgoEncodingIdentifier encodingidentifier)
          Sets the content encoding identifier.
 void setValue(AgoByteStore value)
          Sets the value or body of this MIME part.
 void write(OutputStream outputstream)
          Writes the part (including headers) to the specified output stream.
 void writeHeaderFields(OutputStream outputstream)
          Writes only the header fields to the specified output stream.
 
Methods inherited from class com.sssw.srv.mail.AgoMIMEPart
deleteHeaderField, getHeaderField, getHeaderFieldSet, getNameParameterOnContentType, setHeaderField, setHeaderField, setHeaderFieldSet, setNameParameterOnContentType, subtype, type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AgoMIMEPartByteStream

public AgoMIMEPartByteStream(String type,
                             String subtype,
                             String contentdisposition)
A constructor for the AgoMIMEPartByteStream class.
Parameters:
type - the type of this MIME part (required, cannot be null). For supported types see supported types and subtypes.
subtype - the subtype of this MIME part (required, cannot be null). For supported subtypes see supported types and subtypes.
contentdisposition - the value for the content-disposition header field, or null.
Usage:

Note that this is an abstract class; call this constructor only to create a derived subclass. The encoding will be set to "base64". super().

Example:
    AgoMIMEPartByteStream part = new AgoMIMEPartByteStream("image",
                                                            "jpeg",
                                                            "inline");
 

AgoMIMEPartByteStream

public AgoMIMEPartByteStream(String type,
                             String subtype,
                             String contentdisposition,
                             AgoRFC822HeaderFieldSet headerfieldset)
A constructor for the AgoMIMEPartByteStream class.
Parameters:
type - the type of this MIME part (required, cannot be null). For supported types see supported types and subtypes.
subtype - the subtype of this MIME part (required, cannot be null). For supported subtypes see supported types and subtypes.
contentdisposition - the value for the content-disposition header field, or null.
headerfieldset - a set of heades for this part, or null.
Usage:

Note that this is an abstract class; call this constructor only to create a derived subclass.

The encoding will be set to "base64". super().

Example:
     AgoRFC822HeaderFieldSet headers;
     AgoMIMEPartByteStream part = new AgoMIMEPartByteStream("image",
                                                            "jpeg",
                                                            "inline",
                                                            headers);
 
See Also:
AgoRFC822HeaderFieldSet

AgoMIMEPartByteStream

public AgoMIMEPartByteStream(String type,
                             String subtype,
                             String contentdisposition,
                             AgoRFC822HeaderFieldSet headerfieldset,
                             AgoEncodingIdentifier encodingidentifier)
A constructor for the AgoMIMEPartByteStream class.
Parameters:
type - the type of this MIME part (required, cannot be null). For supported types see supported types and subtypes.
subtype - the subtype of this MIME part (required, cannot be null). For supported subtypes see supported types and subtypes.
contentdisposition - the value for the content-disposition header field, or null.
headerfieldset - a set of heades for this part, or null.
encodingidentifier - an encoding identifier for this part. The default is AgoMIME.MECHANISM_BASE64. For supported encoding mechanisms see supported encoding mechanisms.
Usage:

Note that this is an abstract class; call this constructor only to create a derived subclass. super().

Example:
     AgoRFC822HeaderFieldSet headers;
     AgoMIMEPartByteStream part = new AgoMIMEPartByteStream("image",
                                                            "jpeg",
                                                            "inline",
                                                            headers,
                                                            "base64");
 
See Also:
AgoRFC822HeaderFieldSet

AgoMIMEPartByteStream

public AgoMIMEPartByteStream(String type,
                             String subtype,
                             String contentdisposition,
                             AgoRFC822HeaderFieldSet headerfieldset,
                             AgoEncodingIdentifier encodingidentifier,
                             AgoByteStore value)
A constructor for the AgoMIMEPartByteStream class.
Parameters:
type - the type of this MIME part (required, cannot be null). For supported types see supported types and subtypes.
subtype - the subtype of this MIME part (required, cannot be null). For supported subtypes see see supported types and subtypes.
contentdisposition - the value for the content-disposition header field, or null.
headerfieldset - a set of heades for this part, or null.
encodingidentifier - an encoding identifier for this part. The default is AgoMIME.MECHANISM_BASE64. For supported encoding mechanisms see supported encoding mechanisms.
value - the value for this part, or null.
Usage:

Note that this is an abstract class; call this constructor only to create a derived subclass.

Example:
     AgoRFC822HeaderFieldSet headers;
     AgoByteStore bytes;
     AgoMIMEPartByteStream part = new AgoMIMEPartByteStream("image",
                                                            "jpeg",
                                                            "inline",
                                                            headers,
                                                            "base64",
                                                            bytes);
 
See Also:
AgoRFC822HeaderFieldSet, AgoByteStore
Method Detail

getValue

public AgoByteStore getValue()
Returns the value or body of this MIME part.
Example:
     AgoByteStore body = part.getValue();

setValue

public void setValue(AgoByteStore value)
Sets the value or body of this MIME part.
Parameters:
value - the value (or body) of this part.
Example:
     part.setValue(someAgoByteStore);
 
See Also:
AgoByteStore

getEncodingIdentifier

public AgoEncodingIdentifier getEncodingIdentifier()
Returns the identifier of the encoding mechanism.
Usage:

see supported encoding mechanisms.

Example:
     AgoEncodingIdentifier encoding = part.getEncodingIdentifier();
 
See Also:
AgoEncodingIdentifier, AgoMIMEPartByteStream.setEncodingIdentifier( AgoEncodingIdentifier encodingidentifier )

setEncodingIdentifier

public void setEncodingIdentifier(AgoEncodingIdentifier encodingidentifier)
Sets the content encoding identifier.
Parameters:
encodingidentifier - the encoding identifier to set (e.g. AgoMIME.MECHANISM_BASE64). For supported encoding mechanisms see supported encoding mechanisms.
Example:
     part.setEncodingIdentifier("base64");
 
See Also:
AgoEncodingIdentifier, AgoMIMEPartByteStream.contentTransferEncodingHeaderField(), AgoMIMEPartByteStream.getEncodingIdentifier()

getContentDisposition

public String getContentDisposition()
Returns the content disposition as a String.
Example:
     String cDis = part.getContentDisposition();
 
See Also:
AgoMIMEPartByteStream.setContentDisposition( String contentdisposition )

setContentDisposition

public void setContentDisposition(String contentdisposition)
Sets the content disposition of a MIME part.
Parameters:
contentdisposition - specifies the content disposition to be set (e.g.AgoMIME.DISPOSITION_INLINE). For supported content dispositions see supported content dispositions.
Example:
     part.setContentDisposition("inline");
 
See Also:
AgoMIMEPartByteStream.getContentDisposition(), AgoMIMEPartByteStream.contentDispositionHeaderField()

write

public void write(OutputStream outputstream)
           throws IOException
Writes the part (including headers) to the specified output stream.
Overrides:
write in class AgoMIMEPart
Parameters:
outputStream - specifies the output stream to write to.
Usage:

Overrides write in class AgoMIMEPart.

Example:
     part.write(someOutputStream);
 

writeHeaderFields

public void writeHeaderFields(OutputStream outputstream)
                       throws IOException
Writes only the header fields to the specified output stream.
Overrides:
writeHeaderFields in class AgoMIMEPart
Parameters:
outputstream - specifies the output stream.
Usage:

Overrides writeHeaderFields in class AgoMIMEPart.

Example:
     part.writeHeaderFields(someOutputStream);
 
See Also:
AgoMIMEPart.setHeaderField( String name,String body ), AgoMIMEPart.getHeaderField( String name )

contentTypeHeaderField

public AgoMIMEHeaderField contentTypeHeaderField()
Returns an AgoMIMEHeaderField for the content type.
Overrides:
contentTypeHeaderField in class AgoMIMEPart
Usage:

Overrides contentTypeHeaderField in class AgoMIMEPart.

Example:
     AgoMIMEHeaderField cType = part.contentTypeHeaderField();
 
See Also:
AgoMIMEHeaderField

contentTransferEncodingHeaderField

public AgoMIMEHeaderField contentTransferEncodingHeaderField()
Returns a header field for the content transfer encoding header or null if it is not available.
Overrides:
contentTransferEncodingHeaderField in class AgoMIMEPart
Usage:

Overrides contentTransferEncodingHeaderField in class AgoMIMEPart

Example:
     AgoMIMEHeaderField cTrans = part.contentTransferEncodingHeaderField();
 
See Also:
AgoMIMEHeaderField, AgoMIMEPartByteStream.getEncodingIdentifier(), AgoMIMEPartByteStream.setEncodingIdentifier( AgoEncodingIdentifier encodingidentifier )

contentDispositionHeaderField

public AgoMIMEHeaderField contentDispositionHeaderField()
Returns the content disposition header or null if it is not available.
Overrides:
contentDispositionHeaderField in class AgoMIMEPart
Usage:

Overrides contentDispositionHeaderField in class AgoMIMEPart.

Example:
    AgoMIMEHeaderField cDis = part.contentDispositionHeaderField();
 
See Also:
AgoMIMEHeaderField, AgoMIMEPartByteStream.getContentDisposition(), AgoMIMEPartByteStream.setContentDisposition(String contentdisposition)

SilverStream
Application Server 3.5