@Override public void deleteProject( String namespace, String projectId ) throws RepositoryException, ContentNotFoundException { ArtifactReference artifactReference = new ArtifactReference(); artifactReference.setGroupId( namespace ); artifactReference.setArtifactId( projectId ); String path = toPath( artifactReference ); File directory = new File( getRepoRoot(), path ); if ( !directory.exists() ) { throw new ContentNotFoundException( "cannot found project " + namespace + ":" + projectId ); } if ( directory.isDirectory() ) { try { FileUtils.deleteDirectory( directory ); } catch ( IOException e ) { throw new RepositoryException( e.getMessage(), e ); } } else { log.warn( "project {}:{} is not a directory", namespace, projectId ); } }
@Override public void deleteProject( String namespace, String projectId ) throws RepositoryException { ArtifactReference artifactReference = new ArtifactReference(); artifactReference.setGroupId( namespace ); artifactReference.setArtifactId( projectId ); String path = toPath( artifactReference ); Path directory = Paths.get( getRepoRoot(), path ); if ( !Files.exists(directory) ) { throw new ContentNotFoundException( "cannot found project " + namespace + ":" + projectId ); } if ( Files.isDirectory(directory) ) { try { org.apache.archiva.common.utils.FileUtils.deleteDirectory( directory ); } catch ( IOException e ) { throw new RepositoryException( e.getMessage(), e ); } } else { log.warn( "project {}:{} is not a directory", namespace, projectId ); } }
artifactReference.setArtifactId( artifactId ); artifactReference.setGroupId( groupId ); artifactReference.setVersion( version );
artifactReference.setArtifactId( artifactId ); artifactReference.setGroupId( groupId ); artifactReference.setVersion( version );
artifactReference.setArtifactId( artifactId ); artifactReference.setGroupId( groupId ); artifactReference.setVersion( version );
artifactReference.setArtifactId( artifactId ); artifactReference.setGroupId( groupId ); artifactReference.setVersion( version );
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; } }
pomReference.setArtifactId( artifact.getArtifactId() ); pomReference.setVersion( artifact.getVersion() ); pomReference.setType( "pom" ); artifact.setArtifactId( relocation.getArtifactId() );
pomReference.setArtifactId( artifact.getArtifactId() ); pomReference.setVersion( artifact.getVersion() ); pomReference.setType( "pom" ); artifact.setArtifactId( relocation.getArtifactId() );
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; }
artifact.setArtifactId( metadata.getProject() ); artifact.setVersion( metadata.getVersion() ); MavenArtifactFacet facet = (MavenArtifactFacet) metadata.getFacet( MavenArtifactFacet.FACET_ID );
artifact.setArtifactId( metadata.getProject() ); artifact.setVersion( metadata.getVersion() ); MavenArtifactFacet facet = (MavenArtifactFacet) metadata.getFacet( MavenArtifactFacet.FACET_ID );
artifactReference.setArtifactId( artifactTransferRequest.getArtifactId() ); artifactReference.setGroupId( artifactTransferRequest.getGroupId() ); artifactReference.setVersion( artifactTransferRequest.getVersion() );
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? } } }
artifactReference.setArtifactId( artifact.getArtifactId() ); artifactReference.setGroupId( artifact.getGroupId() ); artifactReference.setVersion( artifact.getVersion() );
public Artifact build() ref.setArtifactId( artifactMetadata.getProject() ); ref.setGroupId( artifactMetadata.getNamespace() ); ref.setVersion( artifactMetadata.getVersion() );
public Artifact build() ref.setArtifactId( artifactMetadata.getProject() ); ref.setGroupId( artifactMetadata.getNamespace() ); ref.setVersion( artifactMetadata.getVersion() );
artifactReference.setArtifactId( projectId ); artifactReference.setVersion( version );
artifactReference.setArtifactId( projectId ); artifactReference.setVersion( version );