[MRM-1505] api to configure ManagedRepository : get RID of not any more used methods/fields

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1164555 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2011-09-02 14:52:07 +00:00
parent 2620870be8
commit d1a0d0eb32
2 changed files with 0 additions and 39 deletions

View File

@ -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 );
}
}

View File

@ -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 );