IP*Works!

ipworks
Class Mime

java.lang.Object
  |
  +--ipworks.Mime

public class Mime
extends java.lang.Object

The MIME control allows for easy implementation of the Multipurpose Internet Mail Extensions or MIME as defined in RFC 1521 and updated in RFCs 2045-2049. Those standards provide for formating of messages containing non-text, multipart or non 'US' formated text.

The control's operation is controlled by the control's methods or the Action property. It may be used for decoding or encoding of messages. Message holds the content of the encoded message or the filename which holds the encoded data. The decoded data is put in PartDecodedString and/or PartDecodedFile depending on the user's query.

To decode a MIME message you should first assign either the whole message (headers and body) to Message or put the message headers to MessageHeaders and the message body or the filename holding it to Message . Calling DecodeFromFile or DecodeFromString or setting the Action property to decode directs the control to start parsing the message: it will fill out the ContentType , ContentTypeAttr and PartCount properties as well as the array properties PartSize , PartContentType , PartContentTypeAttr , PartContentDisposition , PartContentDispositionAttr , PartEncoding , PartName , PartFilename , PartHeaders , for each decoded part from 0 to PartCount -1.

For each part you may then get the content out of PartDecodedString or PartDecodedFile properties. Calling the Decode methods or setting the Action to decode doesn't actually decode the message but only parses it. The real decoding is done when the respective array property PartDecodedFile or PartDecodedString is first accessed for any particular index.

To encode data into a MIME message you should first assign values for each part to either PartDecodedString or PartDecodedFile , optionally assign values to the other Part- properties. Assiging a value to the PartDecodedString or PartDecodedFile properties fills out automatically the PartHeaders property for the respective part. Calling EncodeToFile , EncodeToString or setting the Action property to encode directs the control to fill out the Message with the message body and the MessageHeaders with the headers.

The Progress event is fired as the message is parsed and the data is decoded/encoded.


Field Summary
static int mimeDecodeFromFile
           
static int mimeDecodeFromString
           
static int mimeEncodeToFile
           
static int mimeEncodeToString
           
static int mimeIdle
           
static int mimeResetData
           
static int pe77Bit
           
static int pe78Bit
           
static int pe7Base64
           
static int pe7Binary
           
static int pe7QuotedPrintable
           
 
Constructor Summary
Mime()
           
 
Method Summary
 void addMimeEventListener(MimeEventListener l)
           
 void decodeFromFile()
          Decode From File.
 void decodeFromString()
          Decode From String.
 void encodeToFile()
          Encode To File.
 void encodeToString()
          Encode To String.
 void fireProgress(int percentDone)
          Shows the progress of decoding/encoding the input data.
 int getAction()
          Controls the operation of MIME component.
 java.lang.String getBoundary()
          The boundary separating the MIME parts.
 java.lang.String getContentType()
          The value of the content-type header of the message which was encoded/decoded.
 java.lang.String getContentTypeAttr()
          The attributes for content-type header of the message which was encoded/decoded.
 byte[] getMessage()
          Filename holding the encoded message or the encoded message itself.
 java.lang.String getMessageHeaders()
          The headers of the MIME message.
 java.lang.String getPartContentDisposition(int partIdx)
          Content Disposition for each part 0 to PartCount -1.
 java.lang.String getPartContentDispositionAttr(int partIdx)
          Array holding the content disposition's attributes, if any, for each part, numbered 0 to PartCount -1.
 java.lang.String getPartContentId(int partIdx)
          Content type for each part 0 to PartCount -1.
 java.lang.String getPartContentType(int partIdx)
          Content type for each part 0 to PartCount -1.
 java.lang.String getPartContentTypeAttr(int partIdx)
          Array holding the content type attributes, if any, for each part, numbered 0 to PartCount -1.
 int getPartCount()
          The number of MIME parts in the encoded message.
 java.lang.String getPartDecodedFile(int partIdx)
          Array holding the filenames with the decoded data numbered 0 to PartCount -1.
 byte[] getPartDecodedString(int partIdx)
          Array property.
 int getPartEncoding(int partIdx)
          The actual content encoding type for each part 0 to PartCount -1.
 java.lang.String getPartFilename(int partIdx)
          The filename attribute specified in the headers of the part.
 java.lang.String getPartHeaders(int partIdx)
          Headers for each MIME part, numbered 0 to PartCount -1.
 java.lang.String getPartName(int partIdx)
          The name given to a part, such as the filename.
 int getPartSize(int partIdx)
          The size of each PartDecodedFile or PartDecodedString .
 void removeMimeEventListener(MimeEventListener l)
           
 void resetData()
          Resets the values of all headers and Part- properties.
 void setAction(int action)
          Controls the operation of MIME component.
 void setBoundary(java.lang.String boundary)
          The boundary separating the MIME parts.
 void setContentType(java.lang.String contentType)
          The value of the content-type header of the message which was encoded/decoded.
 void setContentTypeAttr(java.lang.String contentTypeAttr)
          The attributes for content-type header of the message which was encoded/decoded.
 void setMessage(byte[] message)
          Filename holding the encoded message or the encoded message itself.
 void setMessageHeaders(java.lang.String messageHeaders)
          The headers of the MIME message.
 void setPartContentDisposition(int partIdx, java.lang.String partContentDisposition)
          Content Disposition for each part 0 to PartCount -1.
 void setPartContentDispositionAttr(int partIdx, java.lang.String partContentDispositionAttr)
          Array holding the content disposition's attributes, if any, for each part, numbered 0 to PartCount -1.
 void setPartContentId(int partIdx, java.lang.String partContentId)
          Content type for each part 0 to PartCount -1.
 void setPartContentType(int partIdx, java.lang.String partContentType)
          Content type for each part 0 to PartCount -1.
 void setPartContentTypeAttr(int partIdx, java.lang.String partContentTypeAttr)
          Array holding the content type attributes, if any, for each part, numbered 0 to PartCount -1.
 void setPartCount(int partCount)
          The number of MIME parts in the encoded message.
 void setPartDecodedFile(int partIdx, java.lang.String partDecodedFile)
          Array holding the filenames with the decoded data numbered 0 to PartCount -1.
 void setPartDecodedString(int partIdx, byte[] partDecodedString)
          Array property.
 void setPartEncoding(int partIdx, int partEncoding)
          The actual content encoding type for each part 0 to PartCount -1.
 void setPartFilename(int partIdx, java.lang.String partFilename)
          The filename attribute specified in the headers of the part.
 void setPartHeaders(int partIdx, java.lang.String partHeaders)
          Headers for each MIME part, numbered 0 to PartCount -1.
 void setPartName(int partIdx, java.lang.String partName)
          The name given to a part, such as the filename.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mimeIdle

public static final int mimeIdle

mimeDecodeFromFile

public static final int mimeDecodeFromFile

mimeDecodeFromString

public static final int mimeDecodeFromString

mimeEncodeToFile

public static final int mimeEncodeToFile

mimeEncodeToString

public static final int mimeEncodeToString

mimeResetData

public static final int mimeResetData

pe77Bit

public static final int pe77Bit

pe7QuotedPrintable

public static final int pe7QuotedPrintable

pe7Base64

public static final int pe7Base64

pe78Bit

public static final int pe78Bit

pe7Binary

public static final int pe7Binary
Constructor Detail

Mime

public Mime()
Method Detail

getAction

public int getAction()
Controls the operation of MIME component. Setting the Action property to a valid action code makes the control perform the associated action. If the action completes successfully, execution continues normally, and Action is reset to 0 (Idle). If an error happens, then an IPWorksException exception is raised.

The following are the possible values for the Action property and the corresponding descriptions:

mimeIdle (0)
Default.
mimeDecodeFromFile (1)
Decodes the data file given in Message and optionally MessageHeaders and fills out the PartCount , property and the array properties PartSize , PartContentType , PartContentTypeAttr , PartEncoding , PartName , PartHeaders , for each decoded part from 0 to PartCount -1. For each part you may get the content out of PartDecodedString or PartDecodedFile property. The decoded data will be held in PartDecodedString or otherwise saved in a temporary file given by PartDecodedFile when the user asks for the value of the respective property.
mimeDecodeFromString (2)
Same as a_DecodeFromFile but now the Message denotes the real encoded message rather than a filename.
mimeEncodeToFile (3)
Encode the data given in either PartDecodedFile or PartDecodedString into a MIME message at Message and MessageHeaders using the values optionally given in PartContentType , PartContentTypeAttr , PartEncoding , PartName , PartHeaders . To encode several objects into a MIME envelope, the user should first clear any old values left in the Part- properties and then assign values for all the indices starting with 1. The control will check for each index first the PartDecodedFile and then PartDecodedString for the data to encode. The encoded message will be saved in the file pointed by Message ; the message headers will be held by MessageHeaders .
mimeEncodeToString (4)
Same as a_EncodeToFile but the encoded data is hold in the Message property rather than saved to a file.
mimeReset (5)
Resets the values of all headers and Part- properties. It is an easy way to reset the control's properties before starting to populate the Part- properties with new values.


setAction

public void setAction(int action)
               throws IPWorksException
Controls the operation of MIME component. Setting the Action property to a valid action code makes the control perform the associated action. If the action completes successfully, execution continues normally, and Action is reset to 0 (Idle). If an error happens, then an IPWorksException exception is raised.

The following are the possible values for the Action property and the corresponding descriptions:

mimeIdle (0)
Default.
mimeDecodeFromFile (1)
Decodes the data file given in Message and optionally MessageHeaders and fills out the PartCount , property and the array properties PartSize , PartContentType , PartContentTypeAttr , PartEncoding , PartName , PartHeaders , for each decoded part from 0 to PartCount -1. For each part you may get the content out of PartDecodedString or PartDecodedFile property. The decoded data will be held in PartDecodedString or otherwise saved in a temporary file given by PartDecodedFile when the user asks for the value of the respective property.
mimeDecodeFromString (2)
Same as a_DecodeFromFile but now the Message denotes the real encoded message rather than a filename.
mimeEncodeToFile (3)
Encode the data given in either PartDecodedFile or PartDecodedString into a MIME message at Message and MessageHeaders using the values optionally given in PartContentType , PartContentTypeAttr , PartEncoding , PartName , PartHeaders . To encode several objects into a MIME envelope, the user should first clear any old values left in the Part- properties and then assign values for all the indices starting with 1. The control will check for each index first the PartDecodedFile and then PartDecodedString for the data to encode. The encoded message will be saved in the file pointed by Message ; the message headers will be held by MessageHeaders .
mimeEncodeToString (4)
Same as a_EncodeToFile but the encoded data is hold in the Message property rather than saved to a file.
mimeReset (5)
Resets the values of all headers and Part- properties. It is an easy way to reset the control's properties before starting to populate the Part- properties with new values.


getBoundary

public java.lang.String getBoundary()
The boundary separating the MIME parts. Maximum length of 80. The control will generate it during encoding if no value is given. During decoding it is filled out with the actual value.

The control will truncate any string longer than 80 if assigned to Boundary .


setBoundary

public void setBoundary(java.lang.String boundary)
                 throws IPWorksException
The boundary separating the MIME parts. Maximum length of 80. The control will generate it during encoding if no value is given. During decoding it is filled out with the actual value.

The control will truncate any string longer than 80 if assigned to Boundary .


getContentType

public java.lang.String getContentType()
The value of the content-type header of the message which was encoded/decoded. The control filters it out from the MessageHeaders . It shows the user about the type of the parts and their relation to each other.

The content-type attributes such as filename, boundary, charset etc are held in the ContentTypeAttr property.


setContentType

public void setContentType(java.lang.String contentType)
                    throws IPWorksException
The value of the content-type header of the message which was encoded/decoded. The control filters it out from the MessageHeaders . It shows the user about the type of the parts and their relation to each other.

The content-type attributes such as filename, boundary, charset etc are held in the ContentTypeAttr property.


getContentTypeAttr

public java.lang.String getContentTypeAttr()
The attributes for content-type header of the message which was encoded/decoded. The content-type attributes such as filename, boundary, charset etc are held in the ContentTypeAttr property. Its values and semantics on those of ContentType .


setContentTypeAttr

public void setContentTypeAttr(java.lang.String contentTypeAttr)
                        throws IPWorksException
The attributes for content-type header of the message which was encoded/decoded. The content-type attributes such as filename, boundary, charset etc are held in the ContentTypeAttr property. Its values and semantics on those of ContentType .


getMessage

public byte[] getMessage()
Filename holding the encoded message or the encoded message itself. The control fills out Message with the message body and MessageHeaders during encoding. The user may assign both the headers and the body to Message and leave MessageHeaders empty before decoding.


setMessage

public void setMessage(byte[] message)
                throws IPWorksException
Filename holding the encoded message or the encoded message itself. The control fills out Message with the message body and MessageHeaders during encoding. The user may assign both the headers and the body to Message and leave MessageHeaders empty before decoding.


getMessageHeaders

public java.lang.String getMessageHeaders()
The headers of the MIME message. The control fills out MessageHeaders upon encoding. The user should use them as additional headers when emailing the Message .

During decoding, if MessageHeaders is empty, the control will try to find the headers in the begining of the Message and will fill out MessageHeaders property accordingly.


setMessageHeaders

public void setMessageHeaders(java.lang.String messageHeaders)
                       throws IPWorksException
The headers of the MIME message. The control fills out MessageHeaders upon encoding. The user should use them as additional headers when emailing the Message .

During decoding, if MessageHeaders is empty, the control will try to find the headers in the begining of the Message and will fill out MessageHeaders property accordingly.


getPartContentDisposition

public java.lang.String getPartContentDisposition(int partIdx)
                                           throws IPWorksException
Content Disposition for each part 0 to PartCount -1. This value is used in the Content-Disposition header. Typical values include "form-data", "attachment" etc. The control fills it out each time the PartDecodedFile property is changed. Changing PartContentDisposition recalculates the PartHeaders property as well.

A valid PartIdx is 0 to PartCount -1.


setPartContentDisposition

public void setPartContentDisposition(int partIdx,
                                      java.lang.String partContentDisposition)
                               throws IPWorksException
Content Disposition for each part 0 to PartCount -1. This value is used in the Content-Disposition header. Typical values include "form-data", "attachment" etc. The control fills it out each time the PartDecodedFile property is changed. Changing PartContentDisposition recalculates the PartHeaders property as well.

A valid PartIdx is 0 to PartCount -1.


getPartContentDispositionAttr

public java.lang.String getPartContentDispositionAttr(int partIdx)
                                               throws IPWorksException
Array holding the content disposition's attributes, if any, for each part, numbered 0 to PartCount -1. Typical values for PartContentDispositionAttr are the names of the form-variables while creating an HTTP post, values for filenames etc.

Setting this property recalculates the PartHeaders property.

A valid PartIdx is 0 to PartCount -1.


setPartContentDispositionAttr

public void setPartContentDispositionAttr(int partIdx,
                                          java.lang.String partContentDispositionAttr)
                                   throws IPWorksException
Array holding the content disposition's attributes, if any, for each part, numbered 0 to PartCount -1. Typical values for PartContentDispositionAttr are the names of the form-variables while creating an HTTP post, values for filenames etc.

Setting this property recalculates the PartHeaders property.

A valid PartIdx is 0 to PartCount -1.


getPartContentId

public java.lang.String getPartContentId(int partIdx)
                                  throws IPWorksException
Content type for each part 0 to PartCount -1. This value is used in the Content-Id header. The control fills it out each time the PartDecodedFile property is changed. Changing PartContentId recalculates the PartHeaders property as well.

A valid PartIdx is 0 to PartCount -1.


setPartContentId

public void setPartContentId(int partIdx,
                             java.lang.String partContentId)
                      throws IPWorksException
Content type for each part 0 to PartCount -1. This value is used in the Content-Id header. The control fills it out each time the PartDecodedFile property is changed. Changing PartContentId recalculates the PartHeaders property as well.

A valid PartIdx is 0 to PartCount -1.


getPartContentType

public java.lang.String getPartContentType(int partIdx)
                                    throws IPWorksException
Content type for each part 0 to PartCount -1. This value is used in the Content-Type header. Typical values include "image/gif", "text/plain" etc. The control fills it out each time the PartDecodedFile property is changed. Changing PartContentType recalculates the PartHeaders property as well.

A valid PartIdx is 0 to PartCount -1.


setPartContentType

public void setPartContentType(int partIdx,
                               java.lang.String partContentType)
                        throws IPWorksException
Content type for each part 0 to PartCount -1. This value is used in the Content-Type header. Typical values include "image/gif", "text/plain" etc. The control fills it out each time the PartDecodedFile property is changed. Changing PartContentType recalculates the PartHeaders property as well.

A valid PartIdx is 0 to PartCount -1.


getPartContentTypeAttr

public java.lang.String getPartContentTypeAttr(int partIdx)
                                        throws IPWorksException
Array holding the content type attributes, if any, for each part, numbered 0 to PartCount -1. Setting this property recalculates the PartHeaders property.

A valid PartIdx is 0 to PartCount -1.


setPartContentTypeAttr

public void setPartContentTypeAttr(int partIdx,
                                   java.lang.String partContentTypeAttr)
                            throws IPWorksException
Array holding the content type attributes, if any, for each part, numbered 0 to PartCount -1. Setting this property recalculates the PartHeaders property.

A valid PartIdx is 0 to PartCount -1.


getPartCount

public int getPartCount()
The number of MIME parts in the encoded message. The control fills out PartCount during decoding with the number of parts in the Message . All the Part- properties have valid indexes 0 to PartCount -1. The user may set PartCount before encoding to the number of parts she wants the control to encode.


setPartCount

public void setPartCount(int partCount)
                  throws IPWorksException
The number of MIME parts in the encoded message. The control fills out PartCount during decoding with the number of parts in the Message . All the Part- properties have valid indexes 0 to PartCount -1. The user may set PartCount before encoding to the number of parts she wants the control to encode.


getPartDecodedFile

public java.lang.String getPartDecodedFile(int partIdx)
                                    throws IPWorksException
Array holding the filenames with the decoded data numbered 0 to PartCount -1. Accessing PartDecodedFile for the first time after setting Action to decode directs the control to actually decode the part and save the data in a temporary file. The user is responsible for deleting the temporary file.

Setting a value to PartDecodedFile directs the component to calculate the file size and fill out the respective PartSize property.

Valid PartIdx values are 0 to PartCount -1.


setPartDecodedFile

public void setPartDecodedFile(int partIdx,
                               java.lang.String partDecodedFile)
                        throws IPWorksException
Array holding the filenames with the decoded data numbered 0 to PartCount -1. Accessing PartDecodedFile for the first time after setting Action to decode directs the control to actually decode the part and save the data in a temporary file. The user is responsible for deleting the temporary file.

Setting a value to PartDecodedFile directs the component to calculate the file size and fill out the respective PartSize property.

Valid PartIdx values are 0 to PartCount -1.


getPartDecodedString

public byte[] getPartDecodedString(int partIdx)
                            throws IPWorksException
Array property. It holds the actual content of each part, numbered 0 to PartCount -1. The control decodes the actual part of Message to PartDecodedString property when PartDecodedString 's value is first queried.

Setting a value to PartDecodedString fills out the PartSize property with the string size if PartDecodedFile is empty. The control checks during encoding first PartDecodedFile : if it is empty then the control uses the value of PartDecodedString .

A valid PartIdx is 0 to PartCount -1.


setPartDecodedString

public void setPartDecodedString(int partIdx,
                                 byte[] partDecodedString)
                          throws IPWorksException
Array property. It holds the actual content of each part, numbered 0 to PartCount -1. The control decodes the actual part of Message to PartDecodedString property when PartDecodedString 's value is first queried.

Setting a value to PartDecodedString fills out the PartSize property with the string size if PartDecodedFile is empty. The control checks during encoding first PartDecodedFile : if it is empty then the control uses the value of PartDecodedString .

A valid PartIdx is 0 to PartCount -1.


getPartEncoding

public int getPartEncoding(int partIdx)
                    throws IPWorksException
The actual content encoding type for each part 0 to PartCount -1. PartEncoding determines how to encode the data or how they were actually encoded in the Message as specified in the Content-Transfer-Encoding header.

A valid PartIdx is 0 to PartCount -1.

Possible values for PartEncoding are:

pe7bit (0)
7 Bit data, no encoding.
peQuotedPrintable (1)
Quoted-Printable encoding of (typically) text.
peBase64 (2)
Base64 encoding of binary data.
pe8Bit (3)
No encoding, 8 Bit charapers may be contained as well.
peBinary (4)
Binary data without any encoding. Similar to 3 (8 Bit encoding).


setPartEncoding

public void setPartEncoding(int partIdx,
                            int partEncoding)
                     throws IPWorksException
The actual content encoding type for each part 0 to PartCount -1. PartEncoding determines how to encode the data or how they were actually encoded in the Message as specified in the Content-Transfer-Encoding header.

A valid PartIdx is 0 to PartCount -1.

Possible values for PartEncoding are:

pe7bit (0)
7 Bit data, no encoding.
peQuotedPrintable (1)
Quoted-Printable encoding of (typically) text.
peBase64 (2)
Base64 encoding of binary data.
pe8Bit (3)
No encoding, 8 Bit charapers may be contained as well.
peBinary (4)
Binary data without any encoding. Similar to 3 (8 Bit encoding).


getPartFilename

public java.lang.String getPartFilename(int partIdx)
                                 throws IPWorksException
The filename attribute specified in the headers of the part. Changing the value of PartDecodedFile sets automatically the PartFilename and consequently the PartHeaders property for the same PartIdx .

A valid PartIdx is 0 to PartCount -1.


setPartFilename

public void setPartFilename(int partIdx,
                            java.lang.String partFilename)
                     throws IPWorksException
The filename attribute specified in the headers of the part. Changing the value of PartDecodedFile sets automatically the PartFilename and consequently the PartHeaders property for the same PartIdx .

A valid PartIdx is 0 to PartCount -1.


getPartHeaders

public java.lang.String getPartHeaders(int partIdx)
                                throws IPWorksException
Headers for each MIME part, numbered 0 to PartCount -1. The control fills out PartHeaders each time any of the other Part- properties for that PartIdx is changed. If additional headers are needed they should be appended after all the other Part- properties for that PartIdx are set.

Valid PartIdx values are 0 to PartCount -1.


setPartHeaders

public void setPartHeaders(int partIdx,
                           java.lang.String partHeaders)
                    throws IPWorksException
Headers for each MIME part, numbered 0 to PartCount -1. The control fills out PartHeaders each time any of the other Part- properties for that PartIdx is changed. If additional headers are needed they should be appended after all the other Part- properties for that PartIdx are set.

Valid PartIdx values are 0 to PartCount -1.


getPartName

public java.lang.String getPartName(int partIdx)
                             throws IPWorksException
The name given to a part, such as the filename. Changing the value of PartDecodedFile sets automatically the PartName and consequently the PartHeaders property for the same PartIdx .

A valid PartIdx is 0 to PartCount -1.


setPartName

public void setPartName(int partIdx,
                        java.lang.String partName)
                 throws IPWorksException
The name given to a part, such as the filename. Changing the value of PartDecodedFile sets automatically the PartName and consequently the PartHeaders property for the same PartIdx .

A valid PartIdx is 0 to PartCount -1.


getPartSize

public int getPartSize(int partIdx)
                throws IPWorksException
The size of each PartDecodedFile or PartDecodedString . If a non empty value is assigned to PartDecodedFile then control fills out PartSize of the same PartIdx with the file size or an error occurrs if the file doesn't exist. If PartDecodedFile is empty and a value is assigned to PartDecodedString then PartSize will be equal to the string's size.

During decoding the PartSize is filled with the size of each part as soon as Action is set to decode.


fireProgress

public void fireProgress(int percentDone)
Shows the progress of decoding/encoding the input data. (Called internally to dispatch the event.)
See Also:
MimeProgressEvent

decodeFromFile

public void decodeFromFile()
                    throws IPWorksException
Decode From File. Decodes the data file given in Message and optionally MessageHeaders and fills out the PartCount , property and the array properties PartSize , PartContentType , PartContentTypeAttr , PartEncoding , PartName , PartHeaders , for each decoded part from 0 to PartCount -1. For each part you may get the content out of PartDecodedString or PartDecodedFile property. The decoded data will be held in PartDecodedString or otherwise saved in a temporary file given by PartDecodedFile when the user asks for the value of the respective property.

Calling this method is equivalent to setting the Action property to mimeDecodeFromFile .


decodeFromString

public void decodeFromString()
                      throws IPWorksException
Decode From String. Same as a_DecodeFromFile but now the Message denotes the real encoded message rather than a filename.

Calling this method is equivalent to setting the Action property to mimeDecodeFromString .


encodeToFile

public void encodeToFile()
                  throws IPWorksException
Encode To File. Encode the data given in either PartDecodedFile or PartDecodedString into a MIME message at Message and MessageHeaders using the values optionally given in PartContentType , PartContentTypeAttr , PartEncoding , PartName , PartHeaders . To encode several objects into a MIME envelope, the user should first clear any old values left in the Part- properties and then assign values for all the indices starting with 1. The control will check for each index first the PartDecodedFile and then PartDecodedString for the data to encode. The encoded message will be saved in the file pointed by Message ; the message headers will be held by MessageHeaders .

Calling this method is equivalent to setting the Action property to mimeEncodeToFile .


encodeToString

public void encodeToString()
                    throws IPWorksException
Encode To String. Same as a_EncodeToFile but the encoded data is hold in the Message property rather than saved to a file.

Calling this method is equivalent to setting the Action property to mimeEncodeToString .


resetData

public void resetData()
               throws IPWorksException
Resets the values of all headers and Part- properties. Resets the values of all headers and Part- properties. It is an easy way to reset the control's properties before starting to populate the Part- properties with new values.

Calling this method is equivalent to setting the Action property to mimeResetData .


addMimeEventListener

public void addMimeEventListener(MimeEventListener l)
                          throws java.util.TooManyListenersException

removeMimeEventListener

public void removeMimeEventListener(MimeEventListener l)

IP*Works!

Copyright (c) 2001 /n software inc. - All rights reserved.