public static FileStatus getFileStatusOrNull(FileSystem fs, Path path) throws IOException {
    try {
      return fs.getFileStatus(path);
    } catch (FileNotFoundException e) {
      return null;
    }
  }
Attempts to get file status.  This method differs from the FileSystem API in that it returns
null instead of throwing FileNotFoundException if the path does not exist.

@param fs file system to check
@param path file system path to check
@return FileStatus for path or null if path does not exist
@throws IOException if there is an I/O error
common/src/java/org/apache/hadoop/hive/common/FileUtils.java