S3DataStoreFactory implements BlobStoreFactory { static S3DataStore createDS(String directory, Properties props) { Properties strippedProperties = new Properties(); Map<String, String> map = Maps.newHashMap(); for (Object key : new HashSet<>(props.keySet())) { String strippedValue = stripValue(props.getProperty((String) key)); strippedProperties.put(key, strippedValue); map.put((String) key, strippedValue); } S3DataStore ds = new S3DataStore(); ds.setProperties(strippedProperties); ds.setPath(directory); PropertiesUtil.populate(ds, map, false); return ds; } S3DataStoreFactory(String configuration, String directory, boolean ignoreMissingBlobs); @Override BlobStore create(Closer closer); @Override String toString();  }
@Test public void testPopulateProperties() throws NoSuchFieldException, IllegalAccessException { Properties props = new Properties(); props.setProperty("cacheSize", "123"); S3DataStore ds = S3DataStoreFactory.createDS("xyz", props); assertEquals(123, readLong("cacheSize", AbstractSharedCachingDataStore.class, ds)); }
@Test public void testStripOsgiPrefix() throws NoSuchFieldException, IllegalAccessException { Properties props = new Properties(); props.setProperty("cacheSize", "I\"123\""); S3DataStore ds = S3DataStoreFactory.createDS("xyz", props); assertEquals(123, readLong("cacheSize", AbstractSharedCachingDataStore.class, ds)); }