public static boolean isHFileFormat(final FileSystem fs, final FileStatus fileStatus)
    throws IOException {
    final Path path = fileStatus.getPath();
    final long size = fileStatus.getLen();
    try (FSDataInputStreamWrapper fsdis = new FSDataInputStreamWrapper(fs, path)) {
      boolean isHBaseChecksum = fsdis.shouldUseHBaseChecksum();
      assert !isHBaseChecksum; // Initially we must read with FS checksum.
      FixedFileTrailer.readFromStream(fsdis.getStream(isHBaseChecksum), size);
      return true;
    } catch (IllegalArgumentException e) {
      return false;
    }
  }
Returns true if the specified file has a valid HFile Trailer.
@param fs         filesystem
@param fileStatus the file to verify
@return true if the file has a valid HFile Trailer, otherwise false
@throws IOException if failed to read from the underlying stream
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java