com.monkeycoder.monkeynetwork
Class MonkeyUrl

java.lang.Object
  extended by com.monkeycoder.monkeynetwork.MonkeyUrl

public class MonkeyUrl
extends java.lang.Object

This is a self contained URL parsing class. It understands all standard URL formats including several partially formed versions. For partially formed URLs unspecified information defaults to an HTTP configuration unless otherwise specified.

Author:
David Stephens

Constructor Summary
MonkeyUrl(java.lang.String inUrl)
          Creates a MonkeyUrl using the supplied raw URL.
MonkeyUrl(java.lang.String inUrl, int inProtocol)
          Creates a MonkeyUrl using the supplied raw URL and supplied default protocol specified by NetworkProtocol.
 
Method Summary
 java.lang.String getHost()
          Gets the remote host of the URL.
 int getPort()
          Gets the port on the remote host of the URL.
 int getProtocol()
          Gets the protocol as an integer specified by NetworkProtocol.
 java.lang.String getUri()
          Gets the request URI of the URL.
 java.lang.String getUrl()
          Get the original raw URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MonkeyUrl

public MonkeyUrl(java.lang.String inUrl)
Creates a MonkeyUrl using the supplied raw URL. This raw URL is parsed for easy access.

Parameters:
inUrl - The raw string data of the URL.

MonkeyUrl

public MonkeyUrl(java.lang.String inUrl,
                 int inProtocol)
Creates a MonkeyUrl using the supplied raw URL and supplied default protocol specified by NetworkProtocol. This raw URL is parsed for easy access.

Parameters:
inUrl - The raw string data of the URL.
inProtocol - The new default protocol.
See Also:
NetworkProtocol
Method Detail

getUrl

public java.lang.String getUrl()
Get the original raw URL.

Returns:
The original raw URL.

getProtocol

public int getProtocol()
Gets the protocol as an integer specified by NetworkProtocol.

Returns:
The protocol as an integer specified by NetworkProtocol.
See Also:
NetworkProtocol

getHost

public java.lang.String getHost()
Gets the remote host of the URL.

Returns:
The remote host of the URL.

getUri

public java.lang.String getUri()
Gets the request URI of the URL.

Returns:
The request URI of the URL.

getPort

public int getPort()
Gets the port on the remote host of the URL.

Returns:
The port on the remote host of the URL.