title: apache commons net - completependingcommand returning false
body: <p>I am using the apache commons net library to get a file from FTP server.</p>
  
  <p>I don't need to download the whole file but just to read the headers to determine the file size.  The library I am using to do this is <a href="http://drewnoakes.com/code/exif/" rel="nofollow">metadata extractor</a> </p>
  
  <p>The problem is that when I call <strong>client.completePendingCommand()</strong> it always returns false - however the date variable is printed correctly.  I have asked the developer of metadata extractor and he doesn't know why its returning false.  Anyone have an explanation? I'm not sure if it is ok just to ignore the false?</p>
  
  <pre><code>FTPClient client = new FTPHTTPClient(proxy settings);
  InputStream stream = null;
  try {
          client.connect(FTPProperties.getInstance().getProperty("ftp.server"));
          client.login(FTPProperties.getInstance().getProperty("ftp.username"), FTPProperties.getInstance().getProperty("ftp.password"));
          client.enterLocalPassiveMode();
  
          for (String path : paths) { //paths are the jpeg files to download
              try {
                  stream = client.retrieveFileStream(p);
  
                  Metadata metadata = ImageMetadataReader.readMetadata(stream);
                  Directory directory = metadata.getDirectory(ExifSubIFDDirectory.class);
                  Date date = directory.getDate(ExifSubIFDDirectory.TAG_DATETIME_ORIGINAL);
                  System.out.println("DATE " + date);
              } catch (IOException ex) {
                  Logger.getLogger(UploadImage.class.getName()).log(Level.SEVERE, null, ex);
              } finally {
                  if(stream != null) {
                    stream.close();
                  }
                  if (in != null) {
                      in.close();
                  }
                  if (!client.completePendingCommand()) {
                       Logger.getLogger("Error");
                  }
              }
          }
      } catch (Exception ex) {
          Logger.getLogger(UploadImage.class.getName()).log(Level.SEVERE, null, ex);
      } finally {
          if (client != null &amp;&amp; client.isConnected()) {
              client.disconnect();
          }
      }
  </code></pre>