commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anil Philip <goodnewsfor...@yahoo.com>
Subject [commons ftp] help! FTPClient.isConnected() does not work.
Date Sat, 28 Oct 2006 22:54:10 GMT
In my code, I do:

if(!ftpClient.isConnected()) {
...not connected, so connect to server
}



However, when there is a timeout and the connection is
closed,
FTPClient.isConnected() incorrectly returns true. So
that the if is never entered,
but this exception is thrown when the connection is
assumed to be open, and used.

org.apache.commons.net.ftp.FTPConnectionClosedException:
FTP response 421 received.  Server
closed connection.
	at
org.apache.commons.net.ftp.FTP.__getReply(FTP.java:321)
	at
org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:460)
	at
org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:520)
	at
org.apache.commons.net.ftp.FTP.sendCommand(FTP.java:569)
	at org.apache.commons.net.ftp.FTP.pwd(FTP.java:1248)
	at
org.apache.commons.net.ftp.FTPClient.printWorkingDirectory(FTPClient.java:1809)


Is this a bug?

thanks,
Anil Philip


 
__________________________________________________________________________________________
Check out the New Yahoo! Mail - Fire up a more powerful email and get things done faster.

(http://advision.webevents.yahoo.com/mailbeta) 


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message