geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdam...@apache.org
Subject svn commit: r392691 - /geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
Date Sun, 09 Apr 2006 08:52:54 GMT
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()) {



Mime
View raw message