electric.util
Class XURL

java.lang.Object
  extended byelectric.util.XURL
All Implemented Interfaces:
java.io.Serializable

public final class XURL
extends java.lang.Object
implements java.io.Serializable

XURL represents an URL. It exists because the standard Java URL class is too restrictive and cannot represent URLs that do not have an associated URLConnection class.

Author:
webMethods
See Also:
Serialized Form

Constructor Summary
XURL()
           
XURL(java.lang.String xurl)
           
XURL(java.lang.String protocol, java.lang.String host, int port, java.lang.String file, java.lang.String reference)
           
XURL(XURL xurl)
           
 
Method Summary
 boolean equals(java.lang.Object object)
           
 java.lang.String getFile()
           
 java.lang.String getHost()
           
 java.net.InetAddress getHostAddress()
           
 XURL getHostAndPortXURL()
           
 XURL getHostXURL()
           
static java.net.InetAddress getLocalHostAddress()
           
 int getPort()
           
 java.lang.String getProtocol()
           
static java.lang.String getProtocol(java.lang.String path)
           
 java.lang.String getReference()
           
 int hashCode()
           
 boolean hasLocalHost()
           
static boolean hasProtocol(java.lang.String path)
           
static boolean isFileURL(java.lang.String path)
           
 java.lang.String toString()
           
static XURL valueOf(java.lang.String string)
           
static XURL valueOfOrNull(java.lang.String string)
          Return an XURL corresponding to the given string, but return null instead of throwing a MalformedURLException.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XURL

public XURL()

XURL

public XURL(java.lang.String xurl)
     throws java.net.MalformedURLException
Parameters:
xurl -
Throws:
java.net.MalformedURLException

XURL

public XURL(java.lang.String protocol,
            java.lang.String host,
            int port,
            java.lang.String file,
            java.lang.String reference)
Parameters:
protocol -
host -
port -
file -
reference -

XURL

public XURL(XURL xurl)
Parameters:
xurl -
Method Detail

toString

public java.lang.String toString()

hashCode

public int hashCode()

equals

public boolean equals(java.lang.Object object)
Parameters:
object -

getProtocol

public java.lang.String getProtocol()

getHost

public java.lang.String getHost()

getHostAddress

public java.net.InetAddress getHostAddress()

getPort

public int getPort()

getFile

public java.lang.String getFile()

getReference

public java.lang.String getReference()

getHostXURL

public XURL getHostXURL()

getHostAndPortXURL

public XURL getHostAndPortXURL()

valueOf

public static XURL valueOf(java.lang.String string)
                    throws java.lang.IllegalArgumentException
Parameters:
string -
Throws:
java.lang.IllegalArgumentException

valueOfOrNull

public static XURL valueOfOrNull(java.lang.String string)
Return an XURL corresponding to the given string, but return null instead of throwing a MalformedURLException. This is a suprinsgly common operation.

Parameters:
string - representing a url.
Returns:
an xurl, or null.

hasProtocol

public static boolean hasProtocol(java.lang.String path)
Parameters:
path -

getProtocol

public static java.lang.String getProtocol(java.lang.String path)
Parameters:
path -

isFileURL

public static boolean isFileURL(java.lang.String path)
Parameters:
path -

getLocalHostAddress

public static java.net.InetAddress getLocalHostAddress()

hasLocalHost

public boolean hasLocalHost()


copyright© 2001-2004 by webMethods All Rights Reserved.