Example usage for org.apache.commons.net.ftp FTPReply isNegativeTransient

List of usage examples for org.apache.commons.net.ftp FTPReply isNegativeTransient

Introduction

In this page you can find the example usage for org.apache.commons.net.ftp FTPReply isNegativeTransient.

Prototype

public static boolean isNegativeTransient(int reply) 

Source Link

Document

Determine if a reply code is a negative transient response.

Usage

From source file:com.clickha.nifi.processors.util.FTPTransferV2.java

public void sendCommands(final List<String> commands, final FlowFile flowFile) throws IOException {
    if (commands.isEmpty()) {
        return;//from  ww w  .java  2  s.com
    }

    final FTPClient client = getClient(flowFile);
    for (String cmd : commands) {
        if (!cmd.isEmpty()) {
            int result;
            result = client.sendCommand(cmd);
            logger.debug(this + " sent command to the FTP server: " + cmd + " for " + flowFile);

            if (FTPReply.isNegativePermanent(result) || FTPReply.isNegativeTransient(result)) {
                throw new IOException(this + " negative reply back from FTP server cmd: " + cmd + " reply:"
                        + result + ": " + client.getReplyString() + " for " + flowFile);
            }
        }
    }
}