test_class.declarator: temporaryFolder = new TemporaryFolder(new File("target"))
test_class.modifier: @Rule
      public final
test_class.original_string: @Rule
      public final TemporaryFolder temporaryFolder = new TemporaryFolder(new File("target"));
test_class.type: TemporaryFolder
test_class.var_name: temporaryFolder
test_class.file: oak-run-commons/src/test/java/org/apache/jackrabbit/oak/run/cli/BlobStoreFixtureProviderTest.java
test_class.identifier: BlobStoreFixtureProviderTest
test_case.body: @Test
      public void fileDataStore() throws Exception{
          String[] args = {"--fds-path", temporaryFolder.getRoot().getAbsolutePath(), "--read-write"};
          try (BlobStoreFixture fixture = BlobStoreFixtureProvider.create(createFDSOptions(args))){
              String blobId = fixture.getBlobStore().writeBlob(new ByteArrayInputStream("foo".getBytes()));
              assertNotNull(blobId);
          }
      }
test_case.class_method_signature: BlobStoreFixtureProviderTest.fileDataStore()
test_case.full_signature: @Test public void fileDataStore()
test_case.identifier: fileDataStore
test_case.invocations: getAbsolutePath getRoot create createFDSOptions writeBlob getBlobStore getBytes assertNotNull
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void fileDataStore()
focal_class.file: oak-run-commons/src/main/java/org/apache/jackrabbit/oak/run/cli/BlobStoreFixtureProvider.java
focal_class.identifier: BlobStoreFixtureProvider
focal_class.class_method_signature: BlobStoreFixtureProvider.create(Options options)
focal_class.full_signature: @Nullable public static BlobStoreFixture create(Options options)
focal_class.identifier: create
focal_class.modifiers: @Nullable public static
focal_class.parameters: (Options options)
focal_class.return: BlobStoreFixture
focal_class.signature: BlobStoreFixture create(Options options)
focal_class.class_method_signature: BlobStoreFixtureProvider.loadConfig(String cfgPath)
focal_class.full_signature: static Properties loadConfig(String cfgPath)
focal_class.identifier: loadConfig
focal_class.modifiers: static
focal_class.parameters: (String cfgPath)
focal_class.return: Properties
focal_class.signature: Properties loadConfig(String cfgPath)
focal_class.class_method_signature: BlobStoreFixtureProvider.loadAndTransformProps(String cfgPath)
focal_class.full_signature: private static Properties loadAndTransformProps(String cfgPath)
focal_class.identifier: loadAndTransformProps
focal_class.modifiers: private static
focal_class.parameters: (String cfgPath)
focal_class.return: Properties
focal_class.signature: Properties loadAndTransformProps(String cfgPath)
focal_class.class_method_signature: BlobStoreFixtureProvider.asCloseable(final File dir)
focal_class.full_signature: private static Closeable asCloseable(final File dir)
focal_class.identifier: asCloseable
focal_class.modifiers: private static
focal_class.parameters: (final File dir)
focal_class.return: Closeable
focal_class.signature: Closeable asCloseable(final File dir)
focal_class.class_method_signature: BlobStoreFixtureProvider.asMap(Properties props)
focal_class.full_signature: private static Map<String, ?> asMap(Properties props)
focal_class.identifier: asMap
focal_class.modifiers: private static
focal_class.parameters: (Properties props)
focal_class.return: Map<String, ?>
focal_class.signature: Map<String, ?> asMap(Properties props)
focal_method.body: @Nullable
      public static BlobStoreFixture create(Options options) throws Exception{
          BlobStoreOptions bsopts = options.getOptionBean(BlobStoreOptions.class);
  
          if (bsopts == null){
              return null;
          }
  
          Type bsType = bsopts.getBlobStoreType();
  
          if (bsType == Type.NONE){
              return null;
          }
          Closer closer = Closer.create();
          DataStore delegate;
          if (bsType == Type.S3){
              S3DataStore s3ds = new S3DataStore();
              Properties props = loadConfig(bsopts.getS3ConfigPath());
              s3ds.setProperties(props);
              File homeDir =  Files.createTempDir();
              closer.register(asCloseable(homeDir));
              populate(s3ds, asMap(props), false);
              s3ds.init(homeDir.getAbsolutePath());
              delegate = s3ds;
          } else if(bsType == Type.AZURE){
              AzureDataStore azureds = new AzureDataStore();
              String cfgPath = bsopts.getAzureConfigPath();
              Properties props = loadConfig(cfgPath);
              azureds.setProperties(props);
              File homeDir =  Files.createTempDir();
              populate(azureds, asMap(props), false);
              azureds.init(homeDir.getAbsolutePath());
              closer.register(asCloseable(homeDir));
              delegate = azureds;
          } else if (bsType == Type.FAKE) {
              FileDataStore fakeDs = new DummyDataStore();
              fakeDs.setPath(bsopts.getFakeDataStorePath());
              fakeDs.init(null);
              delegate = fakeDs;
          } else {
              FileDataStore fds = new OakFileDataStore();
              delegate = fds;
              if (bsopts.getFDSPath() != null) {
                  fds.setPath(bsopts.getFDSPath());
              } else {
                  String cfgPath = bsopts.getFDSConfigPath();
                  Properties props = loadAndTransformProps(cfgPath);
                  populate(delegate, asMap(props), true);
              }
              delegate.init(null);
          }
          DataStoreBlobStore blobStore = new DataStoreBlobStore(delegate);
          return new DataStoreFixture(blobStore, closer,
              (!options.getCommonOpts().isReadWrite() && !bsopts.isReadWrite()));
      }
focal_method.class_method_signature: BlobStoreFixtureProvider.create(Options options)
focal_method.full_signature: @Nullable public static BlobStoreFixture create(Options options)
focal_method.identifier: create
focal_method.invocations: getOptionBean getBlobStoreType create loadConfig getS3ConfigPath setProperties createTempDir register asCloseable populate asMap init getAbsolutePath getAzureConfigPath loadConfig setProperties createTempDir populate asMap init getAbsolutePath register asCloseable setPath getFakeDataStorePath init getFDSPath setPath getFDSPath getFDSConfigPath loadAndTransformProps populate asMap init isReadWrite getCommonOpts isReadWrite
focal_method.modifiers: @Nullable public static
focal_method.parameters: (Options options)
focal_method.return: BlobStoreFixture
focal_method.signature: BlobStoreFixture create(Options options)