code: private boolean isFile(FTPClient client, Path file) {
      try {
        return !getFileStatus(client, file).isDir();
      } catch (FileNotFoundException e) {
        return false; // file does not exist
      } catch (IOException ioe) {
        throw new FTPException("File check failed", ioe);
      }
    }
docs: Convenience method, so that we don't open a new connection when using this
  method from within another method. Otherwise every API invocation incurs
  the overhead of opening/closing a TCP connection.