org.curjent.example.agent.ftpxfer
Interface FTPTransfer


public interface FTPTransfer

FTP example using multiple tasks.

The file transfer example downloads files from an FTP site to the local drive. Depending on the network environment, significant gains in throughput are possible by transferring multiple files at a time. The FTPTransfer agent supports multiple concurrent downloads. In informal tests downloads finished almost three times as fast with four concurrent tasks compared to one.

The agent's transfer method copies one file from the FTP site to the local drive. Two methods, starting and finished, mark the start and finish of a directory of files. The test driver recursively traverses a directory tree of FTP files. For each directory it calls the starting method with the directory path, the transfer method for each file, and lastly the finished method. All three methods are asynchronous. Each call is queued and returns immediately. The starting call executes first followed by the transfer calls and lastly by the finished call. All three methods log the directory or file path.


Method Summary
 void finished(String dir)
           
 void starting(String dir)
           
 void transfer(String file)
           
 

Method Detail

transfer

void transfer(String file)

starting

void starting(String dir)

finished

void finished(String dir)


Copyright 2009-2011 Tom Landon
Apache License 2.0