Package org.apache.commons.net.nntp

Examples of org.apache.commons.net.nntp.NNTPClient.stat()


      /* First reload: Retrieve an initial amount of News */
      if (lastArticleId == null) {

        /* Set Article Pointer to last Article */
        int status = client.stat(groupInfo.getLastArticle());
        if (status != STATUS_ARTICLE_POINTER_OK)
          throwConnectionException("Unable to retrieve any News", client);

        /* Retrieve initial news */
        for (int i = 0; i < INITIAL_NEWS && !monitor.isCanceled(); i++) {
View Full Code Here


      /* Subsequent reload: Set pointer to last retrieved News */
      else {

        /* Set Article Pointer to last retrieved News */
        int status = client.stat(lastArticleId);
        if (status != STATUS_ARTICLE_POINTER_OK)
          throwConnectionException("Unable to retrieve any News", client);

        /* Retrieve all the following News */
        while (client.next() == STATUS_ARTICLE_POINTER_OK && !monitor.isCanceled())
View Full Code Here

      /* Subsequent reload: Set pointer to last retrieved News and go from there */
      if (lastArticleId != null) {

        /* Set Article Pointer to last retrieved News */
        int status = client.stat(lastArticleId);
        if (status == NO_SUCH_ARTICLE_ERROR)
          downloadWithoutPointer = true; //This can happen if the last article id was not found, grab the latest news then
        else if (status != STATUS_ARTICLE_POINTER_OK)
          throwConnectionException(Messages.NewsGroupHandler_ERROR_RETRIEVE_NEWS, client);

View Full Code Here

      /* Retrieve the last 50 News of the group */
      if (downloadWithoutPointer) {

        /* Set Article Pointer to last Article */
        int status = client.stat(groupInfo.getLastArticle());
        if (status != STATUS_ARTICLE_POINTER_OK)
          throwConnectionException(Messages.NewsGroupHandler_ERROR_RETRIEVE_NEWS, client);

        /* Retrieve initial news */
        for (int i = 0; i < INITIAL_NEWS && !monitor.isCanceled(); i++) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.