net.sourceforge.jwap.wsp.multipart
Class MultiPartEntry

java.lang.Object
  |
  +--net.sourceforge.jwap.wsp.multipart.MultiPartEntry

public class MultiPartEntry
extends java.lang.Object

This class represents a Multipart Entry according to WAP-230-WSP.

Author:
Michel Marti

Constructor Summary
MultiPartEntry(java.lang.String contentType, byte[] data)
          Construct a Multipart Entry using the WAP codepage for header encoding.
MultiPartEntry(java.lang.String contentType, CodePage codePage, byte[] data)
          Construct a Multipart Entry.
 
Method Summary
 void addHeader(java.lang.String key, java.lang.String value)
          Add a header to the Multipart Entry.
 byte[] getBytes()
           
 java.lang.String getContentType()
           
 java.lang.String getHeader(java.lang.String key)
           
 java.util.Enumeration getHeaderNames()
           
 java.util.Enumeration getHeaders(java.lang.String key)
           
 byte[] getPayload()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MultiPartEntry

public MultiPartEntry(java.lang.String contentType,
                      CodePage codePage,
                      byte[] data)
Construct a Multipart Entry.
Parameters:
contentType - the content-type of the Multipart Entry
codePage - the codepage to use for header encoding or null to use the default (WAP) codepage
data - the payload

MultiPartEntry

public MultiPartEntry(java.lang.String contentType,
                      byte[] data)
Construct a Multipart Entry using the WAP codepage for header encoding.
Parameters:
contentType - the content-type of the Multipart Entry
data - the payload
Method Detail

addHeader

public void addHeader(java.lang.String key,
                      java.lang.String value)
Add a header to the Multipart Entry.
Parameters:
key - the header name
value - the header value

getHeaderNames

public java.util.Enumeration getHeaderNames()

getHeader

public java.lang.String getHeader(java.lang.String key)

getHeaders

public java.util.Enumeration getHeaders(java.lang.String key)

getContentType

public java.lang.String getContentType()

getPayload

public byte[] getPayload()

getBytes

public byte[] getBytes()
                throws java.io.IOException,
                       HeaderParseException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object