cleanup and fix logging

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1539524 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2013-11-07 05:23:08 +00:00
parent db38728d12
commit dbc237dc03
1 changed files with 1 additions and 54 deletions

View File

@ -278,59 +278,6 @@ public class DownloadRemoteIndexTask
}
}
/*
private static final class DownloadListener
implements TransferListener
{
private Logger log = LoggerFactory.getLogger( getClass() );
private String resourceName;
private long startTime;
private int totalLength = 0;
public void transferInitiated( TransferEvent transferEvent )
{
startTime = System.currentTimeMillis();
resourceName = transferEvent.getResource().getName();
log.debug( "initiate transfer of {}", resourceName );
}
public void transferStarted( TransferEvent transferEvent )
{
this.totalLength = 0;
resourceName = transferEvent.getResource().getName();
log.info( "start transfer of {}", transferEvent.getResource().getName() );
}
public void transferProgress( TransferEvent transferEvent, byte[] buffer, int length )
{
log.debug( "transfer of {} : {}/{}", transferEvent.getResource().getName(), buffer.length, length );
this.totalLength += length;
}
public void transferCompleted( TransferEvent transferEvent )
{
resourceName = transferEvent.getResource().getName();
long endTime = System.currentTimeMillis();
log.info( "end of transfer file {} {} kb: {}s", transferEvent.getResource().getName(),
this.totalLength / 1024, ( endTime - startTime ) / 1000 );
}
public void transferError( TransferEvent transferEvent )
{
log.info( "error of transfer file {}: {}", transferEvent.getResource().getName(),
transferEvent.getException().getMessage(), transferEvent.getException() );
}
public void debug( String message )
{
log.debug( "transfer debug {}", message );
}
}
*/
private static class ZeroCopyConsumerListener
extends ZeroCopyConsumer
{
@ -388,7 +335,7 @@ public class DownloadRemoteIndexTask
this.startTime = System.currentTimeMillis();
super.onResponseReceived( response );
this.totalLength = response.getEntity().getContentLength();
log.info( "start transfer of {}, contentLength: {}", resourceName, this.totalLength );
log.info( "start transfer of {}, contentLength: {}", resourceName, this.totalLength / 1024 );
}
@Override