com.objectxp.mms.message
Class MMSMessage

java.lang.Object
  extended bycom.objectxp.mms.message.MMSMessage
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
SMILMessage

public class MMSMessage
extends java.lang.Object
implements java.io.Serializable

The MMSMessage class represents a Multimedia Message without a presentation definition. A device who receives this Message will decide how and in which order the MMSMessagePart are displayed. Use the subclass SMILMessage if you want to define the presentation with SMIL.

Example:

    MMSMessage msg = new MMSMessage();
    // add a image
    msg.addMessagePart(new Image(new FileInputStream("ocean.jpg"), "sun.jpg", "image/jpeg"));
    // add a text
    msg.addMessagePart(new Text("dive deep"));
    // add binary data
    msg.addMessagePart(new GenericMessagePart("application/octet-stream", new byte[]{...., 0x01, 0x02, 0x03, 0x04, 0x05,....}));
    // add destination address
    msg.addTO(new MMSAddress(MMSAddress.TYPE_PLMN, "0785555555"));
    // add subject (optional)
    msg.setSubject("My first MMS");
 

See Also:
Serialized Form

Field Summary
static java.lang.String CLASS_ADVERTISEMENT
          Message class: Advertisement
static java.lang.String CLASS_AUTO
          Message class: Auto
static java.lang.String CLASS_INFORMATIONAL
          Message class: Informational
static java.lang.String CLASS_PERSONAL
          Message class: Personal
static java.lang.String CONTENT_TYPE_MIXED
          Content-Type: application/vnd.wap.multipart.mixed
static java.lang.String CONTENT_TYPE_RELATED
          Content-Type: application/vnd.wap.multipart.related
static java.lang.String PRIORITY_HIGH
          Priority: High
static java.lang.String PRIORITY_LOW
          Priority: Low
static java.lang.String PRIORITY_NORMAL
          Priority: Normal
static java.lang.String VERSION_1_0
          MMS Version 1.0
static java.lang.String VERSION_1_1
          MMS Version 1.1
static java.lang.String VERSION_1_2
          MMS Version 1.2
static java.lang.String VERSION_1_3
          MMS Version 1.3
 
Constructor Summary
MMSMessage()
           
 
Method Summary
 void addBCC(MMSAddress address)
          Add an address to the list of 'BCC' (blind carbon-copy) addresses.
 void addCC(MMSAddress address)
          Add an address to the list of 'CC' (carbon-copy) addresses.
 void addMessagePart(MMSMessagePart part)
          Add a message part to this message.
 void addTO(MMSAddress address)
          Add an address to the list of 'TO' addresses.
 boolean containsHeader(java.lang.String name)
          Returns a boolean indicating whether the named MMS header has already been set.
 void export(java.lang.String directory)
          Export the content of this MMS message to the given directory.
 java.lang.Boolean getAdaptationAllowed()
          Determine if content adaptation is allowed.
 java.lang.String getApplicationId()
          Get the ID of the destination application.
 java.lang.String getAuxApplicationInfo()
          Get the auxiliary application Information.
 java.util.Iterator getBCC()
          Get an Iterator over all recipients in the 'BCC' list.
 java.util.Iterator getCC()
          Get an Iterator over all recipients in the 'CC' list.
 ContentClass getContentClass()
          Get the content class of this message.
 java.lang.String getContentType()
          Returns the MIME content-type for this message.
 java.util.Date getDeliveryDate()
          Get the Date/Time of desired delivery.
 boolean getDeliveryReport()
          Specifies whether the originator MMS Client requests a delivery report from each recipient.
 java.lang.Boolean getDRMContent()
          Get the DRM indication for this message.
 java.util.Date getExpiryDate()
          Get the Date/Time until the MMS Message will be stored in the MMSC.
 MMSAddress getFrom()
          Get the address of the originator MMS Client.
 java.lang.String getHeader(java.lang.String name)
          Returns the value of the specified MMS header as a String.
 java.util.Enumeration getHeaderNames()
          Returns an enumeration of all the header names this message contains.
 java.lang.String getMessageClass()
          Get the message class.
 java.lang.String getMessageId()
          This is an unique reference assigned to the MMSMessage.
 java.util.List getMessageParts()
          Get a list of message parts for this message.
 java.lang.String getPriority()
          Get the priority of the MMS message assigned by the originator MMS Client.
 boolean getReadReport()
          Specifies whether the originator MMS Client wants a read report from each recipient.
 java.lang.String getReplyApplicationId()
          Get the ID of the application to which replies, delivery reports and read reports are addressed.
 ReplyCharging getReplyCharging()
          Get the Reply Charging field for this message.
 java.util.Date getReplyChargingDeadLine()
          Get the reply charging deadline.
 java.lang.String getReplyChargingId()
          The reply charging ID is only present if the MMSMessage is a reply to a offering MMSMessage which had set the reply charging field set to ReplyCharging.ACCEPTED or ReplyCharging.ACCEPTED_TEXT_ONLY.
 int getReplyChargingSize()
          Get the reply charging size.
 java.lang.String getSubject()
          Get the subject of the MMS message.
 java.util.Date getSubmissionDate()
          Get the Date/Time of submission of the MMSMessage.
 java.util.Iterator getTO()
          Get an Iterator over all recipients in the 'TO' list.
 java.lang.String getTransactionId()
          Get the unique Transaction Identifier for this Message.
 java.lang.String getVersion()
          Get the MMS version for this message.
 boolean isSenderVisible()
          Returns true if the sender address is visible to the recipient, false otherwise.
static MMSMessage parseMMSEncoding(byte[] mmsenc)
          Deprecated. use MM1Service.parseMMSEncoding(byte[]) instead.
static MMSMessage parseMMSEncoding(java.io.InputStream in)
          Deprecated. use MM1Service.parseMMSEncoding(InputStream) instead.
 boolean removeBCC(MMSAddress address)
          Removes the given address from the list of 'BCC' addresses.
 boolean removeCC(MMSAddress address)
          Removes the given address from the list of 'CC' addresses.
 boolean removeTO(MMSAddress address)
          Removes the given address from the list of 'TO' addresses.
 void setAdaptationAllowed(java.lang.Boolean adaptions)
          Indicate if the VASP allows adaptation of the content.
 void setApplicationId(java.lang.String id)
          Set the ID of the destination application.
 void setAuxApplicationInfo(java.lang.String info)
          Set the auxiliary application Information.
 void setContentClass(ContentClass contentClass)
          Sets the content class of this message.
 void setContentType(java.lang.String contentType)
          Set the content type for this MMS message.
 void setDeliveryDate(java.util.Date date)
          Set the time of desired delivery.
 void setDeliveryReport(boolean report)
          Specifies whether the originator MMS Client requests a delivery report from each recipient.
 void setDRMContent(java.lang.Boolean drm)
          Indicate if the message contains DRM-protected content.
 void setExpiryDate(java.util.Date date)
          Length of time the message will be stored in MMSC or time to delete the message.
 void setFrom(MMSAddress address)
          Set the address of the originator MMS Client.
 void setHeader(java.lang.String name, java.lang.String value)
          Sets an additional MMS header with the given name and value.
 void setMessageClass(java.lang.String msgClass)
          Set the message class.
 void setMessageId(java.lang.String string)
          Set the message ID.
 void setPriority(java.lang.String prio)
          Priority of the MMS message assigned by the originator MMS Client.
 void setReadReport(boolean report)
          Specifies whether the originator MMS Client requests a read report from each recipient.
 void setReplyApplicationId(java.lang.String id)
          Set the ID of the application to which replies, delivery reports and read reports are addressed.
 void setReplyCharging(ReplyCharging type)
          Reply Charging should only be set if the originator is willing to pay for the Reply-message of the recipient(s).
 void setReplyChargingDeadLine(java.util.Date deadline)
          The reply charging deadline specifies the latest time of the recipient(s) to submit the Reply-message.
 void setReplyChargingId(java.lang.String id)
          The reply charging ID field shall be the same as the Message ID of the original message that is replied to.
 void setReplyChargingSize(int octets)
          The reply charging size field shall not be present if the reply charging field is not present.
 void setSenderVisibility(boolean visible)
          Show address/phone number of the originator MMS Client to the recipient unless the former has a secret number/address.
 void setSubject(java.lang.String subject)
          Subject of the MMSMessage
 void setSubmissionDate(java.util.Date date)
          Set the Date and time of submission of the MMSMessage.
 void setTransactionId(java.lang.String transactionId)
          Unique Transaction Identifier.
 void setVersion(java.lang.String version)
          Set the MMS version to use.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONTENT_TYPE_MIXED

public static final java.lang.String CONTENT_TYPE_MIXED
Content-Type: application/vnd.wap.multipart.mixed

See Also:
Constant Field Values

CONTENT_TYPE_RELATED

public static final java.lang.String CONTENT_TYPE_RELATED
Content-Type: application/vnd.wap.multipart.related

See Also:
Constant Field Values

CLASS_PERSONAL

public static final java.lang.String CLASS_PERSONAL
Message class: Personal

See Also:
Constant Field Values

CLASS_ADVERTISEMENT

public static final java.lang.String CLASS_ADVERTISEMENT
Message class: Advertisement

See Also:
Constant Field Values

CLASS_INFORMATIONAL

public static final java.lang.String CLASS_INFORMATIONAL
Message class: Informational

See Also:
Constant Field Values

CLASS_AUTO

public static final java.lang.String CLASS_AUTO
Message class: Auto

See Also:
Constant Field Values

PRIORITY_LOW

public static final java.lang.String PRIORITY_LOW
Priority: Low

See Also:
Constant Field Values

PRIORITY_NORMAL

public static final java.lang.String PRIORITY_NORMAL
Priority: Normal

See Also:
Constant Field Values

PRIORITY_HIGH

public static final java.lang.String PRIORITY_HIGH
Priority: High

See Also:
Constant Field Values

VERSION_1_0

public static final java.lang.String VERSION_1_0
MMS Version 1.0

See Also:
Constant Field Values

VERSION_1_1

public static final java.lang.String VERSION_1_1
MMS Version 1.1

See Also:
Constant Field Values

VERSION_1_2

public static final java.lang.String VERSION_1_2
MMS Version 1.2

See Also:
Constant Field Values

VERSION_1_3

public static final java.lang.String VERSION_1_3
MMS Version 1.3

See Also:
Constant Field Values
Constructor Detail

MMSMessage

public MMSMessage()
Method Detail

setTransactionId

public void setTransactionId(java.lang.String transactionId)
Unique Transaction Identifier. This ID identifies the MMSMessage and the corresponding reply. For outgoing messages that have no Transaction ID set, jSMS will generate a unique ID.

Parameters:
transactionId - the Transaction ID or null if unset.

getTransactionId

public java.lang.String getTransactionId()
Get the unique Transaction Identifier for this Message.

Returns:
the Transaction ID or null if unset.

setVersion

public void setVersion(java.lang.String version)
                throws java.lang.IllegalArgumentException
Set the MMS version to use. Allowed values:

If the MMS version is unset, jSMS will use the MMS version configured in your initialization properties. If no version is configured, it defaults to VERSION_1_1

Please note that for outgoing messages, attributes not supported by the specified protocol version are silently ignored. E.g. when using MMS version 1.2, the attribute contentclass will be ignored since its only available for MMS version 1.3.

Parameters:
version - the MMS version or null to clear it.
Throws:
java.lang.IllegalArgumentException - if the specified version is unknown.
Since:
jSMS 2.2

getVersion

public java.lang.String getVersion()
Get the MMS version for this message.

Returns:
the MMS version or null if unset.

setMessageId

public void setMessageId(java.lang.String string)
Set the message ID. Please notice that setting the Message ID for outgoing messages has no effect since the MMSC overrides this ID.

Parameters:
string - the message ID.

getMessageId

public java.lang.String getMessageId()
This is an unique reference assigned to the MMSMessage. The ID enables an MMS Client to match read report PDUs or Reply-MMs with previously sent or forwarded MMSMessages.

Returns:
the MessageId

setSubmissionDate

public void setSubmissionDate(java.util.Date date)
Set the Date and time of submission of the MMSMessage.

If the field is not provided by the sending MMS Client, the MMSC shall insert the time of arrival of the MMSMessage at the MMSC.

Parameters:
date - the submission date or null.

getSubmissionDate

public java.util.Date getSubmissionDate()
Get the Date/Time of submission of the MMSMessage.

If the field was not provided by the sending MMS Client, the MMSC shall insert the time of arrival of the MMSMessage at the MMSC.

Returns:
the date of submission.

setFrom

public void setFrom(MMSAddress address)
Set the address of the originator MMS Client. If the Sender is not set, the MMSC will insert the correct address of the originator MMS Client.

Parameters:
address - of the sender or null.

getFrom

public MMSAddress getFrom()
Get the address of the originator MMS Client.

Returns:
the originator address.

addTO

public void addTO(MMSAddress address)
Add an address to the list of 'TO' addresses.

At least one TO/CC/BCC recipient must be set to deliver a MMS.

Parameters:
address - the address of the recipient.
See Also:
addCC(MMSAddress), addBCC(MMSAddress)

getTO

public java.util.Iterator getTO()
Get an Iterator over all recipients in the 'TO' list.

Returns:
an Iterator over MMSAddress objects.

removeTO

public boolean removeTO(MMSAddress address)
Removes the given address from the list of 'TO' addresses.

Returns:
true if the given address has been removed.

addCC

public void addCC(MMSAddress address)
Add an address to the list of 'CC' (carbon-copy) addresses.

At least one TO/CC/BCC recipient must be set to deliver a MMS.

Parameters:
address - the address of the recipient.
See Also:
addTO(MMSAddress), addBCC(MMSAddress)

removeCC

public boolean removeCC(MMSAddress address)
Removes the given address from the list of 'CC' addresses.

Returns:
true if the given address has been removed.

getCC

public java.util.Iterator getCC()
Get an Iterator over all recipients in the 'CC' list.

Returns:
an Iterator over MMSAddress objects.

addBCC

public void addBCC(MMSAddress address)
Add an address to the list of 'BCC' (blind carbon-copy) addresses.

At least one TO/CC/BCC recipient must be set to deliver a MMS.

Parameters:
address - the address of the recipient.
See Also:
addTO(MMSAddress), addCC(MMSAddress)

getBCC

public java.util.Iterator getBCC()
Get an Iterator over all recipients in the 'BCC' list.

Returns:
an Iterator over MMSAddress objects.

removeBCC

public boolean removeBCC(MMSAddress address)
Removes the given address from the list of 'BCC' addresses.

Returns:
true if the given address has been removed.

setSubject

public void setSubject(java.lang.String subject)
Subject of the MMSMessage

Parameters:
subject -

getSubject

public java.lang.String getSubject()
Get the subject of the MMS message.

Returns:
subject the subject of the message.

setMessageClass

public void setMessageClass(java.lang.String msgClass)
Set the message class. The following values are acceptable: Value CLASS_AUTO indicates a message that is automatically generated by the client and the originator client shall not request a Delivery-Report or Read-Report. If the message class is not set, the receiver interprets the message as CLASS_PERSONAL.

Parameters:
msgClass - the message class or null.

getMessageClass

public java.lang.String getMessageClass()
Get the message class.

Returns:
one of CLASS_PERSONAL, CLASS_ADVERTISEMENT, CLASS_INFORMATIONAL, CLASS_AUTO or null if unset.
See Also:
setMessageClass(String)

setExpiryDate

public void setExpiryDate(java.util.Date date)
Length of time the message will be stored in MMSC or time to delete the message.

Parameters:
date - of expiry or null.

getExpiryDate

public java.util.Date getExpiryDate()
Get the Date/Time until the MMS Message will be stored in the MMSC.

Returns:
the expiry date or null.

setDeliveryDate

public void setDeliveryDate(java.util.Date date)
Set the time of desired delivery. Indicates the earliest possible delivery of the MMS Message to the recipient. If unset, the message is delivered immediately.

Parameters:
date - of desired delivery or null for immediate delivery.

getDeliveryDate

public java.util.Date getDeliveryDate()
Get the Date/Time of desired delivery. Indicates the earliest possible delivery of the MMS message to the recipient.

Returns:
the date of desired delivery or null.

setPriority

public void setPriority(java.lang.String prio)
                 throws java.lang.IllegalArgumentException
Priority of the MMS message assigned by the originator MMS Client. If unset, defaults to PRIORITY_NORMAL.

Parameters:
prio - one of PRIORITY_LOW, PRIORITY_NORMAL, PRIORITY_HIGH or null.
Throws:
java.lang.IllegalArgumentException - if the priority is not one of PRIORITY_LOW, PRIORITY_NORMAL or PRIORITY_HIGH.

getPriority

public java.lang.String getPriority()
Get the priority of the MMS message assigned by the originator MMS Client.

Returns:
one of PRIORITY_LOW, PRIORITY_NORMAL, PRIORITY_HIGH or null.

setSenderVisibility

public void setSenderVisibility(boolean visible)
Show address/phone number of the originator MMS Client to the recipient unless the former has a secret number/address.

isSenderVisible

public boolean isSenderVisible()
Returns true if the sender address is visible to the recipient, false otherwise.

See Also:
setSenderVisibility(boolean)

setDeliveryReport

public void setDeliveryReport(boolean report)
Specifies whether the originator MMS Client requests a delivery report from each recipient. When getMessageClass() is "Auto", the field shall always be present and the value shall be false.

Parameters:
report - true if a delivery report is requested.

getDeliveryReport

public boolean getDeliveryReport()
Specifies whether the originator MMS Client requests a delivery report from each recipient.

Returns:
true if a delivery report is requested.

setReadReport

public void setReadReport(boolean report)
Specifies whether the originator MMS Client requests a read report from each recipient.

When getMessageClass() is set to "Auto", the field shall always be present and the value shall be false.

Parameters:
report - true if a read report is requested.

getReadReport

public boolean getReadReport()
Specifies whether the originator MMS Client wants a read report from each recipient.

Returns:
true if a read report is requested.

setReplyCharging

public void setReplyCharging(ReplyCharging type)
Reply Charging should only be set if the originator is willing to pay for the Reply-message of the recipient(s). For outgoing messages, only the values ReplyCharging.REQUESTED and ReplyCharging.REQUESTED_TEXT_ONLY are allowed.

The MMSC shall reject an MMSMessage that includes this field if it doesn't support reply-charging.

This attribute is available only with MMS version 1.1 or later.

Parameters:
type - the Reply Charging or null.

getReplyCharging

public ReplyCharging getReplyCharging()
Get the Reply Charging field for this message. This attribute is available only with MMS version 1.1 or later.

Returns:
the reply charging or null.
See Also:
setReplyCharging(ReplyCharging)

setReplyChargingDeadLine

public void setReplyChargingDeadLine(java.util.Date deadline)
The reply charging deadline specifies the latest time of the recipient(s) to submit the Reply-message. After this time the originator of the original message will not pay for the Reply-message any more.

The reply charging deadline should not be set if the reply charging field is not set.

This attribute is available only with MMS version 1.1 or later.

Parameters:
deadline - the deadline or null.

getReplyChargingDeadLine

public java.util.Date getReplyChargingDeadLine()
Get the reply charging deadline. This attribute is available only with MMS version 1.1 or later.

Returns:
the deadline or null.
See Also:
setReplyChargingDeadLine(Date)

setReplyChargingSize

public void setReplyChargingSize(int octets)
The reply charging size field shall not be present if the reply charging field is not present. It specifies the maximum size (number of octets) for the Reply-message. This attribute is available only with MMS version 1.1 or later.

Parameters:
octets - number of octets

getReplyChargingSize

public int getReplyChargingSize()
Get the reply charging size. This attribute is available only with MMS version 1.1 or later.

Returns:
the maximum size of the reply message.
See Also:
setReplyChargingSize(int)

setReplyChargingId

public void setReplyChargingId(java.lang.String id)
The reply charging ID field shall be the same as the Message ID of the original message that is replied to.

The reply charging ID shall only be present if this MMSMessage contains the Reply that was offered by the value 'accepted' or 'accepted text only' in the reply charging field of the Original-message received earlier and if the Reply-Charging limitations are met.

This attribute is available only with MMS version 1.1 or later.

Parameters:
id - the reply charging ID or null.

getReplyChargingId

public java.lang.String getReplyChargingId()
The reply charging ID is only present if the MMSMessage is a reply to a offering MMSMessage which had set the reply charging field set to ReplyCharging.ACCEPTED or ReplyCharging.ACCEPTED_TEXT_ONLY.

The value of this field shall be the same as the Message-ID of the original message that is replied to.

This attribute is available only with MMS version 1.1 or later.

Returns:
the Reply Charging ID or null.

getApplicationId

public java.lang.String getApplicationId()
Get the ID of the destination application. This attribute is available only with MMS version 1.3 or later.

Returns:
the ID or null.

setApplicationId

public void setApplicationId(java.lang.String id)
Set the ID of the destination application. This attribute is available only with MMS version 1.3 or later.

Parameters:
id - the application ID or null to clear the ID.

getReplyApplicationId

public java.lang.String getReplyApplicationId()
Get the ID of the application to which replies, delivery reports and read reports are addressed. This attribute is available only with MMS version 1.3 or later.

Returns:
the reply application ID or null.

setReplyApplicationId

public void setReplyApplicationId(java.lang.String id)
Set the ID of the application to which replies, delivery reports and read reports are addressed. This attribute is available only with MMS version 1.3 or later.

Parameters:
id - the reply application ID or null to clear the ID.

getAuxApplicationInfo

public java.lang.String getAuxApplicationInfo()
Get the auxiliary application Information. This information is for internal use of thedestination application. This attribute is available only with MMS version 1.3 or later.

Returns:
the auxiliary info or null.

setAuxApplicationInfo

public void setAuxApplicationInfo(java.lang.String info)
Set the auxiliary application Information. This information is for internal use of the destination application. This attribute is available only with MMS version 1.3 or later.

Parameters:
info - the auxiliary info or null to clear it.

getContentClass

public ContentClass getContentClass()
Get the content class of this message. This attribute is available only with MMS version 1.3 or later.

Returns:
the content class or null.

setContentClass

public void setContentClass(ContentClass contentClass)
Sets the content class of this message. This attribute is available only with MMS version 1.3 or later.

Parameters:
contentClass - the content class or null to clear it.

setDRMContent

public void setDRMContent(java.lang.Boolean drm)
Indicate if the message contains DRM-protected content. This attribute is available only with MMS version 1.3 or later.


getDRMContent

public java.lang.Boolean getDRMContent()
Get the DRM indication for this message. This attribute is available only with MMS version 1.3 or later.

Returns:
a Boolean value or null if unset.

setAdaptationAllowed

public void setAdaptationAllowed(java.lang.Boolean adaptions)
Indicate if the VASP allows adaptation of the content. This attribute is available only with MMS version 1.3 or later.


getAdaptationAllowed

public java.lang.Boolean getAdaptationAllowed()
Determine if content adaptation is allowed. This attribute is available only with MMS version 1.3 or later.

Returns:
a Boolean value or null if unset.

setContentType

public void setContentType(java.lang.String contentType)
                    throws java.lang.IllegalArgumentException
Set the content type for this MMS message. There are two supported content-types: Unless changed, the default content type is CONTENT_TYPE_MIXED.

Parameters:
contentType - the Content-Type.
Throws:
java.lang.IllegalArgumentException - if an unsupported content-type is set.
Since:
jSMS 2.2

getContentType

public java.lang.String getContentType()
Returns the MIME content-type for this message. The default content type is CONTENT_TYPE_MIXED.


addMessagePart

public void addMessagePart(MMSMessagePart part)
Add a message part to this message.

It is undefined in which order the parts of a message are presented on a mobile phone. If you want to have more control over the the presentation, use a SMILMessage instead.

Parameters:
part - the message part to be added.

getMessageParts

public java.util.List getMessageParts()
Get a list of message parts for this message.

Returns:
a list of MMSMessagePart objects.

parseMMSEncoding

public static MMSMessage parseMMSEncoding(byte[] mmsenc)
                                   throws ParseException
Deprecated. use MM1Service.parseMMSEncoding(byte[]) instead.

Construct a MMSMessage by parsing a byte array holding a MMS structure as specified in OMA-MMS-ENC v1.x.

Parameters:
mmsenc - byte array holding a MMS structure
Returns:
a MMS message
Throws:
ParseException - if the MMS structure cannot be converted.
Since:
jSMS 2.1

parseMMSEncoding

public static MMSMessage parseMMSEncoding(java.io.InputStream in)
                                   throws java.io.IOException,
                                          ParseException
Deprecated. use MM1Service.parseMMSEncoding(InputStream) instead.

Construct a MMSMessage by parsing an input stream returning a MMS structure as specified in OMA-MMS-ENC v1.x.

Parameters:
in - input stream returning MMS structure
Returns:
a MMS message
Throws:
ParseException - if the MMS structure cannot be converted.
java.io.IOException - if reading from the input stream fails.
Since:
jSMS 2.1

export

public void export(java.lang.String directory)
            throws java.io.IOException
Export the content of this MMS message to the given directory.

The MMS message-parts are stored according to their location-name. If the location is not set, they will be numbered.

Parameters:
directory - the directory where the message-parts are stored. If this directory does not exist, it will be created.
Throws:
java.io.IOException - if an I/O error occurs.

setHeader

public void setHeader(java.lang.String name,
                      java.lang.String value)
Sets an additional MMS header with the given name and value. If the header had already been set, the new value overwrites the previous one. The containsHeader(String) method can be used to test for the presence of a header before setting its value.

Trying to set a MMS Header (e.g. From) that also is accessible through a setter-method (e.g. setFrom(MMSAddress)) has no effect.

Parameters:
name - the name of the header.
value - the header value or null to remove the header.
See Also:
getHeader(String), getHeaderNames()

getHeader

public java.lang.String getHeader(java.lang.String name)
Returns the value of the specified MMS header as a String. If the message does not include a header of the specified name, this method returns null. The header name is case insensitive.

Parameters:
name - a String specifying the header name.
Returns:
a String containing the value of the requested header, or null if the message does not have a header of that name.

containsHeader

public boolean containsHeader(java.lang.String name)
Returns a boolean indicating whether the named MMS header has already been set.

Parameters:
name - the header name.
Returns:
true if the named header has already been set, false otherwise.
Since:
jSMS 2.2

getHeaderNames

public java.util.Enumeration getHeaderNames()
Returns an enumeration of all the header names this message contains. If the request has no headers, this method returns an empty enumeration.

Returns:
an enumeration of all the header names for this message; if the message has no headers, an empty enumeration.

toString

public java.lang.String toString()


object XP, Inc. © 2000-2007. All rights reserved object XP