Class KiwiUrls2

java.lang.Object
org.kiwiproject.beta.net.KiwiUrls2

@Beta public final class KiwiUrls2 extends Object
Utilities related to URLs.

These utilities could be considered for kiwi's KiwiUrls class. Or, they could just stay here forever. One can never really know these things...

  • Method Details

    • uniqueHostOnlyUrls

      public static Set<URL> uniqueHostOnlyUrls(Collection<URL> urls)
      Given a collection of URLs, return a set containing URLs with only the host[:port].

      TODO Would this be better named as 'uniqueAuthorityOnlyUrls' or similar?

    • hostOnlyUrlFrom

      public static URL hostOnlyUrlFrom(URL url)
      Strip any path or query parameters from the given URL, returning only host[:port].