title: Android FTPClient - retrieveFileStream() always returns null
body: <p>I am a newbie to Android. I am trying download a file from ftp server to sdcard using Apache Commons FTPClient. The line    <strong>InputStream input = client.retrieveFileStream("/" + fileName);</strong> always returns null. But the file is there in Ftp location. Kindly help me to know where the mistake is.  </p>
  
  <p>I have set the following permissions in my manifest;   android:name="android.permission.INTERNET" and android:name="android.permission.WRITE_EXTERNAL_STORAGE" </p>
  
  <p><em><strong>My Code</em></strong></p>
  
  <pre><code>private static void downLoad(){
      FTPClient client = new FTPClient();
      FileOutputStream fos = null;
  
      try {
          client.connect("ftp.doamin.com");
          client.login("8888", "8888");
  String filePath = "/mnt/sdcard/download/CheckboxHTML.txt" ;
  String fileName = "CheckboxHTML.txt";
  fos = new FileOutputStream(filePath);
  InputStream input = client.retrieveFileStream("/" + fileName);
  byte[] data = new byte[1024];
  int count  = input.read(data); 
  while ((count = input.read(data)) != -1) {
        fos.write(data, 0, count);
  }
  fos.close();
        if(!client.completePendingCommand()) { 
        client.logout(); 
        client.disconnect(); 
        System.err.println("File transfer failed."); 
  } 
      } catch (SocketException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
      } catch (FileNotFoundException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
      }
  
  }
  </code></pre>
  
  <p>Thanks for your time and interest. Ananth. </p>