@Test public void testUserInfo() throws MalformedURLException, URISyntaxException { URL url = URLBuilder .createWfsURL( new URL( "http: + "raadpleegdienstenmercatorintern/wfs"), WfsVersionDto.V1_0_0, "GetCapabilities"); Assert.assertEquals( "http: + "raadpleegdienstenmercatorintern/wfs?service=WFS&version=1.0.0&request=GetCapabilities", url.toExternalForm()); }
public static URL createWfsURL(URL baseUrl, WfsVersionDto version, String request) throws URISyntaxException, MalformedURLException { List<NameValuePair> params = new ArrayList<NameValuePair>(URLEncodedUtils.parse(baseUrl.toURI(), "UTF-8")); for (int i = params.size() - 1; i >= 0; i--) { NameValuePair pair = params.get(i); if ("service".equalsIgnoreCase(pair.getName()) || ("version".equalsIgnoreCase(pair.getName()) && version != null) || "request".equalsIgnoreCase(pair.getName())) { params.remove(i); } } params.add(new BasicNameValuePair("service", "WFS")); if (version != null) { params.add(new BasicNameValuePair("version", version.toString())); } params.add(new BasicNameValuePair("request", request)); String protocol = baseUrl.getProtocol(); String authority = baseUrl.getAuthority(); String path = baseUrl.getPath(); String query = URLEncodedUtils.format(params, "UTF-8"); URL url = new URL(protocol + ": return url; }
URLBuilder { public static URL createWfsURL(URL baseUrl, WfsVersionDto version, String request) throws URISyntaxException, MalformedURLException { List<NameValuePair> params = new ArrayList<NameValuePair>(URLEncodedUtils.parse(baseUrl.toURI(), "UTF-8")); for (int i = params.size() - 1; i >= 0; i--) { NameValuePair pair = params.get(i); if ("service".equalsIgnoreCase(pair.getName()) || ("version".equalsIgnoreCase(pair.getName()) && version != null) || "request".equalsIgnoreCase(pair.getName())) { params.remove(i); } } params.add(new BasicNameValuePair("service", "WFS")); if (version != null) { params.add(new BasicNameValuePair("version", version.toString())); } params.add(new BasicNameValuePair("request", request)); String protocol = baseUrl.getProtocol(); String authority = baseUrl.getAuthority(); String path = baseUrl.getPath(); String query = URLEncodedUtils.format(params, "UTF-8"); URL url = new URL(protocol + ": return url; } }
URLBuilder { public static URL createWfsURL(URL baseUrl, WfsVersionDto version, String request) throws URISyntaxException, MalformedURLException { List<NameValuePair> params = new ArrayList<NameValuePair>(URLEncodedUtils.parse(baseUrl.toURI(), "UTF-8")); for (int i = params.size() - 1; i >= 0; i--) { NameValuePair pair = params.get(i); if ("service".equalsIgnoreCase(pair.getName()) || ("version".equalsIgnoreCase(pair.getName()) && version != null) || "request".equalsIgnoreCase(pair.getName())) { params.remove(i); } } params.add(new BasicNameValuePair("service", "WFS")); if (version != null) { params.add(new BasicNameValuePair("version", version.toString())); } params.add(new BasicNameValuePair("request", request)); String protocol = baseUrl.getProtocol(); String authority = baseUrl.getAuthority(); String path = baseUrl.getPath(); String query = URLEncodedUtils.format(params, "UTF-8"); URL url = new URL(protocol + ": return url; } private  URLBuilder(); }
URLBuilder { public static URL createWfsURL(URL baseUrl, WfsVersionDto version, String request) throws URISyntaxException, MalformedURLException { List<NameValuePair> params = new ArrayList<NameValuePair>(URLEncodedUtils.parse(baseUrl.toURI(), "UTF-8")); for (int i = params.size() - 1; i >= 0; i--) { NameValuePair pair = params.get(i); if ("service".equalsIgnoreCase(pair.getName()) || ("version".equalsIgnoreCase(pair.getName()) && version != null) || "request".equalsIgnoreCase(pair.getName())) { params.remove(i); } } params.add(new BasicNameValuePair("service", "WFS")); if (version != null) { params.add(new BasicNameValuePair("version", version.toString())); } params.add(new BasicNameValuePair("request", request)); String protocol = baseUrl.getProtocol(); String authority = baseUrl.getAuthority(); String path = baseUrl.getPath(); String query = URLEncodedUtils.format(params, "UTF-8"); URL url = new URL(protocol + ": return url; } private  URLBuilder(); static URL createWfsURL(URL baseUrl, WfsVersionDto version, String request); }
URLBuilder { public static URL createWfsURL(URL baseUrl, WfsVersionDto version, String request) throws URISyntaxException, MalformedURLException { List<NameValuePair> params = new ArrayList<NameValuePair>(URLEncodedUtils.parse(baseUrl.toURI(), "UTF-8")); for (int i = params.size() - 1; i >= 0; i--) { NameValuePair pair = params.get(i); if ("service".equalsIgnoreCase(pair.getName()) || ("version".equalsIgnoreCase(pair.getName()) && version != null) || "request".equalsIgnoreCase(pair.getName())) { params.remove(i); } } params.add(new BasicNameValuePair("service", "WFS")); if (version != null) { params.add(new BasicNameValuePair("version", version.toString())); } params.add(new BasicNameValuePair("request", request)); String protocol = baseUrl.getProtocol(); String authority = baseUrl.getAuthority(); String path = baseUrl.getPath(); String query = URLEncodedUtils.format(params, "UTF-8"); URL url = new URL(protocol + ": return url; } private  URLBuilder(); static URL createWfsURL(URL baseUrl, WfsVersionDto version, String request);  }