better output of the transferListener for remote index download

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1176041 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2011-09-26 20:35:59 +00:00
parent d9c293217c
commit ae7be0e049
1 changed files with 13 additions and 3 deletions

View File

@ -271,14 +271,21 @@ public class DownloadRemoteIndexTask
{
private Logger log = LoggerFactory.getLogger( getClass() );
String reourceName;
long startTime;
public void transferInitiated( TransferEvent transferEvent )
{
log.debug( "initiate transfer of {}", transferEvent.getResource().getName() );
reourceName = transferEvent.getResource().getName();
log.debug( "initiate transfer of {}", reourceName );
}
public void transferStarted( TransferEvent transferEvent )
{
log.debug( "start transfer of {}", transferEvent.getResource().getName() );
reourceName = transferEvent.getResource().getName();
startTime = System.currentTimeMillis();
log.info( "start transfer of {}", transferEvent.getResource().getName() );
}
public void transferProgress( TransferEvent transferEvent, byte[] buffer, int length )
@ -289,7 +296,10 @@ public class DownloadRemoteIndexTask
public void transferCompleted( TransferEvent transferEvent )
{
log.info( "end of transfer file " + transferEvent.getResource().getName() );
reourceName = transferEvent.getResource().getName();
long endTime = System.currentTimeMillis();
log.info( "end of transfer file {}: {}s", transferEvent.getResource().getName(),
( endTime - startTime ) / 1000 );
}
public void transferError( TransferEvent transferEvent )