Example usage for org.apache.commons.net.nntp NNTPReply isInformational

List of usage examples for org.apache.commons.net.nntp NNTPReply isInformational

Introduction

In this page you can find the example usage for org.apache.commons.net.nntp NNTPReply isInformational.

Prototype

public static boolean isInformational(int reply) 

Source Link

Document

Determine if a reply code is an informational response.

Usage

From source file:net.longfalcon.newsj.nntp.client.CustomNNTPClient.java

/***
 * List the command help from the server.
 * <p>// www.  j ava 2s .  c  om
 * @return The sever help information.
 * @exception NNTPConnectionClosedException
 *      If the NNTP server prematurely closes the connection as a result
 *      of the client being idle or some other reason causing the server
 *      to send NNTP reply code 400.  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.
 ***/
@Override
public String listHelp() throws IOException {
    if (!NNTPReply.isInformational(help())) {
        return null;
    }

    StringWriter help = new StringWriter();
    BufferedReader reader = new DotTerminatedMessageReader(_reader_);
    Util.copyReader(reader, help);
    reader.close();
    help.close();
    return help.toString();
}