You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by hb...@apache.org on 2002/03/30 08:34:12 UTC
cvs commit: jakarta-james/src/java/org/apache/james/testing NNTPClient.test NNTPClient.java
hbedi 02/03/29 23:34:12
Added: src/java/org/apache/james/testing NNTPClient.test
Removed: src/java/org/apache/james/testing NNTPClient.java
Log:
nntp test was using Sun's internal classes. Renamed the file to avoid build failure with JDK 1.4
Revision Changes Path
1.1 jakarta-james/src/java/org/apache/james/testing/NNTPClient.test
Index: NNTPClient.test
===================================================================
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE file.
*/
package org.apache.james.testing;
import org.apache.avalon.excalibur.io.IOUtil;
import sun.net.nntp.NewsgroupInfo;
import sun.net.nntp.NntpClient;
import java.io.File;
import java.io.FileOutputStream;
/**
* @author Harmeet <hb...@apache.org>
* note this file uses sun's internal API. This does not exist in JDK 1.4.
*/
public class NNTPClient {
public static void main(String[] args) throws Exception {
String server = args[0];
String group = args[1];
NntpClient nntp = new NntpClient(server);
NewsgroupInfo info = nntp.getGroup(group);
System.out.println("newsgroup: "+group+", "+info.firstArticle+", "+
info.lastArticle);
File f = new File(group);
f.mkdirs();
for ( int i = 0 ; i < 10 ; i++ ) {
int articleId = i+info.firstArticle;
if ( articleId > info.lastArticle )
break;
IOUtil.copy(nntp.getArticle(articleId),
new FileOutputStream(new File(f,articleId+"")));
}
}
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>