4 Replies Latest reply: Jan 7, 2005 11:25 AM by jschellSomeoneStoleMyAlias RSS

    FTP LIST Directory Name with Withespace

    807596
      Hi,

      I am using org.apache.commons.net package to receive files by FTP.

      I want to list a specific directory inside ftp server but I have the following problem :

      I can list directory with name like "abc"

      but I can't list directory with name like "ab c d"

      Here is the code that I am using :
                
                files = ftp.listFiles("\\ab c d\\");
                System.out.println("LENGHT : "+files.length);
                for (int i=0;i<files.length;i++)
                {
                     System.out.println(i+" TEST : "+files);
                }
      files.length ==0 when I use directory name like "ab c d"

      I have used also files = ftp.listFiles("\"\\ab c d\\\"");

      but without success.
      Thanks a lot in advance.

      Adil