Hello,

I meet a problem when using FTPClient.listFiles(String pathname) with a
space-char inside pathname.
I looked at the problem and i saw that many ftp clients implements this
function like :
CWD target_dir
LIST
instead of
LIST target_dir

So i replaced into [org.apache.commons.net.ftp.FTPClient]
   public FTPFile[] listFiles(String pathname)
   throws IOException
   {
       String key = null;
       FTPListParseEngine engine =
           initiateListParsing(key, pathname);
       return engine.getFiles();
   }

with

   public FTPFile[] listFiles(String pathname)
   throws IOException
   {
       String currentWorkingDirectory = this.printWorkingDirectory();
       this.cwd(pathname);
       pathname = null;
       String key = null;
       FTPListParseEngine engine =
           initiateListParsing(key, pathname);
       FTPFile[] result = engine.getFiles();
       this.cwd(currentWorkingDirectory);
       return result;
   }


And the result is better like this...

Reply via email to