예제 #1
0
 public String toEncodedString() {
   char prefix = '?';
   for (Entry<String, String[]> entry : params.entrySet()) {
     for (String val : entry.getValue()) {
       path.append(prefix).append(entry.getKey()).append("=").append(val);
       prefix = '&';
     }
   }
   if (hash != null) {
     path.append("#").append(hash);
   }
   return UriUtils.encodeURIComponent(path.toString());
 }
예제 #2
0
 /** Adds a parameter to the "path" attribute which should end up doubly-encoded. */
 @Override
 public UrlBuilder uriParameter(String key, String uriValue) {
   parameter(key, UriUtils.encodeURIComponent(uriValue));
   return this;
 }