private void updateProgress(String resourceName, DownloadData data) {

    if (data.finished) {
      try {
        myIndicator.setIndeterminate(true);
        myIndicator.setText2("Unpacking index");
        return;
      }
      catch (RemoteException e) {
        throw new RuntimeRemoteException(e);
      }
    }

    String prefix = data.failed ? "Failed " : "";

    String sizeInfo;
    if (data.failed || data.total <= 0) {
      sizeInfo = StringUtilRt.formatFileSize(data.downloaded);
    }
    else {
      float fraction = (float)data.downloaded / (float)data.total;
      String percentHumanReadable = String.format("%.2f", fraction * 100.0);
      sizeInfo =
        StringUtilRt.formatFileSize(data.downloaded) + " - " + percentHumanReadable + "% of " + StringUtilRt.formatFileSize(data.total);
    }

    try {
      myIndicator.setText2(MessageFormat.format(prefix + sizeInfo + " [{0}] {1}", data.repository, resourceName));
    }
    catch (RemoteException e) {
      throw new RuntimeRemoteException(e);
    }

    downloadProgress(data.downloaded, data.total);
  }
private void updateProgress(String resourceName, DownloadData data)