Class URIs

java.lang.Object
org.netpreserve.jwarc.URIs

public class URIs extends Object
  • Constructor Details

    • URIs

      public URIs()
  • Method Details

    • hasHttpOrHttpsScheme

      public static boolean hasHttpOrHttpsScheme(String uri)
      Returns true if the given string begins with a http: or https: URI scheme. Does not enforce the string is a valid URI.
    • parseLeniently

      public static URI parseLeniently(String uri)
      Like URI.create() but attempts to percent encode when possible instead of throwing. Note that parseLeniently(s).toString().equals(s) may be false if percent encoding has occurred.
      Throws:
      IllegalArgumentException - if parsing failed
    • toNormalizedSurt

      public static String toNormalizedSurt(String uri)
      Converts a given URI into its normalized SURT (Sort-friendly URI Reordering Transform) format.

      There are many slightly different implementations of SURT. This one tries to produce the same output as the Python surt module for compatibility with pywb.

    • percentEncodeIllegals

      public static String percentEncodeIllegals(String s)
    • percentPlusDecode

      public static String percentPlusDecode(String s)