code: private boolean isFileClosed(final DistributedFileSystem dfs, final Method m, final Path p) {
      try {
        return (Boolean) m.invoke(dfs, p);
      } catch (SecurityException e) {
        LOG.warn("No access", e);
      } catch (Exception e) {
        LOG.warn("Failed invocation for " + p.toString(), e);
      }
      return false;
    }
docs: Call HDFS-4525 isFileClosed if it is available.
  @param dfs Filesystem instance to use.
  @param m Method instance to call.
  @param p Path of the file to check is closed.
  @return True if file is closed.