de.enough.polish.browser.protocols
Class HttpBluetoothProtocolHandler

java.lang.Object
  extended by de.enough.polish.browser.ProtocolHandler
      extended by de.enough.polish.browser.protocols.HttpBluetoothProtocolHandler

public class HttpBluetoothProtocolHandler
extends ProtocolHandler

Protocol handler class to handle HTTP requests over bluetooth. Use the de.enough.polish.bluetooth.BluetoothProxy on a PC for forwarding HTTP requests. The sent user agent is normally the string defined in the microedition.platform system property. You can overwrite this value by defining the polish.Browser.UserAgent variable in your build.xml.


Field Summary
 
Fields inherited from class de.enough.polish.browser.ProtocolHandler
bytebuf, protocolName
 
Constructor Summary
HttpBluetoothProtocolHandler(HashMap requestProperties, javax.bluetooth.ServiceRecord serviceRecord)
          Creates a new HttpProtocolHandler object with "http" as it's protocol.
HttpBluetoothProtocolHandler(javax.bluetooth.ServiceRecord serviceRecord)
          Creates a new HttpProtocolHandler object with "http" as it's protocol.
HttpBluetoothProtocolHandler(String protocolName, HashMap requestProperties, javax.bluetooth.ServiceRecord serviceRecord)
          Creates a new HttpProtocolHandler object.
HttpBluetoothProtocolHandler(String protocolName, javax.bluetooth.ServiceRecord serviceRecord)
          Creates a new HttpProtocolHandler object.
 
Method Summary
 StreamConnection getConnection(String url)
          Creates a StreamConnection for the given url.
 
Methods inherited from class de.enough.polish.browser.ProtocolHandler
getProtocolName, readByteArrayFromStream, stripProtocol
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpBluetoothProtocolHandler

public HttpBluetoothProtocolHandler(javax.bluetooth.ServiceRecord serviceRecord)
Creates a new HttpProtocolHandler object with "http" as it's protocol.

Parameters:
serviceRecord - the remote service to which connections should be established

HttpBluetoothProtocolHandler

public HttpBluetoothProtocolHandler(HashMap requestProperties,
                                    javax.bluetooth.ServiceRecord serviceRecord)
Creates a new HttpProtocolHandler object with "http" as it's protocol.

Parameters:
requestProperties - the request properties to use for each request
serviceRecord - the remote service to which connections should be established

HttpBluetoothProtocolHandler

public HttpBluetoothProtocolHandler(String protocolName,
                                    javax.bluetooth.ServiceRecord serviceRecord)
Creates a new HttpProtocolHandler object.

Parameters:
protocolName - the protocolname (usually "http" or "https")
serviceRecord - the remote service to which connections should be established

HttpBluetoothProtocolHandler

public HttpBluetoothProtocolHandler(String protocolName,
                                    HashMap requestProperties,
                                    javax.bluetooth.ServiceRecord serviceRecord)
Creates a new HttpProtocolHandler object.

Parameters:
protocolName - the protocolname (usually "http" or "https")
requestProperties - the request properties to use for each request
serviceRecord - the remote service to which connections should be established
Method Detail

getConnection

public StreamConnection getConnection(String url)
                               throws IOException
Description copied from class: ProtocolHandler
Creates a StreamConnection for the given url.

Specified by:
getConnection in class ProtocolHandler
Parameters:
url - the url
Returns:
the stream conenction for the given url
Throws:
IOException - if an error occurs