Link to home
Start Free TrialLog in
Avatar of SamsonChung
SamsonChungFlag for Canada

asked on

Java with NNTP and MySQL

Hello,

I want to write a program in Java that has the ability to read from any NNTP server and their news groups. Read the posts, and put the attachments, if any, into the local drive. Then write a record indicating this has occurred.

Of course the program would be smart enough to detect which posts are new, only only read the new ones.

My problem is that there doesn't seem to be a easy to use NNTP class for Java.... Am I searching for the wrong thing?

the Java Mail API doesn't support this anymore, and project Knife is no longer active.

Please give me a hand....
Avatar of mrcoffee365
mrcoffee365
Flag of United States of America image

Have you looked at James, the NNTP and POP3 server from Apache?
http://james.apache.org/
Avatar of SamsonChung

ASKER

I don't own the NNTP server... nor am I hosting it..

I just want the ability to record dialogs and attachments on a News Server and put them into a DB.

ASKER CERTIFIED SOLUTION
Avatar of mrcoffee365
mrcoffee365
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Just searching for nntp and Java, I found this example of an NNTP client written in Java -- that's another way to get started.
http://www.devdaily.com/java/jwarehouse/commons-net-1.2.2/src/java/org/apache/commons/net/nntp/NNTPClient.java.shtml
Avatar of Ajay-Singh
Ajay-Singh

Ajay-Singh -- I agree, the gnu JavaMail seems like a reasonable possibility.  Sun's Java mail library has deprecated the nntp connection, as SamsonChung mentioned above.
Mrcoffee,

I was reading that page.... it is a copy of the Apache's version, which requires a dozen of Apache specialized class files....

Sigh, I think I might have to write it completely on my own.
A lot of people do write their own custom reader of nntp.  If you think that your NNTP feed will be fairly standard, then it might not be bad to write your own feeder.

On the other hand, it seems a shame to reinvent the wheel, when all you have to do is get some Apache classes.  Totally up to you, of course.
Hey Mr coffee,

I've decided to 'NOT' write my own NNTP client.. infact, I'll use the one you suggested. the Apache one..

I am not stuck at, locating the jar file for org.apache.commons.net

Is there a way I can do this without hunting down the java files? Like Via Eclipse?? Or a place for downloading the source to apache.

remove not,

I am NOW stuck at....

I think it's a better idea to use apache code instead of writing your own.

You have to get the jars -- Eclipse doesn't know more than you do.

The way to find jars on the Web is to put "org.apache.commons.net" into Google, and follow the obvious links.  I did that and the first link was to the change notes page for Apache Commons/Net.  The download link on that page led here:
http://commons.apache.org/net/download.html

Good luck!