title: Dropbox Sync API Android - Updating Cached Files
body: <p>I am facing trouble in updating the existing cached file within my Android Application.<br/></p>
  
  <pre><code>for(DbxFileInfo fInfo : fileList)
  {
      Log.d(TAG, "File Path = "+fInfo.path.toString());
      String fileName = fInfo.path.getName().trim();
  
      try
      {
          DbxPath tempFilePath    = new DbxPath(fInfo.path.toString());
          DbxFile tempFile        = mDbFileSystem.open(tempFilePath);
  
          if(tempFile.getSyncStatus().isCached)
          {
              Log.v(TAG, "File is already cached !");
  
              if(tempFile.getSyncStatus().isLatest)
              {
                  Log.v(TAG, "File's Latest Version is Cached !");
              }
              else
              {
                  Log.v(TAG, "File's Latest Version is not Cached !");
              }
          }
  
          try
          {
              tempFile.getNewerStatus();
          }
          catch(Exception dBException)
          {
              Log.e(TAG, "Error while getting newer Status !");
          }
  
          InputStream input       = new BufferedInputStream(tempFile.getReadStream());
          OutputStream output     = new FileOutputStream(cntx.getFilesDir() + "/SyncedData/" + fileName);
  
          byte data[] = new byte[1024];
          int count;
  
          //total size is in Bytes
          while ((count = input.read(data)) != -1)
          {
              totalBytesDownloaded += count;
              publishProgress((int) (totalBytesDownloaded * 100/totalFileSize));
              output.write(data, 0, count);
          }
  
          output.flush();
          output.close();
          input.close();
          tempFile.close();
          mDbFileSystem.delete(tempFile.getPath());
  
          result = true;
      }
      catch(Exception e)
      {
          Log.e(TAG, "Error occured while downloading files !, Error = "+e.toString());
          result = false;
      }
  }
  </code></pre>
  
  <p>I am putting different files with same names on my Synced Dropbox folder and after Downloading them i am getting the older version of files.<br/>
  Is there any way i can update my existing cached files or Clear the Dropbox Cache (that is within my App)
  Any help is highly appreciated, thanks.</p>