diff options
author | Martin Stockhammer <martin_s@apache.org> | 2020-06-03 10:46:34 +0200 |
---|---|---|
committer | Martin Stockhammer <martin_s@apache.org> | 2020-06-03 10:46:34 +0200 |
commit | b9dd7edf9eac052e4400fd37e12b3e123b8b9f55 (patch) | |
tree | 5b46329a8e280bd2e6d37bea2b73e37feb9fd913 /archiva-modules/archiva-maven/archiva-maven-repository/src | |
parent | 873753536bbc1cd1639016ae845625f631f3cff1 (diff) | |
download | archiva-b9dd7edf9eac052e4400fd37e12b3e123b8b9f55.tar.gz archiva-b9dd7edf9eac052e4400fd37e12b3e123b8b9f55.zip |
Removing old API methods
Diffstat (limited to 'archiva-modules/archiva-maven/archiva-maven-repository/src')
2 files changed, 0 insertions, 53 deletions
diff --git a/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContent.java b/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContent.java index 032c531d7..3e195c226 100644 --- a/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContent.java +++ b/archiva-modules/archiva-maven/archiva-maven-repository/src/main/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContent.java @@ -1343,35 +1343,6 @@ public class ManagedDefaultRepositoryContent @Override - public void deleteVersion( VersionedReference ref ) throws ContentNotFoundException, ContentAccessException - { - final String path = toPath( ref ); - final Path deleteTarget = getRepoDir( ).resolve( path ); - if ( !Files.exists( deleteTarget ) ) - { - log.warn( "Version path for repository {} does not exist: {}", getId( ), deleteTarget ); - throw new ContentNotFoundException( "Version not found for repository " + getId( ) + ": " + path ); - } - if ( Files.isDirectory( deleteTarget ) ) - { - try - { - org.apache.archiva.common.utils.FileUtils.deleteDirectory( deleteTarget ); - } - catch ( IOException e ) - { - log.error( "Could not delete file path {}: {}", deleteTarget, e.getMessage( ), e ); - throw new ContentAccessException( "Error while trying to delete path " + path + " from repository " + getId( ) + ": " + e.getMessage( ), e ); - } - } - else - { - log.warn( "Version path for repository {} is not a directory {}", getId( ), deleteTarget ); - throw new ContentNotFoundException( "Version path for repository " + getId( ) + " is not directory: " + path ); - } - } - - @Override public void deleteProject( ProjectReference ref ) throws ContentNotFoundException, ContentAccessException { @@ -1690,12 +1661,6 @@ public class ManagedDefaultRepositoryContent @Override - public StorageAsset toFile( ArtifactReference reference ) - { - return repository.getAsset( toPath( reference ) ); - } - - @Override public StorageAsset toFile( VersionedReference reference ) { return repository.getAsset( toPath( reference ) ); diff --git a/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContentTest.java b/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContentTest.java index e4728f2aa..746bbb8d7 100644 --- a/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContentTest.java +++ b/archiva-modules/archiva-maven/archiva-maven-repository/src/test/java/org/apache/archiva/repository/maven/content/ManagedDefaultRepositoryContentTest.java @@ -522,24 +522,6 @@ public class ManagedDefaultRepositoryContentTest @Test - public void testDeleteVersion() throws IOException, org.apache.archiva.repository.ContentNotFoundException, org.apache.archiva.repository.ContentAccessException - { - Path deleteRepo = setupRepoCopy( "delete-repository", "delete-repository-2" ); - assertTrue( Files.exists( deleteRepo.resolve( "org/apache/maven/samplejar/1.0/samplejar-1.0-source.jar" ) ) ); - assertTrue( Files.exists( deleteRepo.resolve( "org/apache/maven/samplejar/1.0/samplejar-1.0.jar" ) ) ); - assertTrue( Files.exists( deleteRepo.resolve( "org/apache/maven/samplejar/1.0/samplejar-1.0.jar.md5" ) ) ); - assertTrue( Files.exists( deleteRepo.resolve( "org/apache/maven/samplejar/1.0/samplejar-1.0.jar.sha1" ) ) ); - assertTrue( Files.exists( deleteRepo.resolve( "org/apache/maven/samplejar/1.0/samplejar-1.0.pom" ) ) ); - - VersionedReference ref = new VersionedReference( ).groupId( "org.apache.maven" ).artifactId( "samplejar" ).version( "1.0" ); - - repoContent.deleteVersion( ref ); - - assertFalse( Files.exists( deleteRepo.resolve( "org/apache/maven/samplejar/1.0" ) ) ); - - } - - @Test public void testDeleteProject() throws IOException, org.apache.archiva.repository.ContentNotFoundException, org.apache.archiva.repository.ContentAccessException { Path deleteRepo = setupRepoCopy( "delete-repository", "delete-repository-2" ); |