@Test public void dwoParseUrlForMatchingExpression() throws MalformedURLException { URL url = new URL("dns: String expression = url.getPath(); Assert.assertNotNull(expression); Assert.assertEquals("/localhost/", expression); Assert.assertEquals("expression=abc[0-9]", url.getQuery()); String urlExpression = DnsRequisitionUrlConnection.determineExpressionFromUrl(url); Assert.assertEquals("abc[0-9]", urlExpression); }
protected static String determineExpressionFromUrl(URL url) { log().info("determineExpressionFromUrl: finding regex as parameter in query string of URL: "+url); if(getUrlArgs(url) == null) { return null; } else { return getUrlArgs(url).get(EXPRESSION_ARG); } }
DnsRequisitionUrlConnection extends URLConnection { protected static String determineExpressionFromUrl(URL url) { log().info("determineExpressionFromUrl: finding regex as parameter in query string of URL: "+url); if(getUrlArgs(url) == null) { return null; } else { return getUrlArgs(url).get(EXPRESSION_ARG); } } }
DnsRequisitionUrlConnection extends URLConnection { protected static String determineExpressionFromUrl(URL url) { log().info("determineExpressionFromUrl: finding regex as parameter in query string of URL: "+url); if(getUrlArgs(url) == null) { return null; } else { return getUrlArgs(url).get(EXPRESSION_ARG); } } DnsRequisitionUrlConnection(URL url); }
DnsRequisitionUrlConnection extends URLConnection { protected static String determineExpressionFromUrl(URL url) { log().info("determineExpressionFromUrl: finding regex as parameter in query string of URL: "+url); if(getUrlArgs(url) == null) { return null; } else { return getUrlArgs(url).get(EXPRESSION_ARG); } } DnsRequisitionUrlConnection(URL url); @Override void connect(); @Override InputStream getInputStream(); String getZone(); Long getSerial(); void setSerial(Long serial); Boolean getFallback(); void setFallback(Boolean fallback); TSIG getKey(); void setKey(TSIG key); String getDescription(); String toString(); URL getUrl(); static Map<String, String> getArgs(); void setForeignSource(String foreignSource); String getForeignSource(); }
DnsRequisitionUrlConnection extends URLConnection { protected static String determineExpressionFromUrl(URL url) { log().info("determineExpressionFromUrl: finding regex as parameter in query string of URL: "+url); if(getUrlArgs(url) == null) { return null; } else { return getUrlArgs(url).get(EXPRESSION_ARG); } } DnsRequisitionUrlConnection(URL url); @Override void connect(); @Override InputStream getInputStream(); String getZone(); Long getSerial(); void setSerial(Long serial); Boolean getFallback(); void setFallback(Boolean fallback); TSIG getKey(); void setKey(TSIG key); String getDescription(); String toString(); URL getUrl(); static Map<String, String> getArgs(); void setForeignSource(String foreignSource); String getForeignSource(); static final String URL_SCHEME; static final String PROTOCOL; }