fipaos.util
Class URL


public class URL
implements Cloneable, Serializable

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




Constructor Summary
URL()
          Allows an empty URL to be created
URL(String url)
          Create a URL based upon the given URL

Method Summary
 Objectclone()
           
 booleancompare(String a, String b)
          Compares two "Strings"
 booleanequals(Object o)
          Compares this with the given object
 static DynamicClass.PropertyHintgetDynamicClassHints(String prop)
          Method to provide property hints to DynamicClass
 StringgetHost()
          Gets the host/IP address contained within the URL
 StringgetPass()
          Password associated with the URL (i.e.
 intgetPort()
          Gets the port associated with the URL
 StringgetProtocol()
          Gets the protocol associated with the URL
 StringgetTarget()
          Gets the "target" of the URL (or "path")
 StringgetUser()
          Username associated with the URL (i.e.
 inthashCode()
          Generates hashcodes
 static voidmain(String[] args)
           
 voidsetHost(String s)
          Sets the host associated with the URL
 voidsetPass(String s)
          Sets the password associated with the URL (i.e.
 voidsetPort(int s)
          Sets the port associated with the URL
 voidsetProtocol(String s)
          Sets the protocol of the URL
 voidsetTarget(String s)
          Sets the "target" (or "path") or the URL
 voidsetUser(String s)
          Sets the username associated with the URL (i.e.
 StringtoString()
          Converts back to a Stringified URL format

Constructor Detail

URL

public URL()
Allows an empty URL to be created

URL

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

clone

public Object clone()

compare

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

equals

public boolean equals(Object o)
Compares this with the given object

getDynamicClassHints

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

getHost

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

getPass

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

getPort

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

getProtocol

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

getTarget

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

getUser

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

hashCode

public int hashCode()
Generates hashcodes

main

public static void main(String[] args)

setHost

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

setPass

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

setPort

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

setProtocol

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

setTarget

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

setUser

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

toString

public String toString()
Converts back to a Stringified URL format
Returns: String representation of this

Association Links

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String

to Class java.lang.String