private FileStatus getFileStatus ( FileInfo fileInfo , String userName ) throws IOException { // GCS does not provide modification time. It only provides creation time. // It works for objects because they are immutable once created. FileStatus status = new FileStatus ( fileInfo . getSize ( ) , fileInfo . isDirectory ( ) , REPLICATION_FACTOR_DEFAULT , defaultBlockSize , /* modificationTime= */ fileInfo . getModificationTime ( ) , /* accessTime= */ fileInfo . getModificationTime ( ) , reportedPermissions , /* owner= */ userName , /* group= */ userName , getHadoopPath ( fileInfo . getPath ( ) ) ) ; logger . atFine ( ) . log ( "GHFS.getFileStatus: %s => %s" , fileInfo . getPath ( ) , lazy ( ( ) -> fileStatusToString ( status ) ) ) ; return status ; }
Gets FileStatus corresponding to the given FileInfo value .