You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by gd...@apache.org on 2006/04/09 10:52:54 UTC

svn commit: r392691 - /geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java

Author: gdamour
Date: Sun Apr  9 01:52:53 2006
New Revision: 392691

URL: http://svn.apache.org/viewcvs?rev=392691&view=rev
Log:
Test first that source needs to be copied to destination. Also fix another typo.

Modified:
    geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java

Modified: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java?rev=392691&r1=392690&r2=392691&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java (original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java Sun Apr  9 01:52:53 2006
@@ -195,7 +195,7 @@
         File source = configurationData.getConfigurationDir();
         if (!source.exists()) {
             throw new InvalidConfigException("Source does not exist " + source);
-        } else if (source.canRead()) {
+        } else if (!source.canRead()) {
             throw new InvalidConfigException("Source is not readable " + source);
         }
 
@@ -203,13 +203,13 @@
         Artifact configId = configurationData.getId();
         File destination = repository.getLocation(configId);
 
-        if (destination.exists()) {
-            throw new ConfigurationAlreadyExistsException(configId.toString());
-        }
-
         // if directory in the correct place -- noop
         if (source.equals(destination)) {
             return;
+        }
+
+        if (destination.exists()) {
+            throw new ConfigurationAlreadyExistsException(configId.toString());
         }
 
         if (source.isFile()) {