title: FTPClient showing empty folder when it has files
body: <p>I am using Apache Commons net FTPClient to login and read files from an FTP Server. I manage to login and I can see it logs in successfully, because it shows the working directory path in the header string. However it shows no files when I use <code>listFiles()</code>. (I have also tried using <code>listDirectories()</code> and <code>listNames()</code> but with no success)
  Below is a snippet:</p>
  
  <pre><code>try {
          client.connect(ftpHost);
      } /*catch (SocketException e1) {
          // TODO Auto-generated catch block
          e1.printStackTrace();
      }*/ catch (IOException ex) {
          // TODO Auto-generated catch block
          ex.printStackTrace();
      }
  
  
      String header ="";
      InputStream stream=null;
      BufferedReader reader=null;
      try{
          client.login(ftpUser, ftpPass);
          client.changeWorkingDirectory(targetWorkingDir);
          header = client.printWorkingDirectory();
          //client.setFileType(FTP.BINARY_FILE_TYPE);
          for(int i=0; i&lt;client.listFiles().length;i++){
              header+=client.listFiles()[i].getName() +"\n";
          }
  
      }
      catch (IOException ex){
          ex.printStackTrace();
          header="ERROR 1: " + ex.getMessage();
          for(int i=0;i&lt;ex.getStackTrace().length;i++){
              header += "\n" + ex.getStackTrace()[i];
          }
      }
      catch(NullPointerException e){
          header = "ERROR 2: "+ e.getMessage()+"\n";
          for(int i=0;i&lt;e.getStackTrace().length;i++){
              header+= e.getStackTrace()[i] + "\n";
          }
      }
      finally{
          if(reader!=null){
              try{reader.close();}catch(IOException e){e.printStackTrace();}
              try{stream.close();}catch(IOException e){e.printStackTrace();}
          }
      }
  </code></pre>
  
  <p>I have also tried using something like this to read a file:</p>
  
  <pre><code>try {
      stream = ftpClient.retrieveFileStream("klasa.csv");
      reader = new BufferedReader(new InputStreamReader(stream));
      header = reader.readLine();
  } finally {
      if (reader != null) try { reader.close(); } catch (IOException logOrIgnore){}
  }
  </code></pre>
  
  <p>In both cases I'm pretty sure I'm at the right directory, and I make sure that my file is there via FileZilla, but the client can't seem to read any file.</p>