de.enough.polish.browser.protocols
Class ExternalProtocolHandler
java.lang.Object
de.enough.polish.browser.ProtocolHandler
de.enough.polish.browser.protocols.ExternalProtocolHandler
public class ExternalProtocolHandler
- extends ProtocolHandler
Protocol handler to handle the external: protocol. This class calls the given URLs in an external browser on MIDP 2.0 phones.
Example: <a href="external:http://www.j2mepolish.org">J2ME Polish</a>
Note that this handler requires MIDP 2.0 or higher.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ExternalProtocolHandler
public ExternalProtocolHandler(MIDlet midlet)
- Creates an ExternalProtocolHandler object using the default "external" protocol name.
- Parameters:
midlet - the midlet object of the application
ExternalProtocolHandler
public ExternalProtocolHandler(String protocolName,
MIDlet midlet)
- Creates an ExternalProtocolHandler object using the specified protocol name.
- Parameters:
protocolName - the name of the protocol to handlemidlet - the midlet object of the application
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
stripProtocol
protected String stripProtocol(String url)
- Strips the protol part off an url.
In contrast to other protocol handlers, the external protocol handler only uses a single colon to
separate the external protocol from the folllowing protocol, e.g. external:http://www.j2mepolish.org
- Overrides:
stripProtocol in class ProtocolHandler
- Parameters:
url - the url to remove the protocol from
- Returns:
- the host and part part of the given url