当前位置: 首页>>代码示例>>Java>>正文


Java TransferEvent.getTransferredBytes方法代码示例

本文整理汇总了Java中org.sonatype.aether.transfer.TransferEvent.getTransferredBytes方法的典型用法代码示例。如果您正苦于以下问题:Java TransferEvent.getTransferredBytes方法的具体用法?Java TransferEvent.getTransferredBytes怎么用?Java TransferEvent.getTransferredBytes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.sonatype.aether.transfer.TransferEvent的用法示例。


在下文中一共展示了TransferEvent.getTransferredBytes方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: transferSucceeded

import org.sonatype.aether.transfer.TransferEvent; //导入方法依赖的package包/类
@Override
public void transferSucceeded(TransferEvent event) {
  transferCompleted(event);

  TransferResource resource = event.getResource();
  long contentLength = event.getTransferredBytes();
  if (contentLength >= 0) {
    String type =
        (event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploaded" : "Downloaded");
    String len = contentLength >= 1024 ? toKB(contentLength) + " KB" : contentLength + " B";

    String throughput = "";
    long duration = System.currentTimeMillis() - resource.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";
    }

    logger.info(type + ": " + resource.getRepositoryUrl() + resource.getResourceName() + " ("
        + len + throughput + ")");
  }
}
 
开发者ID:lorthos,项目名称:incubator-zeppelin-druid,代码行数:24,代码来源:TransferListener.java

示例2: transferSucceeded

import org.sonatype.aether.transfer.TransferEvent; //导入方法依赖的package包/类
@Override
public void transferSucceeded(TransferEvent event)
{
    TransferResource resource = event.getResource();
    long contentLength = event.getTransferredBytes();
    if (contentLength >= 0) {
        String type = (event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploaded" : "Downloaded");
        String len = contentLength >= 1024 ? toKB(contentLength) + " KB" : contentLength + " B";

        String throughput = "";
        long duration = System.currentTimeMillis() - resource.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";
        }

        logger.debug(type + ": " + resource.getRepositoryUrl() + resource.getResourceName() + " (" + len + throughput + ")");
    }
}
 
开发者ID:airlift,项目名称:resolver,代码行数:21,代码来源:ConsoleTransferListener.java

示例3: transferSucceeded

import org.sonatype.aether.transfer.TransferEvent; //导入方法依赖的package包/类
@Override
public void transferSucceeded( TransferEvent event )
{
	transferCompleted( event );

	TransferResource resource = event.getResource();
	long contentLength = event.getTransferredBytes();
	if ( contentLength >= 0 )
	{
		String type = ( event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploaded" : "Downloaded" );
		String len = contentLength >= 1024 ? toKB( contentLength ) + " KB" : contentLength + " B";

		String throughput = "";
		long duration = System.currentTimeMillis() - resource.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";
		}

		log.info("{}: {}{} ({} {})", type, resource.getRepositoryUrl(), resource.getResourceName(), len, throughput);
	}
}
 
开发者ID:bnavetta,项目名称:tycho-gen,代码行数:25,代码来源:LoggingTransferListener.java

示例4: transferSucceeded

import org.sonatype.aether.transfer.TransferEvent; //导入方法依赖的package包/类
@Override
public void transferSucceeded(TransferEvent event)
{
  transferCompleted(event);

  TransferResource resource = event.getResource();
  long contentLength = event.getTransferredBytes();
  if (contentLength >= 0)
  {
    String type = ( event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploaded"
        : "Downloaded" );
    String len = contentLength >= 1024 ? toKB(contentLength) + " KB" : contentLength + " B";

    String throughput = "";
    long duration = System.currentTimeMillis() - resource.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";
    }

    log.info(type + ": " + resource.getRepositoryUrl() + resource.getResourceName() + " (" + len
        + throughput + ")");
  }
}
 
开发者ID:terraframe,项目名称:Runway-SDK,代码行数:27,代码来源:TransferListener.java

示例5: transferSucceeded

import org.sonatype.aether.transfer.TransferEvent; //导入方法依赖的package包/类
@Override
public void transferSucceeded( TransferEvent event )
{
    TransferResource resource = event.getResource();
    long contentLength = event.getTransferredBytes();
    if ( contentLength >= 0 )
    {
        String type = ( event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploaded" : "Downloaded" );
        String len = contentLength >= 1024 ? toKB( contentLength ) + " KB" : contentLength + " B";

        String throughput = "";
        long duration = System.currentTimeMillis() - resource.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";
        }

        out.println( type + ": " + resource.getRepositoryUrl() + resource.getResourceName() + " (" + len
            + throughput + ")" );
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:24,代码来源:AbstractMavenTransferListener.java

示例6: transferSucceeded

import org.sonatype.aether.transfer.TransferEvent; //导入方法依赖的package包/类
@Override
public void transferSucceeded( TransferEvent event )
{
    TransferResource resource = event.getResource();
    long contentLength = event.getTransferredBytes();
    if ( contentLength >= 0 )
    {
        String type = ( event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploaded" : "Downloaded" );
        String len = contentLength >= 1024 ? toKB( contentLength ) + " KB" : contentLength + " B";

        String throughput = "";
        long duration = System.currentTimeMillis() - resource.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";
        }

        out.info( type + ": " + resource.getRepositoryUrl() + resource.getResourceName() + " (" + len
            + throughput + ")" );
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:24,代码来源:Slf4jMavenTransferListener.java

示例7: transferSucceeded

import org.sonatype.aether.transfer.TransferEvent; //导入方法依赖的package包/类
@Override
public void transferSucceeded( TransferEvent event )
{
    transferCompleted( event );

    TransferResource resource = event.getResource();
    long contentLength = event.getTransferredBytes();
    if ( contentLength >= 0 )
    {
        String type = ( event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploaded" : "Downloaded" );
        String len = contentLength >= 1024 ? toKB( contentLength ) + " KB" : contentLength + " B";

        String throughput = "";
        long duration = System.currentTimeMillis() - resource.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";
        }

        println( "transferSucceeded", type + ": " + resource.getRepositoryUrl() + resource.getResourceName() + " ("
            + len + throughput + ")" );
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:26,代码来源:ConsoleTransferListener.java

示例8: transferSucceeded

import org.sonatype.aether.transfer.TransferEvent; //导入方法依赖的package包/类
@Override
public void transferSucceeded( TransferEvent event )
{
    transferCompleted( event );

    TransferResource resource = event.getResource();
    long contentLength = event.getTransferredBytes();
    if ( contentLength >= 0 )
    {
        String type = ( event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploaded" : "Downloaded" );
        String len = contentLength >= 1024 ? toKB( contentLength ) + " KB" : contentLength + " B";

        String throughput = "";
        long duration = System.currentTimeMillis() - resource.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";
        }

        out.println( type + ": " + resource.getRepositoryUrl() + resource.getResourceName() + " (" + len
            + throughput + ")" );
    }
}
 
开发者ID:cloudbees,项目名称:bees-maven-components,代码行数:26,代码来源:ConsoleTransferListener.java


注:本文中的org.sonatype.aether.transfer.TransferEvent.getTransferredBytes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。