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

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

Introduction

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

Prototype

public FTP() 

Source Link

Document

The default FTP constructor.

Usage

From source file:progparallele.Main.java

public static void testFTPChunks() {
    FTP ftp = new FTP();
    try {//  ww w.j  a va2  s .  c  om
        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();
    }
}