private URI doBuild(boolean fromEncoded, boolean encodePathSlash, Object... values) { if (values == null) { throw new IllegalArgumentException("Template parameter values are set to null"); } for (int i = 0; i < values.length; i++) { if (values[i] == null) { throw new IllegalArgumentException("Template parameter value at position " + i + " is set to null"); } } UriParts parts = doBuildUriParts(fromEncoded, encodePathSlash, false, values); try { return buildURI(fromEncoded, parts.path, parts.query, parts.fragment); } catch (URISyntaxException ex) { throw new UriBuilderException("URI can not be built", ex); } }
private URI doBuild(boolean fromEncoded, boolean encodePathSlash, Object... values) { if (values == null) { throw new IllegalArgumentException("Template parameter values are set to null"); } for (int i = 0; i < values.length; i++) { if (values[i] == null) { throw new IllegalArgumentException("Template parameter value is set to null"); } } UriParts parts = doBuildUriParts(fromEncoded, encodePathSlash, false, values); try { return buildURI(fromEncoded, parts.path, parts.query, parts.fragment); } catch (URISyntaxException ex) { throw new UriBuilderException("URI can not be built", ex); } }
private URI doBuildFromMap(Map<String, ? extends Object> map, boolean fromEncoded, boolean encodePathSlash) throws IllegalArgumentException, UriBuilderException { try { Map<String, Object> alreadyResolvedTs = getResolvedTemplates(resolvedTemplates); Map<String, Object> alreadyResolvedTsPathEnc = getResolvedTemplates(resolvedTemplatesPathEnc); Map<String, Object> alreadyResolvedEncTs = getResolvedTemplates(resolvedEncodedTemplates); String thePath = buildPath(); thePath = substituteMapped(thePath, map, alreadyResolvedTs, alreadyResolvedTsPathEnc, alreadyResolvedEncTs, false, fromEncoded, encodePathSlash); String theQuery = buildQuery(); if (theQuery != null) { theQuery = substituteMapped(theQuery, map, alreadyResolvedTs, alreadyResolvedTsPathEnc, alreadyResolvedEncTs, true, fromEncoded, false); } String theFragment = fragment == null ? null : substituteMapped(fragment, map, alreadyResolvedTs, alreadyResolvedTsPathEnc, alreadyResolvedEncTs, true, fromEncoded, encodePathSlash); return buildURI(fromEncoded, thePath, theQuery, theFragment); } catch (URISyntaxException ex) { throw new UriBuilderException("URI can not be built", ex); } } //CHECKSTYLE:OFF
private URI doBuildFromMap(Map<String, ? extends Object> map, boolean fromEncoded, boolean encodePathSlash) throws IllegalArgumentException, UriBuilderException { try { Map<String, Object> alreadyResolvedTs = getResolvedTemplates(resolvedTemplates); Map<String, Object> alreadyResolvedTsPathEnc = getResolvedTemplates(resolvedTemplatesPathEnc); Map<String, Object> alreadyResolvedEncTs = getResolvedTemplates(resolvedEncodedTemplates); String thePath = buildPath(); thePath = substituteMapped(thePath, map, alreadyResolvedTs, alreadyResolvedTsPathEnc, alreadyResolvedEncTs, false, fromEncoded, encodePathSlash); String theQuery = buildQuery(); if (theQuery != null) { theQuery = substituteMapped(theQuery, map, alreadyResolvedTs, alreadyResolvedTsPathEnc, alreadyResolvedEncTs, true, fromEncoded, false); } String theFragment = fragment == null ? null : substituteMapped(fragment, map, alreadyResolvedTs, alreadyResolvedTsPathEnc, alreadyResolvedEncTs, true, fromEncoded, encodePathSlash); return buildURI(fromEncoded, thePath, theQuery, theFragment); } catch (URISyntaxException ex) { throw new UriBuilderException("URI can not be built", ex); } } //CHECKSTYLE:OFF