|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.owasp.webscarab.model.HttpUrl
public class HttpUrl
Represents a http or https url
Constructor Summary | |
---|---|
HttpUrl(HttpUrl url,
java.lang.String relative)
Creates a new url, basing the supplied relative path against the supplied HttpUrl |
|
HttpUrl(java.lang.String url)
creates an HttpUrl by parsing the supplied string |
Method Summary | |
---|---|
int |
compareTo(java.lang.Object o)
Compares this object with the specified object for order. |
java.lang.String |
direct()
returns only the /path;fragment?query part of the URL |
java.lang.StringBuffer |
direct(java.lang.StringBuffer buff)
appends the /path;fragment?query part of the URL to the supplied buffer |
boolean |
equals(java.lang.Object o)
Indicates whether some other object is "equal to" this one. |
java.lang.String |
getFragment()
returns the fragment part of the url, or null if none exists |
java.lang.String |
getHost()
returns the host part of the url |
java.lang.String |
getParameters()
returns a string representation of the parameters passed to the url |
HttpUrl |
getParentUrl()
returns the parent of this Url. |
java.lang.String |
getPath()
returns the "file path" of the URL, excluding any fragments or queries |
int |
getPort()
returns the port |
java.lang.String |
getQuery()
returns the query part of the url, or null if none exists |
java.lang.String |
getScheme()
returns the schem of the url |
java.lang.String |
getSHPP()
returns a string representation of the url, excluding any fragments or query parts |
HttpUrl[] |
getUrlHierarchy()
returns an array containing the Url hierarchy, including this Url |
int |
hashCode()
Returns a hash code value for the object. |
java.lang.String |
toString()
returns a string representation of the URL, in fully qualified form |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public HttpUrl(java.lang.String url) throws java.net.MalformedURLException
url
- a String representation of the URL
java.net.MalformedURLException
- if the url is not well-formedpublic HttpUrl(HttpUrl url, java.lang.String relative) throws java.net.MalformedURLException
url
- the existing base urlrelative
- the relative path
java.net.MalformedURLException
- if the url is malformedMethod Detail |
---|
public java.lang.String getScheme()
public java.lang.String getHost()
public int getPort()
public java.lang.String getPath()
public java.lang.String getFragment()
public java.lang.String getQuery()
public java.lang.String getSHPP()
public java.lang.String getParameters()
public HttpUrl getParentUrl()
public HttpUrl[] getUrlHierarchy()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.StringBuffer direct(java.lang.StringBuffer buff)
buff
- a StrinBuffer to append the URL to
public java.lang.String direct()
public boolean equals(java.lang.Object o)
The equals
method implements an equivalence relation
on non-null object references:
x
, x.equals(x)
should return
true
.
x
and y
, x.equals(y)
should return true
if and only if
y.equals(x)
returns true
.
x
, y
, and z
, if
x.equals(y)
returns true
and
y.equals(z)
returns true
, then
x.equals(z)
should return true
.
x
and y
, multiple invocations of
x.equals(y) consistently return true
or consistently return false
, provided no
information used in equals
comparisons on the
objects is modified.
x
,
x.equals(null)
should return false
.
The equals method for class Object
implements
the most discriminating possible equivalence relation on objects;
that is, for any non-null reference values x
and
y
, this method returns true
if and only
if x
and y
refer to the same object
(x == y
has the value true
).
Note that it is generally necessary to override the hashCode method whenever this method is overridden, so as to maintain the general contract for the hashCode method, which states that equal objects must have equal hash codes.
equals
in class java.lang.Object
o
- the reference object with which to compare.
true
if this object is the same as the obj
argument; false
otherwise.hashCode()
,
Hashtable
public int compareTo(java.lang.Object o)
In the foregoing description, the notation sgn(expression) designates the mathematical signum function, which is defined to return one of -1, 0, or 1 according to whether the value of expression is negative, zero or positive. The implementor must ensure sgn(x.compareTo(y)) == -sgn(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception iff y.compareTo(x) throws an exception.)
The implementor must also ensure that the relation is transitive: (x.compareTo(y)>0 && y.compareTo(z)>0) implies x.compareTo(z)>0.
Finally, the implementer must ensure that x.compareTo(y)==0 implies that sgn(x.compareTo(z)) == sgn(y.compareTo(z)), for all z.
It is strongly recommended, but not strictly required that (x.compareTo(y)==0) == (x.equals(y)). Generally speaking, any class that implements the Comparable interface and violates this condition should clearly indicate this fact. The recommended language is "Note: this class has a natural ordering that is inconsistent with equals."
compareTo
in interface java.lang.Comparable
o
- the Object to be compared.
public int hashCode()
java.util.Hashtable
.
The general contract of hashCode
is:
hashCode
method on each of
the two objects must produce the same integer result.
Object.equals(java.lang.Object)
method, then calling the hashCode method on each of the
two objects must produce distinct integer results. However, the
programmer should be aware that producing distinct integer results
for unequal objects may improve the performance of hashtables.
As much as is reasonably practical, the hashCode method defined by class HttpUrl does return distinct integers for distinct objects. (This is implemented by converting the url to a String, and returning the String's hashCode() )
hashCode
in class java.lang.Object
Object.equals(java.lang.Object)
,
Hashtable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |