List<TreeFilter> suffixFilters = new ArrayList<TreeFilter>();\r
for (String extension : extensions) {\r
if (extension.charAt(0) == '.') {\r
- suffixFilters.add(PathSuffixFilter.create("\\" + extension));\r
+ suffixFilters.add(PathSuffixFilter.create(extension));\r
} else {\r
// escape the . since this is a regexp filter\r
- suffixFilters.add(PathSuffixFilter.create("\\." + extension));\r
+ suffixFilters.add(PathSuffixFilter.create("." + extension));\r
}\r
}\r
TreeFilter filter;\r
import org.junit.Test;\r
\r
import com.gitblit.Constants.SearchType;\r
-import com.gitblit.GitBlit;\r
-import com.gitblit.Keys;\r
import com.gitblit.models.GitNote;\r
import com.gitblit.models.PathModel;\r
import com.gitblit.models.PathModel.PathChangeModel;\r
@Test\r
public void testDocuments() throws Exception {\r
Repository repository = GitBlitSuite.getTicgitRepository();\r
- List<String> extensions = GitBlit.getStrings(Keys.web.markdownExtensions);\r
+ List<String> extensions = Arrays.asList(new String[] { ".mkd", ".md" });\r
List<PathModel> markdownDocs = JGitUtils.getDocuments(repository, extensions);\r
- List<PathModel> markdownDocs2 = JGitUtils.getDocuments(repository,\r
- Arrays.asList(new String[] { ".mkd", ".md" }));\r
List<PathModel> allFiles = JGitUtils.getDocuments(repository, null);\r
repository.close();\r
assertTrue(markdownDocs.size() > 0);\r
- assertTrue(markdownDocs2.size() > 0);\r
assertTrue(allFiles.size() > markdownDocs.size());\r
}\r
\r