1 2 3 4 5 6 7 8 9 10 11 12 | private boolean connectServer(String ip, int port,String user,String pwd){ boolean isSuccess = false ; ftpClient = new FTPClient(); try { ftpClient.connect(ip); isSuccess = ftpClient.login(user,pwd); } catch (IOException e) { logger.error( "连接FTP服务器异常" ,e); } return isSuccess; } |