From: Maria Odea B. Ching Date: Wed, 4 Jun 2008 06:38:50 +0000 (+0000) Subject: -reverted -r662662 (validation check against system properties) X-Git-Tag: archiva-r676265~67 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0596af879aaa751c9bc1bd4108bdcf4f191e3b4b;p=archiva.git -reverted -r662662 (validation check against system properties) git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@663006 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryAction.java index 14e62d4e6..79b5c8d78 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryAction.java @@ -42,7 +42,6 @@ import org.codehaus.plexus.redback.role.RoleManagerException; import java.io.IOException; import java.util.List; import java.util.Map; -import java.util.Properties; /** * DeleteManagedRepositoryAction @@ -102,20 +101,6 @@ public class DeleteManagedRepositoryAction return ERROR; } - if( deleteContents ) - { - // [MRM-789] Archiva may delete your app server installation - Properties props = System.getProperties(); - for( Object value : props.values() ) - { - if( StringUtils.equalsIgnoreCase( ( (String) value ).trim(), existingRepository.getLocation().trim() ) ) - { - addActionError( "Unable to delete repository. The location is being referenced in the system properties." ); - return ERROR; - } - } - } - String result = SUCCESS; try diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryActionTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryActionTest.java index 4cb35ab71..41536c1c7 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryActionTest.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/DeleteManagedRepositoryActionTest.java @@ -214,26 +214,6 @@ public class DeleteManagedRepositoryActionTest assertFalse( location.exists() ); } - - public void testDeleteRepositoryLocationReferencedInSysPropertiesError() - throws Exception - { - System.setProperty( "test.property", getTestFile( "target/test/location" ).getAbsolutePath() ); - - prepareRoleManagerMock(); - - Configuration configuration = prepDeletionTest( createRepository(), 4 ); - - String status = action.deleteContents(); - - assertEquals( Action.ERROR, status ); - - assertFalse( configuration.getManagedRepositories().isEmpty() ); - - assertTrue( location.exists() ); - - System.clearProperty( "test.property" ); - } private Configuration prepDeletionTest( ManagedRepositoryConfiguration originalRepository, int expectCountGetConfig ) throws RegistryException, IndeterminateConfigurationException