Niklas Gustavsson wrote:
Rory Winston wrote:
Hi Niklas
Done. Thanks
Thanks! The build seems broken at the moment as
org.apache.commons.net.PrintCommandListener is missing. COuld you fix
this or do you produce binaries somewhere?
The attached patch fixes the broken build (still can't get tests to run
but I could build myself a binary :-).
For some reason the PrintCommandListener was deleted in rev 437767 so it
you don't want it in the code, please ignore this patch :-)
/niklas
Index: src/main/java/examples/nntp/ExtendedNNTPOps.java
===================================================================
--- src/main/java/examples/nntp/ExtendedNNTPOps.java (revision 480955)
+++ src/main/java/examples/nntp/ExtendedNNTPOps.java (working copy)
@@ -18,12 +18,13 @@
import java.io.IOException;
import java.io.PrintWriter;
-import org.apache.commons.net.PrintCommandListener;
import org.apache.commons.net.nntp.Article;
import org.apache.commons.net.nntp.NNTPClient;
import org.apache.commons.net.nntp.NewsgroupInfo;
+import examples.PrintCommandListener;
+
/**
* Simple class showing some of the extended commands (AUTH, XOVER, LIST
ACTIVE)
*
Index: src/main/java/examples/nntp/post.java
===================================================================
--- src/main/java/examples/nntp/post.java (revision 480955)
+++ src/main/java/examples/nntp/post.java (working copy)
@@ -23,13 +23,14 @@
import java.io.PrintWriter;
import java.io.Writer;
-import org.apache.commons.net.PrintCommandListener;
import org.apache.commons.net.io.Util;
import org.apache.commons.net.nntp.NNTPClient;
import org.apache.commons.net.nntp.NNTPReply;
import org.apache.commons.net.nntp.SimpleNNTPHeader;
+import examples.PrintCommandListener;
+
/***
* This is an example program using the NNTP package to post an article
* to the specified newsgroup(s). It prompts you for header information and
Index: src/main/java/examples/nntp/MessageThreading.java
===================================================================
--- src/main/java/examples/nntp/MessageThreading.java (revision 480955)
+++ src/main/java/examples/nntp/MessageThreading.java (working copy)
@@ -20,13 +20,14 @@
import java.io.PrintWriter;
import java.net.SocketException;
-import org.apache.commons.net.PrintCommandListener;
import org.apache.commons.net.nntp.Article;
import org.apache.commons.net.nntp.NNTPClient;
import org.apache.commons.net.nntp.NewsgroupInfo;
import org.apache.commons.net.nntp.Threader;
+import examples.PrintCommandListener;
+
public class MessageThreading {
public MessageThreading() {
}
Index: src/main/java/examples/PrintCommandListener.java
===================================================================
--- src/main/java/examples/PrintCommandListener.java (revision 0)
+++ src/main/java/examples/PrintCommandListener.java (revision 0)
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2001-2006 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package examples;
+
+import java.io.PrintWriter;
+import org.apache.commons.net.ProtocolCommandEvent;
+import org.apache.commons.net.ProtocolCommandListener;
+
+/***
+ * This is a support class for some of the example programs. It is
+ * a sample implementation of the ProtocolCommandListener interface
+ * which just prints out to a specified stream all command/reply traffic.
+ * <p>
+ ***/
+
+public class PrintCommandListener implements ProtocolCommandListener
+{
+ private PrintWriter __writer;
+
+ public PrintCommandListener(PrintWriter writer)
+ {
+ __writer = writer;
+ }
+
+ public void protocolCommandSent(ProtocolCommandEvent event)
+ {
+ __writer.print(event.getMessage());
+ __writer.flush();
+ }
+
+ public void protocolReplyReceived(ProtocolCommandEvent event)
+ {
+ __writer.print(event.getMessage());
+ __writer.flush();
+ }
+}
\ No newline at end of file
Property changes on: src\main\java\examples\PrintCommandListener.java
___________________________________________________________________
Name: svn:eol-style
+ native
Index: src/main/java/examples/FTPExample.java
===================================================================
--- src/main/java/examples/FTPExample.java (revision 480955)
+++ src/main/java/examples/FTPExample.java (working copy)
@@ -22,7 +22,6 @@
import java.io.OutputStream;
import java.io.PrintWriter;
-import org.apache.commons.net.PrintCommandListener;
import org.apache.commons.net.ftp.FTP;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPConnectionClosedException;
Index: src/main/java/examples/mail.java
===================================================================
--- src/main/java/examples/mail.java (revision 480955)
+++ src/main/java/examples/mail.java (working copy)
@@ -25,7 +25,6 @@
import java.util.Enumeration;
import java.util.Vector;
-import org.apache.commons.net.PrintCommandListener;
import org.apache.commons.net.io.Util;
import org.apache.commons.net.smtp.SMTPClient;
import org.apache.commons.net.smtp.SMTPReply;
Index: src/main/java/examples/FTPSExample.java
===================================================================
--- src/main/java/examples/FTPSExample.java (revision 480955)
+++ src/main/java/examples/FTPSExample.java (working copy)
@@ -23,7 +23,6 @@
import java.io.PrintWriter;
import java.security.NoSuchAlgorithmException;
-import org.apache.commons.net.PrintCommandListener;
import org.apache.commons.net.ftp.FTP;
import org.apache.commons.net.ftp.FTPConnectionClosedException;
import org.apache.commons.net.ftp.FTPReply;
Index: src/main/java/examples/server2serverFTP.java
===================================================================
--- src/main/java/examples/server2serverFTP.java (revision 480955)
+++ src/main/java/examples/server2serverFTP.java (working copy)
@@ -19,7 +19,6 @@
import java.io.PrintWriter;
import java.net.InetAddress;
-import org.apache.commons.net.PrintCommandListener;
import org.apache.commons.net.ProtocolCommandListener;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPReply;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]