FtpClient ftp = new FtpClient ();
ftp.setDataTimeOut(10*1000);
ftp.connect(ip);
ftp.login(name,pwd);
ftp.setFileType(DTP.BINARY_FILE_TYPE);
ftp.setControlEncoding("GBK");
ftp.enterLocalPassiveMode();
String dir = ftp.printWorkingDirectory();
String filePath = "/config/test.sh"; //config前面的‘/’不能省略
String uploadPath = dir + filePath ;
InputStream istream= this.getClass().getResourceAsStream(filePath );
ftp.storeFile(uploadPath ,istream);
//释放资源