@Override public URI buildFromMap(Map<String, ?> map) throws IllegalArgumentException, UriBuilderException { return doBuildFromMap(map, false, true); }
@Override public URI buildFromMap(Map<String, ?> map, boolean encodePathSlash) throws IllegalArgumentException, UriBuilderException { return doBuildFromMap(map, false, encodePathSlash); }
@Override public URI buildFromMap(Map<String, ?> map, boolean encodePathSlash) throws IllegalArgumentException, UriBuilderException { return doBuildFromMap(map, false, encodePathSlash); }
@Override public URI buildFromMap(Map<String, ?> map) throws IllegalArgumentException, UriBuilderException { return doBuildFromMap(map, false, true); }
@Override public URI buildFromEncodedMap(Map<String, ?> map) throws IllegalArgumentException, UriBuilderException { Map<String, String> decodedMap = new HashMap<>(map.size()); for (Map.Entry<String, ? extends Object> entry : map.entrySet()) { if (entry.getValue() == null) { throw new IllegalArgumentException("Value is null"); } String theValue = entry.getValue().toString(); if (theValue.contains("/")) { // protecting '/' from being encoded here assumes that a given value may constitute multiple // path segments - very questionable especially given that queries and fragments may also // contain template vars - technically this can be covered by checking where a given template // var is coming from and act accordingly. Confusing nonetheless. StringBuilder buf = new StringBuilder(); String[] values = theValue.split("/"); for (int i = 0; i < values.length; i++) { buf.append(HttpUtils.encodePartiallyEncoded(values[i], false)); if (i + 1 < values.length) { buf.append("/"); } } decodedMap.put(entry.getKey(), buf.toString()); } else { decodedMap.put(entry.getKey(), HttpUtils.encodePartiallyEncoded(theValue, false)); } } return doBuildFromMap(decodedMap, true, false); }
return doBuildFromMap(decodedMap, true, false);