public static DirIndex createDirIndex(String files) throws IOException {
    if (files.equals("[]")) { // empty dir
      return new DirIndex(DirIndex.ROOT_DIR_NAME, Collections.emptyList(), Collections.emptyList(),
          Collections.emptyList(), Collections.emptyList());
    }

    String[] paths = files.substring(1, files.length() - 1).split(",");
    Arrays.sort(paths);
    // actually create the directory structure in a temp dir so that file properties and checksums can be computed
    Path localDir = createLocalDir(files);
    DirTreeNode dirTree = createDirTree(localDir.toAbsolutePath().toString(), paths);
    return createDirIndex(localDir.toAbsolutePath().toString(), dirTree);
  }
Test util methods to work with local dirs, {@link DirDiff}s and {@link DirIndex}es.
samza-core/src/test/java/org/apache/samza/storage/blobstore/util/BlobStoreTestUtil.java