public UrlBuilder(final String baseUrl, final String charsetName, final boolean ignoreEmpty) { try { this.baseUrl = new URL(baseUrl); this.ignoreEmpty = ignoreEmpty; this.charset = Charset.forName(charsetName); String queryString = this.baseUrl.getQuery(); if (StringUtils.isNotEmpty(queryString)) queryMap = new LinkedHashMap<String, Object>(parseQuery(queryString)); else queryMap = Collections.emptyMap(); } catch (MalformedURLException e) { throw new RuntimeException(e); } }