IBM®
跳转到主要内容
    中国 [选择]    使用条款
 
 
Select a scope: Search for:    
    首页    产品    服务与解决方案     支持与下载    个性化服务    
跳转到主要内容

developerWorks 中国  >  Grid computing  >

Transferring files with GridFTP

Listing 5: Testing transfers

developerWorks

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.

    关于 IBM 隐私条约 联系 IBM 使用条款