import sun.net.ftp.FtpClient; import java.io.IOException; import java.util.Enumeration; public class DebugFtpClient extends FtpClient { public DebugFtpClient(String s, int port) throws IOException { super(s, port); } public DebugFtpClient(String s) throws IOException { super(s); } public DebugFtpClient() throws IOException { super(); } // all client commands are sent through here public int issueCommand(String cmd) throws IOException { System.err.println(cmd); return super.issueCommand(cmd); } public int readServerResponse() throws IOException { int result = super.readServerResponse(); for (Enumeration e = serverResponse.elements() ; e.hasMoreElements() ;) { System.out.println(e.nextElement()); } return result; } }