com.ibm.wbi.protocol.http
Class ParseMime

java.lang.Object
  |
  +--com.ibm.wbi.protocol.http.ParseMime

public final class ParseMime
extends java.lang.Object

A ParseMime object is used to parse and manipulate HTTP MIME data.


Field Summary
static java.lang.String COPYRIGHT
           
 
Constructor Summary
ParseMime(java.lang.String s)
          Given a string containing MIME data, this constructor creates a new ParseMime object and initializes it with the given MIME data.
 
Method Summary
 void clearAllByKey(java.lang.String key)
          Given a key this method clears all values associated with this key.
 java.util.Vector getAllByKey(java.lang.String key)
          Given a key, this method returns a Vector containing all values associated with the key.
 java.lang.String getByKey(java.lang.String key)
          Given a key, this method returns a string containing the associated MIME value from its current internal state.
 java.lang.String getContentLength()
          This method returns a string containing the Content-Length: MIME value from its current internal state.
 java.lang.String getContentType()
          This method returns a string containing the CONTENT-TYPE: MIME value from its current internal state.
 java.lang.String getExpires()
          This method returns a string containing the EXPIRES: MIME value from its current internal state.
 java.lang.String getFrom()
          This method returns a string containing the From: MIME value from its current internal state.
 java.lang.String getFullMime()
          Obtains a string of MIME data.
 java.lang.String getHeader()
          Obtains a string containing the MIME header string.
 java.lang.String getHost()
          This method returns a string containing the Host: MIME value from its current internal state.
 java.lang.String getIfModifiedSince()
          This method returns a string containing the IF-MODIFIED-SINCE: MIME value from its current internal state.
 java.lang.String getLastModified()
          This method returns a string containing the LAST-MODIFIED: MIME value from its current internal state.
 java.lang.String getUserAgent()
          This method returns a string containing the USER-AGENT: MIME value from its current internal state.
 void putAllByKey(java.lang.String key, java.util.Vector vec)
          Given a key and Vector containing values, this method sets a key to have multiple values within the current ParseMime object.
 void putByKey(java.lang.String key, java.lang.String value)
          Given a key and a value, this method sets the key/value pair within the current ParseMime object.
 void setHeader(java.lang.String iHead)
          Sets the current MIME header string.
 java.lang.String toString()
          Obtains a string of MIME data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
Constructor Detail

ParseMime

public ParseMime(java.lang.String s)
Given a string containing MIME data, this constructor creates a new ParseMime object and initializes it with the given MIME data.
Parameters:
s - A string containing MIME data.
Method Detail

getFullMime

public java.lang.String getFullMime()
Obtains a string of MIME data. This string is the reconstructed (after changes) MIME data.
Returns:
A string containing MIME data.

toString

public java.lang.String toString()
Obtains a string of MIME data. This string is the reconstructed (after changes) MIME data.
Overrides:
toString in class java.lang.Object
Returns:
A string containing MIME data.

getHeader

public java.lang.String getHeader()
Obtains a string containing the MIME header string.
Returns:
A string containing MIME data.

setHeader

public void setHeader(java.lang.String iHead)
Sets the current MIME header string. The previous header is overwritten.
Parameters:
iHead - The new header.

getByKey

public java.lang.String getByKey(java.lang.String key)
Given a key, this method returns a string containing the associated MIME value from its current internal state.
Parameters:
key - The key to be used to lookup the value.
Returns:
A string containing the MIME header string or an empty string if key is not found.

putByKey

public void putByKey(java.lang.String key,
                     java.lang.String value)
Given a key and a value, this method sets the key/value pair within the current ParseMime object. If one or more values already exist for this key, they are not overwritten; the new value is simply added.
Parameters:
key - The key to be used.
value - The new value.

getContentLength

public java.lang.String getContentLength()
This method returns a string containing the Content-Length: MIME value from its current internal state.
Returns:
A string containing the CONTENT-LENGTH: value.

getFrom

public java.lang.String getFrom()
This method returns a string containing the From: MIME value from its current internal state.
Returns:
A string containing the FROM: value.

getHost

public java.lang.String getHost()
This method returns a string containing the Host: MIME value from its current internal state.
Returns:
A string containing the HOST: value.

getUserAgent

public java.lang.String getUserAgent()
This method returns a string containing the USER-AGENT: MIME value from its current internal state.
Returns:
A string containing the USER-AGENT: value.

getContentType

public java.lang.String getContentType()
This method returns a string containing the CONTENT-TYPE: MIME value from its current internal state.
Returns:
A string containing the CONTENT-TYPE: value.

getExpires

public java.lang.String getExpires()
This method returns a string containing the EXPIRES: MIME value from its current internal state.
Returns:
A string containing the EXPIRES: value.

getIfModifiedSince

public java.lang.String getIfModifiedSince()
This method returns a string containing the IF-MODIFIED-SINCE: MIME value from its current internal state.
Returns:
A string containing the IF-MODIFIED-SINCE: value.

getLastModified

public java.lang.String getLastModified()
This method returns a string containing the LAST-MODIFIED: MIME value from its current internal state.
Returns:
A string containing the LAST-MODIFIED: value.

getAllByKey

public java.util.Vector getAllByKey(java.lang.String key)
Given a key, this method returns a Vector containing all values associated with the key.
Parameters:
key - The key to be used to lookup the value.
Returns:
A Vector containing all MIME values associated with the key; null if no values associated with this key were found.

putAllByKey

public void putAllByKey(java.lang.String key,
                        java.util.Vector vec)
Given a key and Vector containing values, this method sets a key to have multiple values within the current ParseMime object. Any existing values for this key are discarded.
Parameters:
key - The key to be used to lookup the value.
vec - A vector containing one or more values.

clearAllByKey

public void clearAllByKey(java.lang.String key)
Given a key this method clears all values associated with this key. ParseMime object.
Parameters:
key - The key to be used to lookup the value.