CompassDirEntryCache implements DirEntryCache { @Override public List<DirEntry> findEntries(final String searchString, final String startPath) { final String escapedStartPath = QueryParser.escape(startPath); final String escapedSearchString = QueryParser.escape(searchString); final String queryString = "path:" + escapedStartPath + "* (name:" + escapedSearchString + " OR lastAuthor:" + escapedSearchString + " OR nameFragments:" + escapedSearchString + ")"; if (logger.isDebugEnabled()) { logger.debug("Finding string [" + escapedSearchString + "] starting in [" + escapedStartPath + "]"); logger.debug("QueryString: " + queryString); } final CompassTemplate template = new CompassTemplate(compass); final List<DirEntry> result = toEntriesList(template.findWithDetach(queryString)); logResult(result); return result; } CompassDirEntryCache(final File cacheRootDirectory);  CompassDirEntryCache(final File cacheDirectory, final boolean useDiskStore); @Override void init(); @Override void shutdown(); @Override void setLatestCachedRevisionNumber(final long revision); @Override long getLatestCachedRevisionNumber(); @Override int getSize(); @Override void add(final DirEntry... entries); @Override void clear(); @Override void removeFile(final String pathAndName); @Override void update(final Map<String, DirEntry.Kind> entriesToDelete,
                     final List<DirEntry> entriesToAdd); @Override void removeDirectory(final String pathAndName); @Override List<DirEntry> findEntries(final String searchString, final String startPath); @Override List<DirEntry> findEntriesByCamelCasePattern(final CamelCasePattern camelCasePattern,
                                                      final String startPath); @Override List<DirEntry> findDirectories(final String startPath); @Override void flush(); void setMaxEntriesPerCommit(final int maxEntriesPerCommit);  }
@Test public void testFindEntry() throws Exception { addAll(entryCache, TestUtils.getDirectoryList()); assertEquals(2, entryCache.findEntries("trunk", "/").size()); assertEquals(2, entryCache.findEntries("truNK", "/").size()); assertEquals(1, entryCache.findEntries("TAGS", "/").size()); assertEquals(5, entryCache.findEntries("java", "/").size()); assertEquals(1, entryCache.findEntries("java", "/trunk/code/").size()); assertEquals(2, entryCache.findEntries("html", "/").size()); assertEquals(2, entryCache.findEntries("test", "/").size()); assertEquals(13, entryCache.findEntries("in", "/").size()); assertEquals(7, entryCache.findEntries("*", "/trunk").size()); assertEquals(2, entryCache.findEntries("*", "/TAGS").size()); assertEquals(7, entryCache.findEntries("File", "/").size()); assertEquals(7, entryCache.findEntries("file", "/").size()); assertEquals(5, entryCache.findEntries("file", "/trunk/").size()); assertEquals(3, entryCache.findEntries("dir", "").size()); }