@Test public void testMakeExpressions3() { Set<String> set = expressions.makeExpressions("http: Assert.assertEquals(2, set.size()); Assert.assertTrue(set.contains("1.2.3.4/1/")); Assert.assertTrue(set.contains("1.2.3.4/")); }
public Set<String> makeExpressions(String url) { UrlSplitter.UrlParts parts = urlSplitter.split(url); if (parts == null) { LOGGER.info("URL cannot be split into parts: {}", url); return Collections.emptySet(); } Set<String> suffixExprSet = extractSuffixExpressions(parts.getHost()); Set<String> prefixExprSet = extractPrefixExpressions(parts); Set<String> result = new HashSet<>(); for (String hostSuffix : suffixExprSet) { for (String pathPrefix : prefixExprSet) { result.add(hostSuffix + pathPrefix); } } return result; }
SuffixPrefixExpressions { public Set<String> makeExpressions(String url) { UrlSplitter.UrlParts parts = urlSplitter.split(url); if (parts == null) { LOGGER.info("URL cannot be split into parts: {}", url); return Collections.emptySet(); } Set<String> suffixExprSet = extractSuffixExpressions(parts.getHost()); Set<String> prefixExprSet = extractPrefixExpressions(parts); Set<String> result = new HashSet<>(); for (String hostSuffix : suffixExprSet) { for (String pathPrefix : prefixExprSet) { result.add(hostSuffix + pathPrefix); } } return result; } }
SuffixPrefixExpressions { public Set<String> makeExpressions(String url) { UrlSplitter.UrlParts parts = urlSplitter.split(url); if (parts == null) { LOGGER.info("URL cannot be split into parts: {}", url); return Collections.emptySet(); } Set<String> suffixExprSet = extractSuffixExpressions(parts.getHost()); Set<String> prefixExprSet = extractPrefixExpressions(parts); Set<String> result = new HashSet<>(); for (String hostSuffix : suffixExprSet) { for (String pathPrefix : prefixExprSet) { result.add(hostSuffix + pathPrefix); } } return result; }  }
SuffixPrefixExpressions { public Set<String> makeExpressions(String url) { UrlSplitter.UrlParts parts = urlSplitter.split(url); if (parts == null) { LOGGER.info("URL cannot be split into parts: {}", url); return Collections.emptySet(); } Set<String> suffixExprSet = extractSuffixExpressions(parts.getHost()); Set<String> prefixExprSet = extractPrefixExpressions(parts); Set<String> result = new HashSet<>(); for (String hostSuffix : suffixExprSet) { for (String pathPrefix : prefixExprSet) { result.add(hostSuffix + pathPrefix); } } return result; }  Set<String> makeExpressions(String url); }
SuffixPrefixExpressions { public Set<String> makeExpressions(String url) { UrlSplitter.UrlParts parts = urlSplitter.split(url); if (parts == null) { LOGGER.info("URL cannot be split into parts: {}", url); return Collections.emptySet(); } Set<String> suffixExprSet = extractSuffixExpressions(parts.getHost()); Set<String> prefixExprSet = extractPrefixExpressions(parts); Set<String> result = new HashSet<>(); for (String hostSuffix : suffixExprSet) { for (String pathPrefix : prefixExprSet) { result.add(hostSuffix + pathPrefix); } } return result; }  Set<String> makeExpressions(String url);  }