* @see org.sonatype.aether.util.listener.AbstractTransferListener#transferSucceeded
* (org.sonatype.aether.transfer.TransferEvent)
*/
@Override
public void transferSucceeded(TransferEvent event) {
TransferResource resource = event.getResource();
downloads.remove(resource);
long contentLength = event.getTransferredBytes();
if (contentLength >= 0) {
long duration = System.currentTimeMillis() - resource.getTransferStartTime();
double kbPerSec = (contentLength / 1024.0) / (duration / 1000.0);
StringBuilder sb = new StringBuilder().append("Completed")
.append(event.getRequestType() == TransferEvent.RequestType.PUT ? " upload of " : " download of ")
.append(resource.getResourceName())
.append(event.getRequestType() == TransferEvent.RequestType.PUT ? " into " : " from ")
.append(resource.getRepositoryUrl()).append(", transferred ")
.append(contentLength >= 1024 ? toKB(contentLength) + " KB" : contentLength + " B").append(" at ")
.append(new DecimalFormat("0.0", new DecimalFormatSymbols(Locale.ENGLISH)).format(kbPerSec))
.append("KB/sec");
log.fine(sb.toString());