FTP Client使用的是Apache Commons Net 3.3
/**
* 检查FTP上指定文件是否存在
* @param remoteFilePartNameList 文件路径
* @throws BusinessException
* @throws IOException
*/
private void checkFtpFileExist(List remoteFilePartNameList) throws BusinessException, IOException {
FTPClient ftp = new FTPClient();
String serverIP = "1.1.1.1";
String serverUserName = "user";
String serverPassword = "pwd";
try {
ftp.connect(serverIP);
ftp.login(serverUserName, serverPassword);
if (FTPReply.isPositiveCompletion(ftp.getReplyCode())) {
ftp.enterLocalPassiveMode();
ftp.setFileType(FTP.BINARY_FILE_TYPE);
StringBuilder sb = null;
for (String remoteFileName : remoteFilePartNameList) {
InputStream inputStream = ftp.retrieveFileS