fipaos.util
Class URL

java.lang.Object
  |
  +--fipaos.util.URL
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class URL
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

Provides a generalised URL class which can handle and protocol type (unlike java.net.URL)

See Also:
Serialized Form

Constructor Summary
URL()
          Allows an empty URL to be created
URL(java.lang.String url)
          Create a URL based upon the given URL
URL(URL other)
          Deprecated. Please use clone() instead
 
Method Summary
 java.lang.Object clone()
           
 boolean compare(java.lang.String a, java.lang.String b)
          Compares two "Strings"
 boolean equals(java.lang.Object o)
          Compares this with the given object
static DynamicClass.PropertyHint getDynamicClassHints(java.lang.String prop)
          Method to provide property hints to DynamicClass
 java.lang.String getHost()
          Gets the host/IP address contained within the URL
 java.lang.String getPass()
          Password associated with the URL (i.e.
 int getPort()
          Gets the port associated with the URL
 java.lang.String getProtocol()
          Gets the protocol associated with the URL
 java.lang.String getTarget()
          Gets the "target" of the URL (or "path")
 java.lang.String getUser()
          Username associated with the URL (i.e.
 int hashCode()
          Generates hashcodes
static void main(java.lang.String[] args)
           
 void setHost(java.lang.String s)
          Sets the host associated with the URL
 void setPass(java.lang.String s)
          Sets the password associated with the URL (i.e.
 void setPort(int s)
          Sets the port associated with the URL
 void setProtocol(java.lang.String s)
          Sets the protocol of the URL
 void setTarget(java.lang.String s)
          Sets the "target" (or "path") or the URL
 void setUser(java.lang.String s)
          Sets the username associated with the URL (i.e.
 java.lang.String toString()
          Converts back to a Stringified URL format
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

URL

public URL()
Allows an empty URL to be created

URL

public URL(java.lang.String url)
Create a URL based upon the given URL
Parameters:
url - A URL to based the new URL object on

URL

public URL(URL other)
Deprecated. Please use clone() instead

Duplicate the given URL
Method Detail

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

getProtocol

public java.lang.String getProtocol()
Gets the protocol associated with the URL
Returns:
The protocol (e.g. iiop, rmi, http etc...)

getHost

public java.lang.String getHost()
Gets the host/IP address contained within the URL
Returns:
Hostname/IP address

getPort

public int getPort()
Gets the port associated with the URL
Returns:
Port number

getTarget

public java.lang.String getTarget()
Gets the "target" of the URL (or "path")
Returns:
Target of the URL

getUser

public java.lang.String getUser()
Username associated with the URL (i.e. as in ftp://user:pass@somehost.com/)
Returns:
The username

getPass

public java.lang.String getPass()
Password associated with the URL (i.e. as in ftp://user:pass@somehost.com/)
Returns:
Password

setProtocol

public void setProtocol(java.lang.String s)
Sets the protocol of the URL
Parameters:
s - The protocol (e.g. iiop, rmi, http etc...)

setHost

public void setHost(java.lang.String s)
Sets the host associated with the URL
Parameters:
s - A hostname/IP address

setPort

public void setPort(int s)
Sets the port associated with the URL
Parameters:
s - The port-number, or -1 for none

setTarget

public void setTarget(java.lang.String s)
Sets the "target" (or "path") or the URL
Parameters:
s - The path (without leading "/")

setUser

public void setUser(java.lang.String s)
Sets the username associated with the URL (i.e. as in ftp://user:pass@somehost.com/)
Parameters:
s - Username

setPass

public void setPass(java.lang.String s)
Sets the password associated with the URL (i.e. as in ftp://user:pass@somehost.com/)
Parameters:
s - Password

toString

public java.lang.String toString()
Converts back to a Stringified URL format
Overrides:
toString in class java.lang.Object
Returns:
String representation of this

equals

public boolean equals(java.lang.Object o)
Compares this with the given object
Overrides:
equals in class java.lang.Object

compare

public boolean compare(java.lang.String a,
                       java.lang.String b)
Compares two "Strings"

hashCode

public int hashCode()
Generates hashcodes
Overrides:
hashCode in class java.lang.Object

getDynamicClassHints

public static DynamicClass.PropertyHint getDynamicClassHints(java.lang.String prop)
Method to provide property hints to DynamicClass

main

public static void main(java.lang.String[] args)