java.lang.Object
org.greenstone.gatherer.util.GURL
- All Implemented Interfaces:
- java.lang.Cloneable, java.io.Serializable
- public class GURL
- extends java.lang.Object
- implements java.lang.Cloneable, java.io.Serializable
Extends the standard URL class to include several new data elements and
the ability to take a string and parse a valid url.
type
private java.lang.Integer type
url
private java.net.URL url
file
private java.lang.String file
host
private java.lang.String host
path
private java.lang.String path
protocol
private java.lang.String protocol
title
private java.lang.String title
links
private java.util.Vector links
- This Vector maintains a record of the url links from within
this resource, and their type (EXTERNAL vs INTERNAL). Internal
links can be 'hidden' from the user if desired, or a user can
opt to have all internal links automatically moved into a
collection if the page that depends upon them is moved.
Each entry in the vector is of the form.
links[i] = String url
links[i+1] = int type
INTERNAL
public static java.lang.Integer INTERNAL
EXTERNAL
public static java.lang.Integer EXTERNAL
GURL
public GURL(java.lang.String url_str)
GURL
public GURL(java.net.URL url)
GURL
public GURL(java.net.URL url,
java.lang.Integer type)
GURL
public GURL(java.lang.String url_str,
java.lang.Integer type)
addLink
public void addLink(java.lang.String url)
addLink
public void addLink(java.lang.String url,
java.lang.Integer type)
getFile
public java.lang.String getFile()
- Used by tree renderer to display name. So we'll only return the
filename.
getHost
public java.lang.String getHost()
getPath
public java.lang.String getPath()
getPort
public int getPort()
getProtocol
public java.lang.String getProtocol()
getURL
public java.net.URL getURL()
toString
public java.lang.String toString()
- Description copied from class:
java.lang.Object
- Convert this Object to a human-readable String.
There are no limits placed on how long this String
should be or what it should contain. We suggest you
make it as intuitive as possible to be able to place
it into System.out.println() 55
and such.
It is typical, but not required, to ensure that this method
never completes abruptly with a java.lang.RuntimeException.
This method will be called when performing string
concatenation with this object. If the result is
null, string concatenation will instead
use "null".
The default implementation returns
getClass().getName() + "@" +
Integer.toHexString(hashCode()).
valid
public boolean valid()
parseFile
private java.lang.String parseFile(java.lang.String raw)
parsePath
private java.lang.String parsePath(java.lang.String raw)