]> source.dussan.org Git - archiva.git/commitdiff
[MRM-462] re-instate directory construction
authorBrett Porter <brett@apache.org>
Wed, 12 Sep 2007 01:29:08 +0000 (01:29 +0000)
committerBrett Porter <brett@apache.org>
Wed, 12 Sep 2007 01:29:08 +0000 (01:29 +0000)
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/branches@574751 13f79535-47bb-0310-9956-ffa450edef68

MRM-462/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/ConfigureRepositoryAction.java
MRM-462/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/repositories/ConfigureRepositoryActionTest.java

index 166346f48fc516deb30b5873ac8ea6ab72cf8861..65c14816644a3f549722a3f45f9805b9867df70f 100644 (file)
@@ -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 );
 
index 6cd171ff6a442723ebccd906b25ec21e23d29a68..525fd0f65bea14b6e1ac602bdfdedcc1a9eeb62e 100644 (file)
@@ -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 );