private void ensureNotInUse(File srcDir, long storeCapacity) throws StoreException {
    MessageStoreRecovery recovery = new BlobStoreRecovery();
    StoreMetrics metrics = new StoreMetrics(new MetricRegistry());
    Store store =
        new BlobStore("move_check_" + UUID.randomUUID().toString(), storeConfig, null, null, null, diskIOScheduler,
            diskSpaceAllocator, metrics, metrics, srcDir.getAbsolutePath(), storeCapacity, storeKeyFactory, recovery,
            null, time, null);
    store.start();
    store.shutdown();
  }
Ensures that the directory provided is not in use by starting and stopping a {@link BlobStore} at the given
directory.
@param srcDir the directory to use
@param storeCapacity the capacity of the store
@throws StoreException if there are any problems starting or stopping the store.
ambry-tools/src/main/java/com/github/ambry/store/DiskReformatter.java