 |
Return to article.
Listing 5: Testing transfers
/**
* Cleanup FTP connection & certs
*/
public void close() {
try {
client.close();
cred.dispose();
}
catch (Exception ex) {}
}
/**
* testing GridFTP class
*/
public static void main(String[] args) {
// used to display log4j debug messages
Logger.getRoot().setLevel(Level.INFO);
// remote files
String rf1 = "/home/intraGrid/ig_guest/.shared_files/libuser.conf";
String rf2 = "/home/intraGrid/ig_guest/.shared_files/foo.txt";
String host = "dhcp126.adtech.internet.ibm.com";
// local files
String lf1 = "d:\\temp\\libuser.conf";
String lf2 = "d:\\temp\\foo.txt";
int TRANSFER_TYPE = GridFTPSession.TYPE_ASCII;
MyGridFTP myGridFTP1 = new MyGridFTP(host, MyGridFTP.GRIDFTP_PORT);
// regular transfer test
myGridFTP1.download(rf1, lf1, TRANSFER_TYPE);
myGridFTP1.download(rf2, lf2, TRANSFER_TYPE);
// parallel transfer test
myGridFTP1.parallelDownload(rf1, lf1);
myGridFTP1.parallelDownload(rf2, lf2);
myGridFTP1.close();
}
}
|
Return to article.
|  |
|