@Test public void includesDefaultStores() { assertThat(underTest.browseStoreNames(), contains("config", "content")); }
@Override public Iterable<String> browseStoreNames() { ImmutableSet.Builder<String> storeNames = ImmutableSet.builder(); storeNames.add(CONFIG_DATASTORE_NAME); storeNames.add(CONTENT_DATASTORE_NAME); File[] files = fabricWorkDirectory.listFiles(); if (files != null) { stream(files) .filter(File::canRead) .map(File::getName) .filter(name -> name.endsWith(STORE_PROPERTIES_SUFFIX)) .map(name -> name.substring(0, name.indexOf(STORE_PROPERTIES_SUFFIX))) .filter(VALID_NAME_PATTERN.asPredicate()) .forEach(storeNames::add); } return storeNames.build(); }
DataStoreConfigurationLocalSource extends ComponentSupport implements DataStoreConfigurationSource { @Override public Iterable<String> browseStoreNames() { ImmutableSet.Builder<String> storeNames = ImmutableSet.builder(); storeNames.add(CONFIG_DATASTORE_NAME); storeNames.add(CONTENT_DATASTORE_NAME); File[] files = fabricWorkDirectory.listFiles(); if (files != null) { stream(files) .filter(File::canRead) .map(File::getName) .filter(name -> name.endsWith(STORE_PROPERTIES_SUFFIX)) .map(name -> name.substring(0, name.indexOf(STORE_PROPERTIES_SUFFIX))) .filter(VALID_NAME_PATTERN.asPredicate()) .forEach(storeNames::add); } return storeNames.build(); } }
DataStoreConfigurationLocalSource extends ComponentSupport implements DataStoreConfigurationSource { @Override public Iterable<String> browseStoreNames() { ImmutableSet.Builder<String> storeNames = ImmutableSet.builder(); storeNames.add(CONFIG_DATASTORE_NAME); storeNames.add(CONTENT_DATASTORE_NAME); File[] files = fabricWorkDirectory.listFiles(); if (files != null) { stream(files) .filter(File::canRead) .map(File::getName) .filter(name -> name.endsWith(STORE_PROPERTIES_SUFFIX)) .map(name -> name.substring(0, name.indexOf(STORE_PROPERTIES_SUFFIX))) .filter(VALID_NAME_PATTERN.asPredicate()) .forEach(storeNames::add); } return storeNames.build(); } @Inject  DataStoreConfigurationLocalSource(final ApplicationDirectories directories); }
DataStoreConfigurationLocalSource extends ComponentSupport implements DataStoreConfigurationSource { @Override public Iterable<String> browseStoreNames() { ImmutableSet.Builder<String> storeNames = ImmutableSet.builder(); storeNames.add(CONFIG_DATASTORE_NAME); storeNames.add(CONTENT_DATASTORE_NAME); File[] files = fabricWorkDirectory.listFiles(); if (files != null) { stream(files) .filter(File::canRead) .map(File::getName) .filter(name -> name.endsWith(STORE_PROPERTIES_SUFFIX)) .map(name -> name.substring(0, name.indexOf(STORE_PROPERTIES_SUFFIX))) .filter(VALID_NAME_PATTERN.asPredicate()) .forEach(storeNames::add); } return storeNames.build(); } @Inject  DataStoreConfigurationLocalSource(final ApplicationDirectories directories); @Override String getName(); @Override boolean isModifiable(); @Override Iterable<String> browseStoreNames(); @Override DataStoreConfiguration load(final String storeName); @Override void save(final DataStoreConfiguration configuration); @Override void delete(final DataStoreConfiguration configuration); }
DataStoreConfigurationLocalSource extends ComponentSupport implements DataStoreConfigurationSource { @Override public Iterable<String> browseStoreNames() { ImmutableSet.Builder<String> storeNames = ImmutableSet.builder(); storeNames.add(CONFIG_DATASTORE_NAME); storeNames.add(CONTENT_DATASTORE_NAME); File[] files = fabricWorkDirectory.listFiles(); if (files != null) { stream(files) .filter(File::canRead) .map(File::getName) .filter(name -> name.endsWith(STORE_PROPERTIES_SUFFIX)) .map(name -> name.substring(0, name.indexOf(STORE_PROPERTIES_SUFFIX))) .filter(VALID_NAME_PATTERN.asPredicate()) .forEach(storeNames::add); } return storeNames.build(); } @Inject  DataStoreConfigurationLocalSource(final ApplicationDirectories directories); @Override String getName(); @Override boolean isModifiable(); @Override Iterable<String> browseStoreNames(); @Override DataStoreConfiguration load(final String storeName); @Override void save(final DataStoreConfiguration configuration); @Override void delete(final DataStoreConfiguration configuration);  }