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

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

Introduction

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

Prototype

int PATHNAME_CREATED

To view the source code for org.apache.commons.net.ftp FTPReply PATHNAME_CREATED.

Click Source Link

Usage

From source file:com.atomicleopard.thundr.ftp.commons.FTPClient.java

/**
 * Returns the pathname of the current working directory.
 * <p>/*from w w w. j  ava  2 s . c  om*/
 * @return The pathname of the current working directory.  If it cannot
 *         be obtained, returns null.
 * @exception FTPConnectionClosedException
 *      If the FTP server prematurely closes the connection as a result
 *      of the client being idle or some other reason causing the server
 *      to send FTP reply code 421.  This exception may be caught either
 *      as an IOException or independently as itself.
 * @exception IOException  If an I/O error occurs while either sending a
 *      command to the server or receiving a reply from the server.
 */
public String printWorkingDirectory() throws IOException {
    if (pwd() != FTPReply.PATHNAME_CREATED) {
        return null;
    }

    return __parsePathname(_replyLines.get(_replyLines.size() - 1));
}