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


Java ConsumerException类代码示例

本文整理汇总了Java中org.apache.archiva.consumers.ConsumerException的典型用法代码示例。如果您正苦于以下问题:Java ConsumerException类的具体用法?Java ConsumerException怎么用?Java ConsumerException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: processFile

import org.apache.archiva.consumers.ConsumerException; //导入依赖的package包/类
@Override
public void processFile( String path )
    throws ConsumerException
{
    if ( !path.endsWith( ".sha1" ) && !path.endsWith( ".md5" ) )
    {
        try
        {
            consumed.add( repository.toArtifactReference( path ) );
        }
        catch ( LayoutException e )
        {
            throw new ConsumerException( e.getMessage(), e );
        }
    }
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:17,代码来源:TestConsumer.java

示例2: execute

import org.apache.archiva.consumers.ConsumerException; //导入依赖的package包/类
@Override
public void execute( Object input )
{
    if ( input instanceof RepositoryContentConsumer )
    {
        RepositoryContentConsumer consumer = (RepositoryContentConsumer) input;
            
        try
        {
            consumer.beginScan( repository, whenGathered, executeOnEntireRepo );
        }
        catch ( ConsumerException e )
        {
            log.warn( "Consumer [{}] cannot begin: {}",consumer.getId(), e.getMessage(), e );
        }
    }
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:18,代码来源:TriggerBeginScanClosure.java

示例3: beginScan

import org.apache.archiva.consumers.ConsumerException; //导入依赖的package包/类
@Override
public void beginScan( ManagedRepository repository, Date whenGathered )
    throws ConsumerException
{
    this.repository = repository;
    managedRepository = new File( repository.getLocation() );

    try
    {
        log.info( "Creating indexing context for repo : {}", repository.getId() );
        indexingContext = managedRepositoryAdmin.createIndexContext( repository );
    }
    catch ( RepositoryAdminException e )
    {
        throw new ConsumerException( e.getMessage(), e );
    }
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:18,代码来源:NexusIndexerConsumer.java

示例4: processFile

import org.apache.archiva.consumers.ConsumerException; //导入依赖的package包/类
@Override
public void processFile( String path )
    throws ConsumerException
{
    File artifactFile = new File( managedRepository, path );

    ArtifactIndexingTask task =
        new ArtifactIndexingTask( repository, artifactFile, ArtifactIndexingTask.Action.ADD, getIndexingContext() );
    try
    {
        log.debug( "Queueing indexing task '{}' to add or update the artifact in the index.", task );
        scheduler.queueTask( task );
    }
    catch ( TaskQueueException e )
    {
        throw new ConsumerException( e.getMessage(), e );
    }
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:19,代码来源:NexusIndexerConsumer.java

示例5: getIndexingContext

import org.apache.archiva.consumers.ConsumerException; //导入依赖的package包/类
private IndexingContext getIndexingContext()
    throws ConsumerException
{

    if ( this.indexingContext == null )
    {
        try
        {
            indexingContext = managedRepositoryAdmin.createIndexContext( repository );
        }
        catch ( RepositoryAdminException e )
        {
            throw new ConsumerException( e.getMessage(), e );
        }
    }
    return indexingContext;
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:18,代码来源:NexusIndexerConsumer.java

示例6: processFile

import org.apache.archiva.consumers.ConsumerException; //导入依赖的package包/类
public void processFile( String path, boolean executeOnEntireRepo )
    throws ConsumerException
{
    log.info( "Processing entry [{}] from repository [{}]", path, this.repository.getId() );

    try
    {
        ManagedRepositoryContent repositoryContent = repositoryContentFactory.getManagedRepositoryContent( repository.getId() );
        ArtifactReference artifact = repositoryContent.toArtifactReference( path );

        repositorySession.getRepository().getArtifacts( repository.getId(), artifact.getGroupId(),
                                                        artifact.getArtifactId(), artifact.getVersion() );
    }
    catch ( RepositoryException | LayoutException | MetadataResolutionException e )
    {
        throw new ConsumerException( e.getLocalizedMessage(), e );
    }
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:19,代码来源:SimpleArtifactConsumer.java

示例7: processFile

import org.apache.archiva.consumers.ConsumerException; //导入依赖的package包/类
@Override
public void processFile( String path )
    throws ConsumerException
{
    try
    {
        if ( deleteReleasedSnapshots )
        {
            cleanUp.process( path );
        }

        repoPurge.process( path );
    }
    catch ( RepositoryPurgeException rpe )
    {
        throw new ConsumerException( rpe.getMessage(), rpe );
    }
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:19,代码来源:RepositoryPurgeConsumer.java

示例8: processFile

import org.apache.archiva.consumers.ConsumerException; //导入依赖的package包/类
@Override
public void processFile( String path )
    throws ConsumerException
{
    // Ignore paths like .index etc
    if ( !path.startsWith( "." ) )
    {
        try
        {
            ArtifactReference artifact = repository.toArtifactReference( path );
            updateVersionMetadata( artifact, path );
            updateProjectMetadata( artifact, path );
        }
        catch ( LayoutException e )
        {
            log.info( "Not processing path that is not an artifact: {} ({})", path, e.getMessage() );
        }
    }
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:20,代码来源:MetadataUpdaterConsumer.java

示例9: testConsumerArtifactFileNotExist

import org.apache.archiva.consumers.ConsumerException; //导入依赖的package包/类
@Test
public void testConsumerArtifactFileNotExist()
    throws Exception
{
    consumer.beginScan( config, new Date() );
    try
    {
        consumer.processFile( "com/example/test/test-artifact/2.0/test-artifact-2.0.jar" );
        fail( "Should have failed to find file" );
    }
    catch ( ConsumerException e )
    {
        assertTrue( e.getCause() instanceof NoSuchFileException );
    }
    finally
    {
        consumer.completeScan();
    }

    verify( metadataRepository, never() ).addMetadataFacet( eq( TEST_REPO ), Matchers.<MetadataFacet>anyObject() );
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:22,代码来源:DuplicateArtifactsConsumerTest.java

示例10: getConsumerList

import org.apache.archiva.consumers.ConsumerException; //导入依赖的package包/类
private List<KnownRepositoryContentConsumer> getConsumerList( String[] consumers )
    throws ConsumerException
{
    List<KnownRepositoryContentConsumer> consumerList = new ArrayList<>();

    Map<String, KnownRepositoryContentConsumer> availableConsumers = getConsumers();

    for ( String specifiedConsumer : consumers )
    {
        if ( !availableConsumers.containsKey( specifiedConsumer ) )
        {
            System.err.println( "Specified consumer [" + specifiedConsumer + "] not found." );
            dumpAvailableConsumers();
            System.exit( 1 );
        }

        consumerList.add( availableConsumers.get( specifiedConsumer ) );
    }

    return consumerList;
}
 
开发者ID:ruikom,项目名称:apache-archiva,代码行数:22,代码来源:ArchivaCli.java

示例11: beginScan

import org.apache.archiva.consumers.ConsumerException; //导入依赖的package包/类
@Override
public void beginScan( ManagedRepository repository, Date whenGathered )
    throws ConsumerException
{
    this.repository = repository;
    managedRepository = PathUtil.getPathFromUri( repository.getLocation() );

    try
    {
        log.info( "Creating indexing context for repo : {}", repository.getId() );
        indexingContext = managedRepositoryAdmin.createIndexContext( repository );
    }
    catch ( RepositoryAdminException e )
    {
        throw new ConsumerException( e.getMessage(), e );
    }
}
 
开发者ID:apache,项目名称:archiva,代码行数:18,代码来源:NexusIndexerConsumer.java

示例12: processFile

import org.apache.archiva.consumers.ConsumerException; //导入依赖的package包/类
@Override
public void processFile( String path )
    throws ConsumerException
{
    Path artifactFile = managedRepository.resolve(path);

    ArtifactIndexingTask task =
        new ArtifactIndexingTask( repository, artifactFile, ArtifactIndexingTask.Action.ADD, getIndexingContext() );
    try
    {
        log.debug( "Queueing indexing task '{}' to add or update the artifact in the index.", task );
        scheduler.queueTask( task );
    }
    catch ( TaskQueueException e )
    {
        throw new ConsumerException( e.getMessage(), e );
    }
}
 
开发者ID:apache,项目名称:archiva,代码行数:19,代码来源:NexusIndexerConsumer.java

示例13: processFile

import org.apache.archiva.consumers.ConsumerException; //导入依赖的package包/类
public void processFile( String path, boolean executeOnEntireRepo )
    throws ConsumerException
{
    log.info( "Processing entry [{}] from repository [{}]", path, this.repository.getId() );

    try
    {
        ManagedRepositoryContent repositoryContent = repository.getContent();
        ArtifactReference artifact = repositoryContent.toArtifactReference( path );

        repositorySession.getRepository().getArtifacts( repository.getId(), artifact.getGroupId(),
                                                        artifact.getArtifactId(), artifact.getVersion() );
    }
    catch ( LayoutException | MetadataResolutionException e )
    {
        throw new ConsumerException( e.getLocalizedMessage(), e );
    }
}
 
开发者ID:apache,项目名称:archiva,代码行数:19,代码来源:SimpleArtifactConsumer.java

示例14: processFile

import org.apache.archiva.consumers.ConsumerException; //导入依赖的package包/类
@Override
public void processFile( String path )
    throws ConsumerException
{
    Path file = this.repositoryDir.resolve(path );
    if ( Files.exists(file) )
    {
        log.info( "(Auto) Removing File: {}", file.toAbsolutePath( ) );
        triggerConsumerInfo( "(Auto) Removing File: " + file.toAbsolutePath( ) );
        try
        {
            Files.deleteIfExists( file );
        }
        catch ( IOException e )
        {
            log.error("Could not delete file {}: {}", file, e.getMessage(), e);
            throw new ConsumerException( "Could not delete file "+file );
        }
    }
}
 
开发者ID:apache,项目名称:archiva,代码行数:21,代码来源:AutoRemoveConsumer.java

示例15: processFile

import org.apache.archiva.consumers.ConsumerException; //导入依赖的package包/类
@Override
public void processFile( String path )
    throws ConsumerException
{
    try
    {
        if ( deleteReleasedSnapshots )
        {
            cleanUp.process( path );
        }
        repoPurge.process( path );
    }
    catch ( RepositoryPurgeException rpe )
    {
        throw new ConsumerException( rpe.getMessage( ), rpe );
    }
}
 
开发者ID:apache,项目名称:archiva,代码行数:18,代码来源:RepositoryPurgeConsumer.java


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