Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
+1 vote
196 views
in edtFTPj by (130 points)
recategorized by

Hello, I extends class FTPControlSocket, but I got some problems. I can't override methods «readLine» and «writeCommand»  (I want add some log logic). I wrote my readLine2.

I see, this method use only in readReply, but for use my readLine2, I need override readReply and use super to call isValidFirstLineOfReply, isNumeric and new com.enterprisedt.net.ftp.FTPReply, but thats methods is private. Then I discovered that I could not override readReply also because of the visibility level.

In the end, for the sake of adding a couple of lines to readline, I had to pull out a lot of code. Is it possible to soften the visibility level on protected?

Added:

At the end I overrided sendCommand:

@Override

public com.enterprisedt.net.ftp.FTPReply sendCommand(String command) throws java.io.IOException, com.enterprisedt.net.ftp.FTPException {

if (log.isTraceEnabled() && trace_socket) {

log.trace("FTP WRITE: {}", command);

}

com.enterprisedt.net.ftp.FTPReply reply = super.sendCommand(command);

if (log.isTraceEnabled() && trace_socket) {

log.trace("FTP READ: {}", reply.getRawReply());

}

// and read the result

return reply;

}

So my problem has been resolved, however other users may have problems if they need to change the behavior of socket.

by (161k points)
You want ReadLine() and WriteCOmmand() to be protected?
by (161k points)
Any more news on this?

Please log in or register to answer this question.

Categories

...