You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by dj...@apache.org on 2006/04/26 06:09:57 UTC
svn commit: r397079 -
/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/RepositoryConfigurationStore.java
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);