FilterRuleChainPlainParser { public FilterRuleChain<String> parse(Reader reader, boolean defaultResult) throws IOException { return parse(new BufferedReader(reader), defaultResult); } FilterRuleChainPlainParser(); char getAcceptChar(); void setAcceptChar(char acceptChar); char getDenyChar(); void setDenyChar(char denyChar); char getCommentChar(); void setCommentChar(char commentChar); FilterRuleChain<String> parse(Reader reader, boolean defaultResult); FilterRuleChain<String> parse(BufferedReader reader, boolean defaultResult);  }
@Test public void test() throws Exception { FilterRuleChainPlainParser parser = new FilterRuleChainPlainParser(); try (InputStream inStream = new ClasspathResource(FilterRuleChainPlainParserTest.class, ".txt", true) .openStream()) { FilterRuleChain chain = parser.parse(new InputStreamReader(inStream, "UTF-8"), true); assertTrue(chain.accept("/doc/manual.pdf")); assertFalse(chain.accept("/data/manual.pdf")); assertTrue(chain.accept("/data/config.xml")); assertTrue(chain.accept("/data/config.xsl")); assertFalse(chain.accept("/foo/config.xml")); assertFalse(chain.accept("/foo/config.XSL")); assertFalse(chain.accept("/foo/bar/file.pdf")); assertFalse(chain.accept("/foo/bar/file.xml")); assertFalse(chain.accept("/foo/bar/file.XsL")); assertTrue(chain.accept("/foo/bar/file.bar")); } }