本文整理汇总了Java中org.sonatype.aether.transfer.TransferEvent.getRequestType方法的典型用法代码示例。如果您正苦于以下问题:Java TransferEvent.getRequestType方法的具体用法?Java TransferEvent.getRequestType怎么用?Java TransferEvent.getRequestType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.sonatype.aether.transfer.TransferEvent
的用法示例。
在下文中一共展示了TransferEvent.getRequestType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 + ")");
}
}
示例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 + ")");
}
}
示例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);
}
}
示例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 + ")");
}
}
示例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 + ")" );
}
}
示例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 + ")" );
}
}
示例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 + ")" );
}
}
示例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 + ")" );
}
}
示例9: transferInitiated
import org.sonatype.aether.transfer.TransferEvent; //导入方法依赖的package包/类
@Override
public void transferInitiated(TransferEvent event) {
String message =
event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploading" : "Downloading";
logger.info(message + ": " + event.getResource().getRepositoryUrl()
+ event.getResource().getResourceName());
}
示例10: transferInitiated
import org.sonatype.aether.transfer.TransferEvent; //导入方法依赖的package包/类
@Override
public void transferInitiated(TransferEvent event)
{
String message = event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploading" : "Downloading";
logger.debug(message + ": " + event.getResource().getRepositoryUrl() + event.getResource().getResourceName());
}
示例11: transferInitiated
import org.sonatype.aether.transfer.TransferEvent; //导入方法依赖的package包/类
@Override
public void transferInitiated(TransferEvent event)
{
String message = event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploading"
: "Downloading";
log.info(message + ": " + event.getResource().getRepositoryUrl()
+ event.getResource().getResourceName());
}
示例12: transferInitiated
import org.sonatype.aether.transfer.TransferEvent; //导入方法依赖的package包/类
@Override
public void transferInitiated( TransferEvent event )
{
String message = event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploading" : "Downloading";
out.println( message + ": " + event.getResource().getRepositoryUrl() + event.getResource().getResourceName() );
}
示例13: transferInitiated
import org.sonatype.aether.transfer.TransferEvent; //导入方法依赖的package包/类
@Override
public void transferInitiated( TransferEvent event )
{
String message = event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploading" : "Downloading";
out.info( message + ": " + event.getResource().getRepositoryUrl() + event.getResource().getResourceName() );
}
示例14: transferInitiated
import org.sonatype.aether.transfer.TransferEvent; //导入方法依赖的package包/类
@Override
public void transferInitiated( TransferEvent event )
{
String message = event.getRequestType() == TransferEvent.RequestType.PUT ? "Uploading" : "Downloading";
println( "transferInitiated", message + ": " + event.getResource().getRepositoryUrl() + event.getResource().getResourceName() );
}
示例15: transferInitiated
import org.sonatype.aether.transfer.TransferEvent; //导入方法依赖的package包/类
public void transferInitiated(TransferEvent event) {
String message = event.getRequestType() == RequestType.PUT ? "Uploading: {} to repository {} at {}" : "Downloading: {} from repository {} at {}";
LOGGER.info(message, event.getResource().getResourceName(), "remote", event.getResource().getRepositoryUrl());
}