classpathx-javamail
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Classpathx-javamail] How to use the ArticleResponse of an NNTPConnecti


From: Carsten Ringe
Subject: [Classpathx-javamail] How to use the ArticleResponse of an NNTPConnection.article() command
Date: Sat, 22 Feb 2003 16:00:31 +0100

Hi guys!

I imported the gnu.inet package to my project today and tried to retrieve one article by message ID. The connection is set up correct and the server is responding. But when I come to this code, I'm stuck with some exceptions I can't interpret:

ArticleResponse article = connection.article("<address@hidden>");
System.out.println(article);

I recieve this output on the console:

gnu.inet.nntp.ArticleResponse: 0 article <address@hidden>

I wait a while, nothing happens. Then I try to quit my application via the exit MenuItem - NOT the Window Decoration Close. This output is thrown:

java.lang.NumberFormatException: For input string: "Path:"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:426)
at java.lang.Short.parseShort(Short.java:120)
at java.lang.Short.parseShort(Short.java:78)
at gnu.inet.nntp.NNTPConnection.parseResponse(NNTPConnection.java:1101)
at gnu.inet.nntp.NNTPConnection.quit(NNTPConnection.java:616)
at ringe.JNews.exitApp(JNews.java:294)
at ringe.JNews.access$0(JNews.java:291)
at ringe.JNews$1.actionPerformed(JNews.java:135)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1764)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1817) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
at javax.swing.AbstractButton.doClick(AbstractButton.java:289)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1109)
at javax.swing.plaf.basic.BasicMenuItemUI$MouseInputHandler.mouseReleased(BasicMenuItemUI.java:943)
at java.awt.Component.processMouseEvent(Component.java:5093)
at java.awt.Component.processEvent(Component.java:4890)
at java.awt.Container.processEvent(Container.java:1566)
at java.awt.Component.dispatchEventImpl(Component.java:3598)
at java.awt.Container.dispatchEventImpl(Container.java:1623)
at java.awt.Component.dispatchEvent(Component.java:3439)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3450)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3165)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3095)
at java.awt.Container.dispatchEventImpl(Container.java:1609)
at java.awt.Window.dispatchEventImpl(Window.java:1585)
at java.awt.Component.dispatchEvent(Component.java:3439)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:450)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)

Can you please help me with handling the ArticleResponse? I read in the sources that the return value is the article number and message id and an iterator over the lines of the article. But how can I use this iterator to i.e. print out the article to the console?

Thanks

Carsten Ringe




reply via email to

[Prev in Thread] Current Thread [Next in Thread]