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....
LVL 6
SamsonChungAsked:
Who is Participating?
 
mrcoffee365Connect With a Mentor Commented:
Yes, so you want an application which will successfully read an nntp transmission.  The code for james is open source, so you can get the source and look at how they do it.  By reading the dialogs and attachments from an nntp server, you are performing the main tasks of an nntp server.

If you want to look at different examples, you can check the Mozilla open source browser code for reading the input stream from an nntp server -- but that's not in Java.
0
 
mrcoffee365Commented:
Have you looked at James, the NNTP and POP3 server from Apache?
http://james.apache.org/
0
 
SamsonChungAuthor Commented:
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.

0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
mrcoffee365Commented:
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
0
 
Ajay-SinghCommented:
0
 
mrcoffee365Commented:
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.
0
 
SamsonChungAuthor Commented:
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.
0
 
mrcoffee365Commented:
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.
0
 
SamsonChungAuthor Commented:
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.

0
 
SamsonChungAuthor Commented:
remove not,

I am NOW stuck at....

0
 
mrcoffee365Commented:
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!
0
All Courses

From novice to tech pro — start learning today.