diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractManagedRepositoriesAction.java b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractManagedRepositoriesAction.java index 7133cd399..b58145c76 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractManagedRepositoriesAction.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractManagedRepositoriesAction.java @@ -19,12 +19,9 @@ package org.apache.maven.archiva.web.action.admin.repositories; * under the License. */ -import org.apache.archiva.scheduler.repository.RepositoryArchivaTaskScheduler; import org.apache.maven.archiva.configuration.Configuration; import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration; -import javax.inject.Inject; -import javax.inject.Named; import java.io.File; import java.io.IOException; @@ -38,37 +35,5 @@ import java.io.IOException; public abstract class AbstractManagedRepositoriesAction extends AbstractRepositoriesAdminAction { - - - @Inject - @Named( value = "archivaTaskScheduler#repository" ) - private RepositoryArchivaTaskScheduler repositoryTaskScheduler; - public static final String CONFIRM = "confirm"; - - - public void setRepositoryTaskScheduler( RepositoryArchivaTaskScheduler repositoryTaskScheduler ) - { - this.repositoryTaskScheduler = repositoryTaskScheduler; - } - - protected void addRepository( ManagedRepositoryConfiguration repository, Configuration configuration ) - throws IOException - { - // Normalize the path - File file = new File( repository.getLocation() ); - repository.setLocation( file.getCanonicalPath() ); - if ( !file.exists() ) - { - file.mkdirs(); - } - if ( !file.exists() || !file.isDirectory() ) - { - throw new IOException( - "Unable to add repository - no write access, can not create the root directory: " + file ); - } - - configuration.addManagedRepository( repository ); - - } } diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryActionTest.java b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryActionTest.java index 6e12a0910..a0a645ab5 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryActionTest.java +++ b/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/EditManagedRepositoryActionTest.java @@ -93,15 +93,12 @@ public class EditManagedRepositoryActionTest roleManagerControl = MockControl.createControl( RoleManager.class ); roleManager = (RoleManager) roleManagerControl.getMock(); - //action.setRoleManager( roleManager ); registryControl = MockControl.createControl( Registry.class ); registry = (Registry) registryControl.getMock(); - //action.setRegistry( registry ); repositoryTaskSchedulerControl = MockClassControl.createControl( RepositoryArchivaTaskScheduler.class ); repositoryTaskScheduler = (RepositoryArchivaTaskScheduler) repositoryTaskSchedulerControl.getMock(); - action.setRepositoryTaskScheduler( repositoryTaskScheduler ); location = new File( "target/test/location" ); @@ -110,7 +107,6 @@ public class EditManagedRepositoryActionTest when( repositorySession.getRepository() ).thenReturn( metadataRepository ); TestRepositorySessionFactory factory = applicationContext.getBean( TestRepositorySessionFactory.class ); factory.setRepositorySession( repositorySession ); - action.setRepositorySessionFactory( factory ); ( (DefaultManagedRepositoryAdmin) getManagedRepositoryAdmin() ).setArchivaConfiguration( archivaConfiguration ); ( (DefaultManagedRepositoryAdmin) getManagedRepositoryAdmin() ).setRoleManager( roleManager );