title: Primefaces progress bar live update
body: <p>I am currently trying to incorporate a progress bar into my application to display the current progress of a task. The task, retrieves a file from a server using a web service. i do not have access to this web service and therefore cannot put any code inside it. </p>
  
  <p>My code is as follows:</p>
  
  <p>The method which I need to display progress of:</p>
  
  <pre><code>    public URL checkout(String docCid, String fileCid)
  {
      String userId="aaaaaa";
  
  
      FVConnectData fvData = new FVConnectData();
      fvData.setWsKeyword("aaaaa");
      fvData.setWsUrl("http://aaaaa.com");
      FVConnector con = new FVConnector(fvData);
      System.out.println("Method checkout called");
  
      URL url = null;
      try
      {
         //This is where the web service is called
         url = con.checkoutFile(docCid, fileCid, userId, "aaaa", "aaaa", false);
         System.out.println("URL: " + url.toString());
  
  
         return url;
      }
      catch (Exception e)
      {
  
         System.out.println("ERROR: " + e.getMessage());
         e.printStackTrace();
  
         return null;
      }
  
  }
  </code></pre>
  
  <p>My question is this:</p>
  
  <p>How can I adapt this method in order to provide my primefaces GUI with the live progress of the method to display to the user? </p>
  
  <p>EDIT:</p>
  
  <p>The only real examples I have found online use a random progress to display on the progress bar. I do not want this, I want the true (or close enough) progress. Also due to not being able to access the web service, I am unable to determine the size of the file before hand.</p>