|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectxsmeral.semnet.util.URLUtil
public class URLUtil
Provides methods for URL normalization and host equality comparison.
Constructor Summary | |
---|---|
URLUtil()
|
Method Summary | |
---|---|
static boolean |
equalHosts(URL host1,
URL host2,
boolean full)
|
static String |
fullHost(URL url)
Returns scheme and authority part of URL with trailing slash. |
static URL |
normalize(String url)
Convenience method, calls normalize (new URL(url)) . |
static URL |
normalize(URL url)
Important part of every crawler - a URL normalizer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public URLUtil()
Method Detail |
---|
public static String fullHost(URL url)
public static boolean equalHosts(URL host1, URL host2, boolean full)
public static URL normalize(String url) throws MalformedURLException
normalize
(new URL(url))
.
Tries to add http://
if it's missing
url
- String containing the url to be normalized
MalformedURLException
public static URL normalize(URL url)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |