commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ts...@free.fr
Subject Re: [FTPClient] ftpclient.getFTPFile(String path) ?
Date Thu, 08 Jun 2006 08:04:49 GMT
> Hello,
>
> Is there a way to get a FTPFile directly by using a path ?
>
> Actually, I do this :
>
> public FTPFile getFtpFileFrom(String path) {
>   try {
>     ftpclient.changeWorkingDirectory(path) ;
>     FTPFile[] tabFtpFiles = ftpclient.listFiles() ;
>   } catch(....) {....}
>
>   for (int i=0;i<tabFtpFiles.length;++i) {
>     if ( tabFtpFiles[i].getName().equals(myNameFileToGet) ) return
> tabFtpFiles[i];
>   }
>
>   return null;
> }

just a little error :
public FTPFile getFtpFileFrom(String path , String myNameFileToGet) {...}

sorry,
Florent

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