throw new ContentNotFoundException( "Unable to get versions on a non-existant directory: " + repoDir.toAbsolutePath() ); throw new ContentNotFoundException( "Unable to get versions on a non-directory: " + repoDir.toAbsolutePath() );
private void doPurgeAllRelated( ArtifactReference reference ) { try { Set<ArtifactReference> related = repository.getRelatedArtifacts( reference ); purge( related ); } catch ( ContentNotFoundException e ) { // Nothing to do here - it means the repository would have been constructed incorrectly log.debug( e.getMessage(), e ); } } }
triggerConsumerWarning( TYPE_METADATA_IO, "Project metadata not written because no versions were found to update: " + e.getMessage() );
throw new ContentNotFoundException( "Unable to get Versions on a non-existant directory: " + repoDir.toAbsolutePath() ); throw new ContentNotFoundException( "Unable to get Versions on a non-directory: " + repoDir.toAbsolutePath() );
triggerConsumerWarning( TYPE_METADATA_IO, "Version metadata not written because no versions were found to update: " + e.getMessage() );
throw new ContentNotFoundException( "Unable to get related artifacts using a non-existant directory: " + repoDir.toAbsolutePath() ); throw new ContentNotFoundException( "Unable to get related artifacts using a non-directory: " + repoDir.toAbsolutePath() );
throw new RepositoryPurgeException( e.getMessage(), e );
throw new ContentNotFoundException( "Unable to get Versions on a non-existant directory: " + repoDir.getAbsolutePath() ); throw new ContentNotFoundException( "Unable to get Versions on a non-directory: " + repoDir.getAbsolutePath() );
log.warn( "skip ContentNotFoundException: {}", e.getMessage() );
@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 ); } }
log.warn( "skip error deleting artifact {}: {}", reference, e.getMessage( ) );
throw new ContentNotFoundException( "Unable to get versions on a non-existant directory: " + repoDir.getAbsolutePath() ); throw new ContentNotFoundException( "Unable to get versions on a non-directory: " + repoDir.getAbsolutePath() );
log.warn( "skip ContentNotFoundException: {}", e.getMessage() );
throw new ContentNotFoundException( "Unable to get related artifacts using a non-existant directory: " + repoDir.getAbsolutePath() ); throw new ContentNotFoundException( "Unable to get related artifacts using a non-directory: " + repoDir.getAbsolutePath() );
throw new RepositoryPurgeException( e.getMessage( ), e );
@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 ); } }
throw new RepositoryPurgeException( e.getMessage(), e );
throw new ContentNotFoundException( "No snapshot versions found on reference [" + VersionedReference.toKey( reference ) + "]." );
log.warn( "skip error deleting artifact {}: {}", reference, e.getMessage() );
throw new ArchivaRestServiceException( "Artifact does not exist: " + e.getMessage(), 400, e );