public static String toVersionlessKey( ArtifactReference artifactReference ) { StringBuilder key = new StringBuilder(); key.append( defaultString( artifactReference.getGroupId() ) ).append( ":" ); key.append( defaultString( artifactReference.getArtifactId() ) ).append( ":" ); key.append( defaultString( artifactReference.getClassifier() ) ).append( ":" ); key.append( defaultString( artifactReference.getType() ) ); return key.toString(); }
public static String toVersionlessKey( ArtifactReference artifactReference ) { StringBuilder key = new StringBuilder(); key.append( defaultString( artifactReference.getGroupId() ) ).append( ":" ); key.append( defaultString( artifactReference.getArtifactId() ) ).append( ":" ); key.append( defaultString( artifactReference.getClassifier() ) ).append( ":" ); key.append( defaultString( artifactReference.getType() ) ); return key.toString(); }
public static String toKey( ArtifactReference artifactReference ) { StringBuilder key = new StringBuilder(); key.append( defaultString( artifactReference.getGroupId() ) ).append( ":" ); key.append( defaultString( artifactReference.getArtifactId() ) ).append( ":" ); key.append( defaultString( artifactReference.getVersion() ) ).append( ":" ); key.append( defaultString( artifactReference.getClassifier() ) ).append( ":" ); key.append( defaultString( artifactReference.getType() ) ); return key.toString(); }
public static String toKey( ArtifactReference artifactReference ) { StringBuilder key = new StringBuilder(); key.append( defaultString( artifactReference.getGroupId() ) ).append( ":" ); key.append( defaultString( artifactReference.getArtifactId() ) ).append( ":" ); key.append( defaultString( artifactReference.getVersion() ) ).append( ":" ); key.append( defaultString( artifactReference.getClassifier() ) ).append( ":" ); key.append( defaultString( artifactReference.getType() ) ); return key.toString(); }
public ArchivaArtifact( ArtifactReference ref, String repositoryId ) { this( ref.getGroupId(), ref.getArtifactId(), ref.getVersion(), ref.getClassifier(), ref.getType(), repositoryId ); }
public ArchivaArtifact( ArtifactReference ref, String repositoryId ) { this( ref.getGroupId(), ref.getArtifactId(), ref.getVersion(), ref.getClassifier(), ref.getType(), repositoryId ); }
public static String toKey( ArtifactReference ref ) { return toKey( ref.getGroupId(), ref.getArtifactId(), ref.getVersion(), ref.getClassifier(), ref.getType() ); }
public static String toKey( ArtifactReference ref ) { return toKey( ref.getGroupId(), ref.getArtifactId(), ref.getVersion(), ref.getClassifier(), ref.getType() ); }
public String toPath( ArtifactReference reference ) { if ( reference == null ) { throw new IllegalArgumentException( "Artifact reference cannot be null" ); } if ( reference.getVersion() != null ) { String baseVersion = VersionUtil.getBaseVersion( reference.getVersion() ); return toPath( reference.getGroupId(), reference.getArtifactId(), baseVersion, reference.getVersion(), reference.getClassifier(), reference.getType() ); } return toPath( reference.getGroupId(), reference.getArtifactId(), null, null, reference.getClassifier(), reference.getType() ); }
public String toPath( ArtifactReference reference ) { if ( reference == null ) { throw new IllegalArgumentException( "Artifact reference cannot be null" ); } if ( reference.getVersion() != null ) { String baseVersion = VersionUtil.getBaseVersion( reference.getVersion() ); return toPath( reference.getGroupId(), reference.getArtifactId(), baseVersion, reference.getVersion(), reference.getClassifier(), reference.getType() ); } return toPath( reference.getGroupId(), reference.getArtifactId(), null, null, reference.getClassifier(), reference.getType() ); }
@Override 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 ) { log.warn( "Unable to convert artifact: {} : {}",path , e.getMessage(), e ); } catch ( ArtifactConversionException e ) { log.warn( "Unable to convert artifact: {} : {}",path , e.getMessage(), e ); } }
@Override 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 ) { log.warn( "Unable to convert artifact: {} : {}",path , e.getMessage(), e ); } catch ( ArtifactConversionException e ) { log.warn( "Unable to convert artifact: {} : {}",path , e.getMessage(), e ); } }
private ArtifactReference getNewArtifactReference( ArtifactReference reference, String version ) throws LayoutException { ArtifactReference artifact = new ArtifactReference( ); artifact.setGroupId( reference.getGroupId( ) ); artifact.setArtifactId( reference.getArtifactId( ) ); artifact.setVersion( version ); artifact.setClassifier( reference.getClassifier( ) ); artifact.setType( reference.getType( ) ); return artifact; } }
public static ArtifactReference clone( ArtifactReference artifactReference ) { if ( artifactReference == null ) { return null; } ArtifactReference cloned = new ArtifactReference(); cloned.setGroupId( artifactReference.getGroupId() ); cloned.setArtifactId( artifactReference.getArtifactId() ); cloned.setVersion( artifactReference.getVersion() ); cloned.setClassifier( artifactReference.getClassifier() ); cloned.setType( artifactReference.getType() ); return cloned; }
public static ArtifactReference clone( ArtifactReference artifactReference ) { if ( artifactReference == null ) { return null; } ArtifactReference cloned = new ArtifactReference(); cloned.setGroupId( artifactReference.getGroupId() ); cloned.setArtifactId( artifactReference.getArtifactId() ); cloned.setVersion( artifactReference.getVersion() ); cloned.setClassifier( artifactReference.getClassifier() ); cloned.setType( artifactReference.getType() ); return cloned; }
throws ProxyDownloadException if ( "pom".equals( artifact.getType() ) )
throws ProxyDownloadException if ( "pom".equals( artifact.getType() ) )
private void doPurgeAllRelated( ArtifactReference reference, String version ) throws LayoutException { ArtifactReference artifact = new ArtifactReference(); artifact.setGroupId( reference.getGroupId() ); artifact.setArtifactId( reference.getArtifactId() ); artifact.setVersion( version ); artifact.setClassifier( reference.getClassifier() ); artifact.setType( reference.getType() ); try { Set<ArtifactReference> related = repository.getRelatedArtifacts( artifact ); purge( related ); } catch ( ContentNotFoundException e ) { // Nothing to do here. // TODO: Log this? } } }
artifact.setSize( df.format( s ) + " " + symbol ); artifact.setId( ref.getArtifactId() + "-" + ref.getVersion() + "." + ref.getType() );
artifact.setSize( df.format( s ) + " " + symbol ); artifact.setId( ref.getArtifactId() + "-" + ref.getVersion() + "." + ref.getType() );