code: static public void transfer(FTPClient source,
                                  String remoteSrcFile,
                                  FTPClient destination,
                                  String remoteDstFile,
                                  int mode,
                                  MarkerListener mListener)
          throws IOException, ServerException, ClientException
      {
          try {
              // Although neither mode nor passive setting from in the
              // session is used, we still perform this check, since
              // other things may be checked as well.
              source.session.matches(destination.session);
  
              HostPort hp;
              if (destination.isFeatureSupported(FeatureList.GETPUT)) {
                  destination.issueGETPUT("PUT", true, null,
                                          mode, remoteDstFile);
                  hp = ((GridFTPClient)destination).get127Reply();
              } else {
                  if (mode > 0) {
                      destination.setMode(mode);
                  }
                  hp = destination.setPassive();
                  destination.controlChannel.write(new Command("STOR", remoteDstFile));
              }
  
              if (source.isFeatureSupported(FeatureList.GETPUT)) {
                  source.issueGETPUT("GET", false, hp, mode, remoteSrcFile);
              } else {
                  if (mode > 0) {
                      source.setMode(mode);
                  }
                  source.setActive(hp);
                  source.controlChannel.write(new Command("RETR", remoteSrcFile));
              }
  
              source.transferRunSingleThread(destination.controlChannel, mListener);
          } catch (FTPReplyParseException rpe) {
              throw ServerException.embedFTPReplyParseException(rpe);
          }
      }
docs: Performs third-party transfer between two servers. If possibly,
  GFD.47 (a.k.a GridFTP2) GET and PUT commands are used.
  
  @param source        client connected to source server
  @param remoteSrcFile source filename
  @param destination   client connected to destination server
  @param remoteDstFile destination filename
  @param mode data channel mode or 0 to use the current mode
  @param mListener     marker listener.
  Can be set to null.