org.mgif.connectivity.sync
Interface Request

All Superinterfaces:
Attributes, Datagram

public interface Request
extends Datagram

Defines an object to provide client request information.

See Also:
MGIF

Method Summary
 java.lang.String getCharacterEncoding()
          Returns the name of the character encoding used in the body of this request.
 int getContentLength()
          Returns the length, in bytes, of the request body and made available by the input stream, or -1 if the length is not known.
 java.lang.String getContentType()
          Returns the MIME type of the body of the request, or null if the type is not known
 java.io.InputStream getInputStream()
          Retrieves the body of the request as binary data using a InputStream.
 java.io.BufferedReader getReader()
          Retrieves the body of the request as character data using a BufferedReader.
 void setCharacterEncoding(java.lang.String s)
          Overrides the name of the character encoding used in the body of this request.
 
Methods inherited from interface org.mgif.connectivity.transfer.Datagram
getLocale, getLocales, getProtocol, getScheme, getTerminalId
 
Methods inherited from interface org.mgif.connectivity.transfer.Attributes
getAttribute, getAttributeNames, getAttributes, isAttribute, removeAttribute, setAttribute
 

Method Detail

getCharacterEncoding

public java.lang.String getCharacterEncoding()
Returns the name of the character encoding used in the body of this request. This method returns null if the request does not specify a character encoding.
Returns:
a String containing the name of the chararacter encoding, or null if the request does not specify a character encoding

getContentLength

public int getContentLength()
Returns the length, in bytes, of the request body and made available by the input stream, or -1 if the length is not known.
Returns:
an integer containing the length of the request body or -1 if the length is not known

getContentType

public java.lang.String getContentType()
Returns the MIME type of the body of the request, or null if the type is not known

See the Internet RFCs such as RFC 2045 for more information on MIME. Protocols such as SMTP and HTTP define profiles of MIME, and those standards are still evolving.

Returns:
a String containing the name of the MIME type of the request, or null if the type is not known
See Also:
RFC 2045

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Retrieves the body of the request as binary data using a InputStream. Either this method or getReader() may be called to read the body, not both.
Returns:
a InputStream object containing the body of the request
Throws:
java.io.IOException - if an input or output exception occurred

getReader

public java.io.BufferedReader getReader()
                                 throws java.io.IOException
Retrieves the body of the request as character data using a BufferedReader. The reader translates the character data according to the character encoding used on the body. Either this method or getInputStream() may be called to read the body, not both.
Returns:
a BufferedReader containing the body of the request
Throws:
IOException - if an input or output exception occurred

setCharacterEncoding

public void setCharacterEncoding(java.lang.String s)
                          throws java.io.UnsupportedEncodingException
Overrides the name of the character encoding used in the body of this request. This method must be called prior to reading request parameters or reading input using getReader().
Parameters:
a - String containing the name of the chararacter encoding
Returns:
UnsupportedEncodingException if this is not a valid encoding


Copyright © 2002 Mobile Games Interoperability Forum. All rights reserved.
This source code is protected by the legal notice posted at http://www.mgif.org/docs/notice.html