本来看了上传 
以为是很简单的事情,
谁知道我死在了起跑线上.
连接就未能成功 FTPClient.connect("usename","psw")这东西直接报异常~!!!!!
Unable to resolve host "ftp://www.xxxx.com": No address associated with hostname!!!
本来以为这也是一个很简单的事情,按照各种配置 修改最后发现所有百度上的方法都用了,无效.....下面不BB,直接给代码
public static boolean uploadFile(String url, int port, String username,
String password, String path, String filename, InputStream input) {
boolean success = false;
FTPClient ftp = new FTPClient();
// LogUitl.Infor(url+port+username+password+path);


try {
int reply;
ftp.connect(url, port);

ftp.login(username, password);//
reply = ftp.getReplyCode();
if (!FTPReply.isPositiveCompletion(reply)) {
ftp.disconnect();
return success;
}
ftp.setFileType(FTP.BINARY_FILE_TYPE);
ftp.changeWorkingDirectory(path);
ftp.storeFile(filename, input);
input.close();
ftp.logout();
success = true;
} catch (IOException e) {
e.printStackTrace();
} finally {
if (ftp.isConnected()) {
try {
ftp.disconnect();
} catch (IOException ioe) {
}
}
}
return success;
}
}
最后说下错误地点,每次断点调试都是到 ftpCliect('user',"psw");直接出以上异常....