List of usage examples for org.apache.commons.net.ftp FTPSClient getReplyCode
public int getReplyCode()
From source file:org.mule.transport.ftps.FtpsMessageRequester.java
protected FTPFile findFileToProcess(FTPSClient client) throws Exception { //Checking if it is a file or a directory boolean isFile = connector.isFile(endpoint, client); FTPListParseEngine engine = client.initiateListParsing(); FTPFile[] files = null;/* w w w. j a v a 2 s . c o m*/ while (engine.hasNext()) { files = engine.getNext(FTP_LIST_PAGE_SIZE); if (files == null) { break; } FilenameFilter filenameFilter = getFilenameFilter(); for (int i = 0; i < files.length; i++) { FTPFile file = files[i]; if (file.isFile() && isValid(file, filenameFilter)) { // only read the first one return file; } } } if (!FTPReply.isPositiveCompletion(client.getReplyCode())) { throw new IOException("Ftp error: " + client.getReplyCode()); } return null; }