DefaultCacheGateway implements CacheGateway { @Override public List<DirEntry> findDirectories(final RepositoryName repositoryName, final String fromPath) throws CacheException { final DirEntryCache entryCache = cacheManager.getCache(repositoryName); assertCacheExists(entryCache, repositoryName); return entryCache.findDirectories(fromPath); }  @Autowired void setEntryCacheManager(final DirEntryCacheManager cacheManager); @Autowired void setLogEntryCacheManager(final LogMessageCacheManager logMessageCacheManager); @Override List<DirEntry> findEntries(final RepositoryName repositoryName, final String searchString,
                                    final String startDir); @Override List<DirEntry> findEntriesByCamelCase(final RepositoryName repositoryName, final CamelCasePattern pattern,
                                               final String startDir); @Override List<DirEntry> findDirectories(final RepositoryName repositoryName, final String fromPath); @Override List<LogMessageSearchItem> find(final RepositoryName repositoryName, final String queryString); @Override List<LogMessageSearchItem> find(final RepositoryName repositoryName, final String queryString, final String startDir);  }
@Test public void testFindDirectories() throws Exception { final CacheGateway cache = createCache(); assertEquals(4, cache.findDirectories(repositoryName, "/").size()); assertEquals(2, cache.findDirectories(repositoryName, "/trunk/").size()); }