Class URIUtil


  • public class URIUtil
    extends Object
    URI Holder. This class assists with the decoding and encoding or HTTP URI's. It differs from the java.net.URL class as it does not provide communications ability, but it does assist with query string formatting.

    UTF-8 encoding is used by default for % encoded characters. This may be overridden with the org.eclipse.jetty.util.URI.charset system property. see UrlEncoded I2P modded from Jetty 8.1.15

    Since:
    0.9.15, moved from web in 0.9.49
    • Constructor Detail

      • URIUtil

        public URIUtil()
    • Method Detail

      • encodePath

        public static String encodePath​(String path)
        Encode a URI path. This is the same encoding offered by URLEncoder, except that the '/' character is not encoded.
        Parameters:
        path - The path the encode
        Returns:
        The encoded path
      • encodePath

        public static StringBuilder encodePath​(StringBuilder buf,
                                               String path)
        Encode a URI path. Somewhat oddly, this encodes all chars >= 0x80 if buf is null, (strict RFC 2396) but only the control, space, and special chars if buf is non-null.
        Parameters:
        path - The path the encode
        buf - StringBuilder to encode path into (or null)
        Returns:
        The StringBuilder or null if no substitutions required.