Example usage for org.apache.commons.net.ftp FTP getReplyCode

List of usage examples for org.apache.commons.net.ftp FTP getReplyCode

Introduction

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

Prototype

public int getReplyCode() 

Source Link

Document

Returns the integer value of the reply code of the last FTP reply.

Usage

From source file:progparallele.Main.java

public static void testFTPChunks() {
    FTP ftp = new FTP();
    try {/*  w ww.j  a  v a 2 s  . c  o  m*/
        ftp.connect(hostname, port);
        int reply = ftp.getReplyCode();
        if (reply != 220) {
            ftp.disconnect();
            return;
        }

        ftp.user("anonymous");
        ftp.pass("");

        ftp.disconnect();
    } catch (IOException e) {
        e.printStackTrace();
    }
}