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() );
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() );
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() );
@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 ); } }
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() );
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() );
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() );
@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 ContentNotFoundException( "No snapshot versions found on reference [" + VersionedReference.toKey( reference ) + "]." );