code: public boolean isFile(Path f) throws IOException {
      try {
        return !getFileStatus(f).isDir();
      } catch (FileNotFoundException e) {
        return false;               // f does not exist
      }
    }
docs: True iff the named path is a regular file.