code: private FileStatus[] listStatus(FTPClient client, Path file)
        throws IOException {
      Path workDir = new Path(client.printWorkingDirectory());
      Path absolute = makeAbsolute(workDir, file);
      FileStatus fileStat = getFileStatus(client, absolute);
      if (!fileStat.isDir()) {
        return new FileStatus[] { fileStat };
      }
      FTPFile[] ftpFiles = client.listFiles(absolute.toUri().getPath());
      FileStatus[] fileStats = new FileStatus[ftpFiles.length];
      for (int i = 0; i < ftpFiles.length; i++) {
        fileStats[i] = getFileStatus(ftpFiles[i], absolute);
      }
      return fileStats;
    }
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.