private static int printProgress(String str, long received,
      long advertisedSize, int lastPrinted) {
    if (advertisedSize == 0)
      return 0;
    int currentPercent = (int) ((received * 100) / advertisedSize);
    if (currentPercent != lastPrinted)
      FLOG.info("Downloading: " + str + ", completed: " + currentPercent);
    return currentPercent;
  }
private static int printProgress ( String str , long received , long advertisedSize , int lastPrinted ) { if ( advertisedSize == 0 ) return 0 ; int currentPercent = ( int ) ( ( received * 100 ) / advertisedSize ) ; if ( currentPercent != lastPrinted ) FLOG . info ( "Downloading: " + str + ", completed: " + currentPercent ) ; return currentPercent ; }
Print progress when downloading files.