public static FileMetadata fromFile(File file) throws IOException {
    PosixFileAttributes attributes = Files.readAttributes(file.toPath(), PosixFileAttributes.class);

    return new FileMetadata(attributes.creationTime().toMillis(), attributes.lastModifiedTime().toMillis(),
        attributes.size(), attributes.owner().toString(), attributes.group().toString(),
        PosixFilePermissions.toString(attributes.permissions()));
  }
Representation of metadata associated with a File.
samza-core/src/main/java/org/apache/samza/storage/blobstore/index/FileMetadata.java