Getting an article from a newsgroup |
You can get an article from a newsgroup by using the Nntp#getArticle method providing the article ID retrieved from the article header as an argument.
Example
// get articles headers Enumeration e = nntp.getArticleHeaders();
// get article for each while(e.hasMoreElements()) { NntpArticleHeader header = (NntpArticleHeader)e.nextElement();
// get article id for header int articleId = header.getID();
// get article and print subject NntpArticle article = nntp.getArticle(articleId); System.out.println(article.getSubject()); } |