throw new LayoutException( INVALID_ARTIFACT_PATH + "legacy paths should only have 3 parts [groupId]/[type]s/[artifactId]-[version].[type], found " + pathParts.length + " instead." ); throw new LayoutException( INVALID_ARTIFACT_PATH + "legacy paths should have an expected type ending in [s] in the second part of the path." ); throw new LayoutException( INVALID_ARTIFACT_PATH + "no artifact id present." ); throw new LayoutException( INVALID_ARTIFACT_PATH + "no version found." ); if ( !version.endsWith( "-" + classifier ) ) throw new LayoutException( INVALID_ARTIFACT_PATH + expectedType + " artifacts must use the classifier " + classifier ); throw new LayoutException( INVALID_ARTIFACT_PATH + "no extension found." ); throw new LayoutException( INVALID_ARTIFACT_PATH + "mismatch on extension [" + extension + "] and layout specified type [" + artifact.getType() + "] (which maps to extension: [" +
throw new ContinuumPurgeExecutorException( e.getMessage(), e );
/** * Get a Live Artifact from a Path. * <p/> * Will resolve the artifact details from the path, and then return a database live version * of that artifact. Suitable for modification and saving (without the need to check for * existance in database prior to save.) * * @param path the path to work from. * @return the artifact that is suitable for database saving. */ public ArchivaArtifact getLiveArtifact( String path ) { try { ArtifactReference artifact = repository.toArtifactReference( path ); ArchivaArtifact liveArtifact = dao.getArtifactDAO().createArtifact( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getClassifier(), artifact.getType() ); return liveArtifact; } catch ( LayoutException e ) { triggerConsumerError( TYPE_NOT_ARTIFACT, "Path " + path + " cannot be converted to artifact: " + e.getMessage() ); return null; } }
throw new ContinuumPurgeExecutorException( e.getMessage() + ": " + path, e );
/** * Get a Live Artifact from a Path. * <p/> * Will resolve the artifact details from the path, and then return a database live version * of that artifact. Suitable for modification and saving (without the need to check for * existance in database prior to save.) * * @param path the path to work from. * @return the artifact that is suitable for database saving. */ public ArchivaArtifact getLiveArtifact( String path ) { try { ArtifactReference artifact = repository.toArtifactReference( path ); ArchivaArtifact liveArtifact = dao.getArtifactDAO().createArtifact( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getClassifier(), artifact.getType(), repository.getId()); return liveArtifact; } catch ( LayoutException e ) { triggerConsumerError( TYPE_NOT_ARTIFACT, "Path " + path + " cannot be converted to artifact: " + e.getMessage() ); return null; } }
throw new ContinuumPurgeExecutorException( e.getMessage(), e );
public void processFile( String path ) throws ConsumerException { try { ArtifactReference reference = managedRepository.toArtifactReference( path ); Artifact artifact = artifactFactory.createArtifact( reference.getGroupId(), reference.getArtifactId(), reference.getVersion(), reference.getClassifier(), reference.getType() ); artifactConverter.convert( artifact, destinationRepository ); } catch ( LayoutException e ) { getLogger().warn( "Unable to convert artifact: " + path + " : " + e.getMessage(), e ); } catch ( ArtifactConversionException e ) { getLogger().warn( "Unable to convert artifact: " + path + " : " + e.getMessage(), e ); } }