org.klomp.snark.web
Class URIUtil

java.lang.Object
  extended by org.klomp.snark.web.URIUtil

 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

Constructor Summary
URIUtil()
           
 
Method Summary
static String encodePath(String path)
          Encode a URI path.
static StringBuilder encodePath(StringBuilder buf, String path)
          Encode a URI path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URIUtil

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.