org.commonjava.maven.galley.model.Transfer.getPath()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(140)

本文整理了Java中org.commonjava.maven.galley.model.Transfer.getPath()方法的一些代码示例,展示了Transfer.getPath()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Transfer.getPath()方法的具体详情如下:
包路径:org.commonjava.maven.galley.model.Transfer
类名称:Transfer
方法名:getPath

Transfer.getPath介绍

暂无

代码示例

代码示例来源:origin: org.commonjava.aprox/aprox-promote-common

@Override
public String getPath()
{
  return delegate.getPath();
}

代码示例来源:origin: org.commonjava.maven.galley/galley-transport-filearc

protected AbstractZipOperation( final Transfer transfer )
{
  this( transfer.getLocation(), transfer.getPath() );
  this.transfer = transfer;
}

代码示例来源:origin: org.commonjava.indy/indy-core

private String generateCacheKey( final Transfer transfer )
{
  KeyedLocation kl = (KeyedLocation) transfer.getLocation();
  return kl.getKey() + "#" + transfer.getPath();
}

代码示例来源:origin: org.commonjava.maven.galley/galley-core

@Override
public SpecialPathInfo getSpecialPathInfo( Transfer transfer, String pkgType )
{
  if ( transfer != null )
  {
    return getSpecialPathInfo( transfer.getLocation(), transfer.getPath(), pkgType );
  }
  // TODO: Return SpecialPathConstants.DEFAULT_FILE or SpecialPathConstants.DEFAULT_DIR or something non-null?
  return null;
}

代码示例来源:origin: org.commonjava.indy/indy-core

public void onFileDeletionEvent( @Observes final FileDeletionEvent event )
{
  final StoreKey key = getKey( event );
  if ( key != null )
  {
    deleteExpiration( key, event.getTransfer().getPath() );
  }
}

代码示例来源:origin: org.commonjava.aprox/aprox-depgraph-common

public void handleFileAccessEvent( @Observes final FileAccessEvent event )
  {
    if ( !config.isPassiveParsingEnabled() )
    {
      return;
    }

    if ( !event.getTransfer()
          .getPath()
          .endsWith( ".pom" ) )
    {
      return;
    }

    logger.info( "[SUBMIT] DepgraphStorageListenerRunnable for: {}", event );

    executor.execute( new DepgraphStorageListenerRunnable( discoverer, aprox, graphFactory, patcherSupport,
                                event.getTransfer() ) );
  }
}

代码示例来源:origin: org.commonjava.aprox/aprox-core

scheduleManager.setSnapshotTimeouts( key, transfer.getPath() );
scheduleManager.setProxyTimeouts( key, transfer.getPath() );

代码示例来源:origin: org.commonjava.maven.galley/galley-core

@Override
  public void close() throws IOException
  {
    try
    {
      logger.trace( "START CLOSE: {}", transfer );
      super.close();

      logger.trace( "Delete: {} and its siblings in: {}.", transfer.getPath(), transfer.getLocation() );
      transfer.delete( false );

      Transfer meta = transfer.getSibling( HTTP_METADATA_EXT );
      if ( meta != null && meta.exists() )
      {
        meta.delete( false );
      }
    }
    finally
    {
      logger.trace( "END CLOSE: {}", transfer );
    }
  }
}

代码示例来源:origin: org.commonjava.aprox/aprox-promote-common

private void listRecursively( ArtifactStore store, String path, Set<String> paths )
    throws AproxWorkflowException
{
  List<StoreResource> listing = tools.list( store, path );
  if ( listing != null )
  {
    for ( StoreResource res : listing )
    {
      if ( res != null )
      {
        Transfer txfr = tools.getTransfer( res );
        if ( txfr != null )
        {
          if ( txfr.isDirectory() )
          {
            listRecursively( store, txfr.getPath(), paths );
          }
          else if ( txfr.exists() )
          {
            paths.add( txfr.getPath() );
          }
        }
      }
    }
  }
}

代码示例来源:origin: org.commonjava.maven.galley/galley-transport-httpclient

target.getPath() );
target.delete();

代码示例来源:origin: org.commonjava.maven.galley/galley-core

logger.trace( "Read done: {} in: {}. Now, creating checksums.", transfer.getPath(), transfer.getLocation() );
Map<ContentDigest, String> hexDigests = new HashMap<>();
for ( final AbstractChecksumGenerator checksum : checksums )

代码示例来源:origin: org.commonjava.aprox/aprox-core

.getPath();

代码示例来源:origin: org.commonjava.aprox/aprox-core

public void onFileDeletionEvent( @Observes final FileDeletionEvent event )
{
  final StoreKey key = getKey( event );
  if ( key != null )
  {
    try
    {
      scheduleManager.cancel( new StoreKeyMatcher( key, ScheduleManager.CONTENT_JOB_TYPE ),
                  event.getTransfer()
                     .getPath() );
    }
    catch ( final AproxSchedulerException e )
    {
      logger.error( "Failed to cancel content-expiration timeout related to: " + event.getTransfer(), e );
    }
  }
}

代码示例来源:origin: org.commonjava.maven.galley/galley-api

final String path = transfer.getPath();

代码示例来源:origin: org.commonjava.maven.galley/galley-core

logger.trace( "Wrote: {} (size: {}) in: {}. Now, writing checksums.", transfer.getPath(), size, transfer.getLocation() );
Map<ContentDigest, String> hexDigests = new HashMap<>();
for ( final AbstractChecksumGenerator checksum : checksums )

代码示例来源:origin: org.commonjava.indy/indy-dot-maven-common

@Override
public InputStream getResourceContent( final ITransaction transaction, final String resourceUri )
  throws WebdavException
{
  final StoreURIMatcher matcher = new StoreURIMatcher( resourceUri );
  final Transfer item = getTransfer( matcher );
  if ( item == null )
  {
    throw new WebdavException( "Cannot read content: " + resourceUri );
  }
  final String path = item.getPath();
  final StoreKey key = LocationUtils.getKey( item );
  try
  {
    return item.openInputStream();
  }
  catch ( final IOException e )
  {
    logger.error( String.format( "Failed to open InputStream for: %s in store: %s. Reason: %s", path, key, e.getMessage() ), e );
    throw new WebdavException( "Failed to get content for: " + resourceUri );
  }
}

代码示例来源:origin: org.commonjava.aprox/aprox-dot-maven-common

@Override
public InputStream getResourceContent( final ITransaction transaction, final String resourceUri )
  throws WebdavException
{
  final StoreURIMatcher matcher = new StoreURIMatcher( resourceUri );
  final Transfer item = getTransfer( matcher );
  if ( item == null )
  {
    throw new WebdavException( "Cannot read content: " + resourceUri );
  }
  final String path = item.getPath();
  final StoreKey key = LocationUtils.getKey( item );
  try
  {
    return item.openInputStream();
  }
  catch ( final IOException e )
  {
    logger.error( String.format( "Failed to open InputStream for: %s in store: %s. Reason: %s", path, key, e.getMessage() ), e );
    throw new WebdavException( "Failed to get content for: " + resourceUri );
  }
}

代码示例来源:origin: org.commonjava.indy/indy-content-index

StoreKey[] gKeys = affetctedGroupKeys.toArray( new StoreKey[affetctedGroupKeys.size()] );
transfers.forEach(
    txfr -> contentIndexManager.indexPathInStores( txfr.getPath(), hosted.getKey(), gKeys ) );

代码示例来源:origin: org.commonjava.indy/indy-content-index

@Override
@Measure
public void indexTransferIn( Transfer transfer, StoreKey...topKeys )
{
  if ( transfer != null && transfer.exists() )
  {
    StoreKey key = LocationUtils.getKey( transfer );
    String path = getStrategyPath( key, transfer.getPath() );
    indexPathInStores( path, key, topKeys );
  }
}

代码示例来源:origin: org.commonjava.aprox/aprox-depgraph-common

public void unlockOnFileErrorEvent( @Observes final FileErrorEvent evt )
{
  final String path = evt.getTransfer()
              .getPath();
  try
  {
    final ArtifactPathInfo info = ArtifactPathInfo.parse( path );
    //            logger.info( "Unlocking {} due to file download error.", info );
    if ( info != null )
    {
      final ProjectVersionRef ref =
        new SimpleProjectVersionRef( info.getGroupId(), info.getArtifactId(), info.getVersion() );
      delegate.notifyOfGraph( ref );
    }
  }
  catch ( final InvalidVersionSpecificationException e )
  {
    logger.error( String.format( "Cannot parse version for path: '%s'. Failed to unlock waiting threads. Reason: %s",
                   path, e.getMessage() ), e );
  }
}

相关文章