@@ -0,0 +1,1941 @@
+// Copyright 2016 The Bazel Authors. All rights reserved.%0A//%0A// Licensed under the Apache License, Version 2.0 (the %22License%22);%0A// you may not use this file except in compliance with the License.%0A// You may obtain a copy of the License at%0A//%0A//    http://www.apache.org/licenses/LICENSE-2.0%0A//%0A// Unless required by applicable law or agreed to in writing, software%0A// distributed under the License is distributed on an %22AS IS%22 BASIS,%0A// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A// See the License for the specific language governing permissions and%0A// limitations under the License.%0A%0Apackage com.google.devtools.build.lib.bazel.repository.downloader;%0A%0Aimport com.google.devtools.build.lib.events.ExtendedEventHandler;%0Aimport java.net.URL;%0A%0A/**%0A * Postable event reporting on progress made downloading an URL. It can be used to report the URL%0A * being downloaded and the number of bytes read so far.%0A */%0Apublic class DownloadProgressEvent implements ExtendedEventHandler.ProgressLike %7B%0A  private final URL originalUrl;%0A  private final URL actualUrl;%0A  private final long bytesRead;%0A  private final boolean downloadFinished;%0A%0A  public DownloadProgressEvent(URL originalUrl, URL actualUrl, long bytesRead, boolean finished) %7B%0A    this.originalUrl = originalUrl;%0A    this.actualUrl = actualUrl;%0A    this.bytesRead = bytesRead;%0A    this.downloadFinished = finished;%0A  %7D%0A%0A  public DownloadProgressEvent(URL originalUrl, long bytesRead, boolean finished) %7B%0A    this(originalUrl, null, bytesRead, finished);%0A  %7D%0A%0A  public DownloadProgressEvent(URL url, long bytesRead) %7B%0A    this(url, bytesRead, false);%0A  %7D%0A%0A  public DownloadProgressEvent(URL url) %7B%0A    this(url, 0);%0A  %7D%0A%0A  public URL getOriginalUrl() %7B%0A    return originalUrl;%0A  %7D%0A%0A  public URL getActualUrl() %7B%0A    return actualUrl;%0A  %7D%0A%0A  public boolean isFinished() %7B%0A    return downloadFinished;%0A  %7D%0A%0A  public long getBytesRead() %7B%0A    return bytesRead;%0A  %7D%0A%7D%0A

Add an event reporting about downloading progress