ftp实现下载

import com.enterprisedt.net.ftp.*;

public class FtpClient {

  static FTPClient ftpClient; 
  public FtpClient(){};
  String remoteAddress="192.168.168.33",userName="cattsoft",password="cattsoft";
  
   public void DownLoad(){ 
          try{  
           FTPClient client = new FTPClient();  
           client.setRemoteHost(remoteAddress);    
           client.connect();         
           client.login(userName,password);  
           client.setType(FTPTransferType.BINARY);  
           client.get("E:\\upload\\index.jsp","/home/cattsoft/jakarta-tomcat-5.0.28/webapps/vip/dkf/index2.jsp");    
           client.quit();  
           System.out.println("下载成功...");
          }catch(Exception e){  
              e.printStackTrace();
              System.out.println("下载失败...");
          }  

   }
  
   public static void main(String[] args){
    FtpClient fc = new FtpClient();
             fc.DownLoad();
   }
}

你可能感兴趣的:(tomcat,.net,jsp)