title: How to normalize a URL in Java?
body: <blockquote>
    <p><a href="http://en.wikipedia.org/wiki/URL_normalization" rel="noreferrer">URL normalization</a> (or URL canonicalization) is the process by which URLs are modified and standardized in a consistent manner. The goal of the normalization process is to transform a URL into a normalized or canonical  URL so it is possible to determine if two syntactically different URLs are equivalent.</p>
  </blockquote>
  
  <p>Strategies include adding trailing slashes, https => http, etc. The Wikipedia page lists many.</p>
  
  <p>Got a favorite method of doing this in Java? Perhaps a library (<a href="http://nutch.apache.org/apidocs-1.0/org/apache/nutch/crawl/package-summary.html" rel="noreferrer">Nutch</a>?), but I'm open. Smaller and fewer dependencies is better.</p>
  
  <p>I'll handcode something for now and keep an eye on this question.</p>
  
  <p><strong>EDIT</strong>: I want to aggressively normalize to count URLs as the same if they refer to the same content. For example, I ignore the parameters utm_source, utm_medium, utm_campaign.  For example, I ignore subdomain if the title is the same.</p>