Package org.apache.maven.repository

Examples of org.apache.maven.repository.ArtifactTransferResource


        doCompleted( transferEvent );
    }

    protected void doCompleted( ArtifactTransferEvent transferEvent )
    {
        ArtifactTransferResource artifact = transferEvent.getResource();
        long contentLength = transferEvent.getTransferredBytes();
        if ( contentLength >= 0 )
        {
            String type =
                ( transferEvent.getRequestType() == ArtifactTransferEvent.REQUEST_PUT ? "uploaded" : "downloaded" );
            String l = contentLength >= 1024 ? toKB( contentLength ) + " KB" : contentLength + " B";

            String throughput = "";
            long duration = System.currentTimeMillis() - artifact.getTransferStartTime();
            if ( duration > 0 )
            {
                DecimalFormat format = new DecimalFormat( "0.0", new DecimalFormatSymbols( Locale.ENGLISH ) );
                double kbPerSec = ( contentLength / 1024.0 ) / ( duration / 1000.0 );
                throughput = " at " + format.format( kbPerSec ) + " KB/sec";
View Full Code Here

TOP

Related Classes of org.apache.maven.repository.ArtifactTransferResource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.