本文整理汇总了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 );
}
}
}
示例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 );
}
}
}
示例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 );
}
}
示例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 );
}
}
示例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;
}
示例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 );
}
}
示例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 );
}
}
示例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() );
}
}
}
示例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() );
}
示例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;
}
示例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 );
}
}
示例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 );
}
}
示例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 );
}
}
示例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 );
}
}
}
示例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 );
}
}