@Test public void isMatch_checkAgainstPrefix() { RequestFilter requestFilter = new RequestFilter(Collections.singletonList("/todos/*")); assertTrue(requestFilter.isMatch("https: assertTrue(requestFilter.isMatch("https: assertTrue(requestFilter.isMatch("https: assertFalse(requestFilter.isMatch("https: assertFalse(requestFilter.isMatch("https: }
public boolean isMatch(@NonNull String url) { for (String r : regex) { String trimUrl = url.split("\\?")[0]; if (!trimUrl.endsWith("/")) { trimUrl = trimUrl + "/"; } if (trimUrl.matches(r)) { return true; } } return false; }
RequestFilter { public boolean isMatch(@NonNull String url) { for (String r : regex) { String trimUrl = url.split("\\?")[0]; if (!trimUrl.endsWith("/")) { trimUrl = trimUrl + "/"; } if (trimUrl.matches(r)) { return true; } } return false; } }
RequestFilter { public boolean isMatch(@NonNull String url) { for (String r : regex) { String trimUrl = url.split("\\?")[0]; if (!trimUrl.endsWith("/")) { trimUrl = trimUrl + "/"; } if (trimUrl.matches(r)) { return true; } } return false; } RequestFilter(@NonNull List<String> rules); }
RequestFilter { public boolean isMatch(@NonNull String url) { for (String r : regex) { String trimUrl = url.split("\\?")[0]; if (!trimUrl.endsWith("/")) { trimUrl = trimUrl + "/"; } if (trimUrl.matches(r)) { return true; } } return false; } RequestFilter(@NonNull List<String> rules); boolean isMatch(@NonNull String url); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
RequestFilter { public boolean isMatch(@NonNull String url) { for (String r : regex) { String trimUrl = url.split("\\?")[0]; if (!trimUrl.endsWith("/")) { trimUrl = trimUrl + "/"; } if (trimUrl.matches(r)) { return true; } } return false; } RequestFilter(@NonNull List<String> rules); boolean isMatch(@NonNull String url); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }