geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r397079 - /geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
Date Wed, 26 Apr 2006 04:09:57 GMT
Author: djencks
Date: Tue Apr 25 21:09:56 2006
New Revision: 397079

URL: http://svn.apache.org/viewcvs?rev=397079&view=rev
Log:
fix typo with wrong logical meaning, minor refactoring

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=397079&r1=397078&r2=397079&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
Tue Apr 25 21:09:56 2006
@@ -91,7 +91,7 @@
         }
         File location = repository.getLocation(configId);
 
-        if (!location.exists() && !location.canRead()) {
+        if (existsReadable(location)) {
             throw new NoSuchConfigException(configId);
         }
 
@@ -140,6 +140,10 @@
         return configurationData;
     }
 
+    private boolean existsReadable(File location) {
+        return !location.exists() || !location.canRead();
+    }
+
     public boolean containsConfiguration(Artifact configId) {
         if(!configId.isResolved()) {
             throw new IllegalArgumentException("Artifact "+configId+" is not fully resolved");
@@ -218,7 +222,7 @@
         if (dir == null) {
             throw new NoSuchConfigException(configId);
         }
-        if (!dir.exists() || !dir.canRead()) {
+        if (existsReadable(dir)) {
             throw new IOException("Cannot read config store directory for " + configId +
" (" + dir.getAbsolutePath() + ")");
         }
         ZipOutputStream out = new ZipOutputStream(output);



Mime
View raw message