From: Brett Porter Date: Wed, 12 Sep 2007 01:29:08 +0000 (+0000) Subject: [MRM-462] re-instate directory construction X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4b1b409ffe99425d254a3e64efb716ec65148b25;p=archiva.git [MRM-462] re-instate directory construction git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/branches@574751 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/MRM-462/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/ConfigureRepositoryAction.java b/MRM-462/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/ConfigureRepositoryAction.java index 166346f48..65c148166 100644 --- a/MRM-462/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/ConfigureRepositoryAction.java +++ b/MRM-462/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/ConfigureRepositoryAction.java @@ -300,27 +300,15 @@ public class ConfigureRepositoryAction private void addRepository( AdminRepositoryConfiguration repository, Configuration configuration ) throws IOException, RoleManagerException { - // Fix the URL entry (could possibly be a filesystem path) -/* TODO! reinstate - String rawUrlEntry = repository.getUrl(); - if ( !rawUrlEntry.startsWith( "http://" ) ) + // Normalize the path + File file = new File( repository.getLocation() ); + repository.setLocation( file.getCanonicalPath() ); + if ( !file.exists() ) { - repository.setUrl( PathUtil.toUrl( rawUrlEntry ) ); + file.mkdirs(); + // TODO: error handling when this fails, or is not a directory! } - if ( repository.isManaged() ) - { - // Normalize the path - File file = new File( repository.getDirectory() ); - repository.setDirectory( file.getCanonicalPath() ); - if ( !file.exists() ) - { - file.mkdirs(); - // TODO: error handling when this fails, or is not a directory! - } - } -*/ - // TODO! others configuration.addManagedRepository( repository ); diff --git a/MRM-462/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/ConfigureRepositoryActionTest.java b/MRM-462/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/ConfigureRepositoryActionTest.java index 6cd171ff6..525fd0f65 100644 --- a/MRM-462/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/ConfigureRepositoryActionTest.java +++ b/MRM-462/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/ConfigureRepositoryActionTest.java @@ -228,7 +228,7 @@ public class ConfigureRepositoryActionTest { repository.setId( REPO_ID ); repository.setName( "repo name" ); - repository.setLocation( "location" ); + repository.setLocation( getTestFile( "location" ).getAbsolutePath() ); repository.setLayout( "default" ); repository.setRefreshCronExpression( "* 0/5 * * * ?" ); repository.setDaysOlder( 31 );