cs132.webSpider
Class Util

java.lang.Object
  extended by cs132.webSpider.Util

public class Util
extends java.lang.Object


Method Summary
static java.net.URL normalize(java.net.URL u)
          Given a URL, normalize it by removing any references or queries.
static boolean shouldCrawlURL(java.net.URL u, java.lang.String root)
          Determine if a URL should be recorded and crawled.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

normalize

public static java.net.URL normalize(java.net.URL u)
Given a URL, normalize it by removing any references or queries. For example, http://foo.com/index.html#abc gets normalized to http://foo.com/index.html

Parameters:
u - -- URL to normalize.
Returns:
-- normalized URL

shouldCrawlURL

public static boolean shouldCrawlURL(java.net.URL u,
                                     java.lang.String root)
Determine if a URL should be recorded and crawled. A url should not be recorded or crawled if any of the following are true:

Parameters:
u - -- URL to check
root - -- root of URL's that will be checked
Returns:
-- true if the URL should be recorded and crawled.


Web Accessibility