commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pandit" <pandith...@hotmail.com>
Subject File exists or not
Date Fri, 02 Jan 2004 13:54:03 GMT
Hi all,

I'm trying to retrive a file from a FTP server.  Before, retrieving I need
to check if the file exists.  How should I do this?

I tried using this,


FTPFile list[] = getFTPClient().listFiles(fileName);

if ( list != null ) {

exists = true;

}

But this doesn't seems to work.  Even though the file doesn't exists, the
variable "list" isn't null.  This logic doesn't seems to work.  Could
someone guide me how I need to code if I need to verify if the file exists
or not?



Thanks in advance,

Pandit.

---------------------------------------------------------------------
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