commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ts...@free.fr
Subject [FTPClient] ftpclient.getFTPFile(String path) ?
Date Thu, 08 Jun 2006 08:01:38 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;
}

not seem to be the best way...

thank you for your help
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