CompassDirEntryCache implements DirEntryCache { @Override public List<DirEntry> findDirectories(final String startPath) { final String escapedStartPath = QueryParser.escape(startPath); final String queryString = "path:" + escapedStartPath + "* kind:DIR"; if (logger.isDebugEnabled()) { logger.debug("Finding directories recursively from [" + 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 testFindDirectories() throws Exception { addAll(entryCache, TestUtils.getDirectoryList()); entryCache.add(new DirEntry("/", "*", null, new Date(), DirEntry.Kind.DIR, 1, 0)); assertEquals(5, entryCache.findDirectories("/").size()); assertEquals(2, entryCache.findDirectories("/trunk").size()); assertEquals(0, entryCache.findDirectories("/*").size()); }