Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.greenstone.gatherer.util
Class GURL  view GURL download GURL.java

java.lang.Object
  extended byorg.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.


Field Summary
static java.lang.Integer EXTERNAL
           
private  java.lang.String file
           
private  java.lang.String host
           
static java.lang.Integer INTERNAL
           
private  java.util.Vector links
          This Vector maintains a record of the url links from within this resource, and their type (EXTERNAL vs INTERNAL).
private  java.lang.String path
           
private  java.lang.String protocol
           
private  java.lang.String title
           
private  java.lang.Integer type
           
private  java.net.URL url
           
 
Constructor Summary
GURL(java.lang.String url_str)
           
GURL(java.lang.String url_str, java.lang.Integer type)
           
GURL(java.net.URL url)
           
GURL(java.net.URL url, java.lang.Integer type)
           
 
Method Summary
 void addLink(java.lang.String url)
           
 void addLink(java.lang.String url, java.lang.Integer type)
           
 java.lang.String getFile()
          Used by tree renderer to display name.
 java.lang.String getHost()
           
 java.lang.String getPath()
           
 int getPort()
           
 java.lang.String getProtocol()
           
 java.net.URL getURL()
           
private  java.lang.String parseFile(java.lang.String raw)
           
private  java.lang.String parsePath(java.lang.String raw)
           
 java.lang.String toString()
          Convert this Object to a human-readable String.
 boolean valid()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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
Constructor Detail

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)
Method Detail

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)