System.out.println("Authentication failed for user " + user + "!");
System.exit(1);
}
}
NewsgroupInfo group = new NewsgroupInfo();
client.selectNewsgroup(newsgroup, group);
BufferedReader br;
String line;
if (articleSpec != null) {
br = (BufferedReader) client.retrieveArticleHeader(articleSpec);
} else {
long articleNum = group.getLastArticleLong();
br = client.retrieveArticleHeader(articleNum);
}
if (br != null) {
while((line=br.readLine()) != null) {
System.out.println(line);
}
br.close();
}
if (articleSpec != null) {
br = (BufferedReader) client.retrieveArticleBody(articleSpec);
} else {
long articleNum = group.getLastArticleLong();
br = client.retrieveArticleBody(articleNum);
}
if (br != null) {
while((line=br.readLine()) != null) {
System.out.println(line);