private static FileIndex createFileIndex(String filePath, DirTreeNode node) {
    long checksum;
    FileMetadata fileMetadata;
    try {
      Path path = Paths.get(filePath);
      Checksum crc32 = new CRC32();
      byte[] fileBytes = Files.readAllBytes(path);
      crc32.update(fileBytes, 0, fileBytes.length);
      checksum = crc32.getValue();
      fileMetadata = FileMetadata.fromFile(path.toFile());
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
    return new FileIndex(node.fileName, ImmutableList.of(new FileBlob(node.fileName, 0)), fileMetadata, checksum);
  }
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