Example usage for org.apache.commons.net.ftp FTPConnectionClosedException toString

List of usage examples for org.apache.commons.net.ftp FTPConnectionClosedException toString

Introduction

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

Prototype

public String toString() 

Source Link

Document

Returns a short description of this throwable.

Usage

From source file:com.savy3.util.MainframeFTPClientUtils.java

public static boolean closeFTPConnection(FTPClient ftp) {
    boolean success = true;
    try {//from  w w  w.ja  va2  s  . c  o  m
        ftp.noop(); // check that control connection is working OK
        ftp.logout();
    } catch (FTPConnectionClosedException e) {
        success = false;
        LOG.warn("Server closed connection: " + e.toString());
    } catch (IOException e) {
        success = false;
        LOG.warn("Server closed connection: " + e.toString());
    } finally {
        if (ftp.isConnected()) {
            try {
                ftp.disconnect();
            } catch (IOException f) {
                success = false;
            }
        }
    }
    return success;
}