1 16 package examples; 17 18 import java.io.PrintWriter ; 19 import org.apache.commons.net.ProtocolCommandEvent; 20 import org.apache.commons.net.ProtocolCommandListener; 21 22 28 29 public class PrintCommandListener implements ProtocolCommandListener 30 { 31 private PrintWriter __writer; 32 33 public PrintCommandListener(PrintWriter writer) 34 { 35 __writer = writer; 36 } 37 38 public void protocolCommandSent(ProtocolCommandEvent event) 39 { 40 __writer.print(event.getMessage()); 41 __writer.flush(); 42 } 43 44 public void protocolReplyReceived(ProtocolCommandEvent event) 45 { 46 __writer.print(event.getMessage()); 47 __writer.flush(); 48 } 49 } 50 | Popular Tags |