Example usage for org.apache.commons.net.ftp FTPCmd RMD

List of usage examples for org.apache.commons.net.ftp FTPCmd RMD

Introduction

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

Prototype

FTPCmd RMD

To view the source code for org.apache.commons.net.ftp FTPCmd RMD.

Click Source Link

Usage

From source file:com.adaptris.ftp.ApacheFtpClientImpl.java

/**
 * remove a directory from the server//from  w  w  w  . j av a  2 s  .c o  m
 * 
 * @param dir directory name
 */
@Override
public void rmdir(String dir) throws IOException {
    try {
        acquireLock();
        log("{} {}", FTPCmd.RMD, dir);
        handleReturnValue(ftpClient().removeDirectory(dir));
    } finally {
        logReply(ftpClient().getReplyStrings());
        releaseLock();
    }

}

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

/***
 * A convenience method to send the FTP RMD command to the server,
 * receive the reply, and return the reply code.
 * <p>//ww w  .  j a v a 2 s  .c  o  m
 * @param pathname The pathname of the directory to remove.
 * @return The reply code received from the server.
 * @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 the
 *      command or receiving the server reply.
 ***/
public int rmd(String pathname) throws IOException {
    return sendCommand(FTPCmd.RMD, pathname);
}