geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r351882 - /geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/repository/FileSystemRepository.java
Date Sat, 03 Dec 2005 03:40:43 GMT
Author: dain
Date: Fri Dec  2 19:40:41 2005
New Revision: 351882

URL: http://svn.apache.org/viewcvs?rev=351882&view=rev
Log:
GERONIMO-1227 Do not require the repository directory to be writable
Thanks Toby!

Modified:
    geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/repository/FileSystemRepository.java

Modified: geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/repository/FileSystemRepository.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/repository/FileSystemRepository.java?rev=351882&r1=351881&r2=351882&view=diff
==============================================================================
--- geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/repository/FileSystemRepository.java
(original)
+++ geronimo/trunk/modules/system/src/java/org/apache/geronimo/system/repository/FileSystemRepository.java
Fri Dec  2 19:40:41 2005
@@ -150,6 +150,10 @@
     }
 
     public void copyToRepository(InputStream source, URI destination, FileWriteMonitor monitor)
throws IOException {
+        if (!rootFile.canWrite()) {
+            throw new IllegalStateException("This repository is not writable: " + rootFile.getAbsolutePath()
+ ")");
+        }
+
         File dest = new File(resolve(destination));
         if (dest.exists()) {
             throw new IllegalArgumentException("Destination " + dest.getAbsolutePath() +
" already exists!");
@@ -199,8 +203,8 @@
                 throw new IllegalStateException("FileSystemRepository must have a root that's
a local directory (not " + rootURI + ")");
             }
             rootFile = new File(rootURI);
-            if (!rootFile.exists() || !rootFile.isDirectory() || !rootFile.canRead() || !rootFile.canWrite())
{
-                throw new IllegalStateException("FileSystemRepository must have a root that's
a valid writable directory (not " + rootFile.getAbsolutePath() + ")");
+            if (!rootFile.exists() || !rootFile.isDirectory() || !rootFile.canRead()) {
+                throw new IllegalStateException("FileSystemRepository must have a root that's
a valid readable directory (not " + rootFile.getAbsolutePath() + ")");
             }
         }
         log.debug("Repository root is " + rootFile.getAbsolutePath());



Mime
View raw message