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

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

Introduction

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

Prototype

FTPCmd NOOP

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

Click Source Link

Usage

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

/**
 * Send a noop and get the reply without reporting to the command listener.
 * Intended for use with keep-alive.//www.j a v  a  2s .  c o  m
 *
 * @throws IOException
 * @since 3.0
 */
protected void __noop() throws IOException {
    String msg = __buildMessage(FTPCmd.NOOP.getCommand(), null);
    __send(msg);
    __getReplyNoReport(); // This may timeout
}

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

/***
 * A convenience method to send the FTP NOOP command to the server,
 * receive the reply, and return the reply code.
 * <p>//from  w ww . j a v a 2  s  .co m
 * @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 noop() throws IOException {
    return sendCommand(FTPCmd.NOOP);
}