public void transfer ( String remoteSrcFile , FTPClient destination , String remoteDstFile , boolean append , MarkerListener mListener ) throws IOException , ServerException , ClientException { session . matches ( destination . session ) ; // if transfer modes have not been defined, // set this (source) as active if ( session . serverMode == Session . SERVER_DEFAULT ) { HostPort hp = destination . setPassive ( ) ; setActive ( hp ) ; } destination . controlChannel . write ( new Command ( ( append ) ? "APPE" : "STOR" , remoteDstFile ) ) ; controlChannel . write ( new Command ( "RETR" , remoteSrcFile ) ) ; transferRunSingleThread ( destination . controlChannel , mListener ) ; }
Performs third - party transfer between two servers .