Author: nextgens
Date: 2007-04-12 18:07:18 +0000 (Thu, 12 Apr 2007)
New Revision: 12613

Modified:
   trunk/freenet/src/freenet/node/fcp/FCPConnectionHandler.java
Log:
Change the wording and the test to address toad's concerns : now its harder to 
figure out whether it's a permission problem or whether the file doesn't exist.

Modified: trunk/freenet/src/freenet/node/fcp/FCPConnectionHandler.java
===================================================================
--- trunk/freenet/src/freenet/node/fcp/FCPConnectionHandler.java        
2007-04-12 17:51:49 UTC (rev 12612)
+++ trunk/freenet/src/freenet/node/fcp/FCPConnectionHandler.java        
2007-04-12 18:07:18 UTC (rev 12613)
@@ -335,8 +335,8 @@
         */
        protected DDACheckJob enqueueDDACheck(String path, boolean read, 
boolean write) throws IllegalArgumentException {
                File directory = FileUtil.getCanonicalFile(new File(path));
-               if(!directory.isDirectory())
-                       throw new IllegalArgumentException("The specified path 
isn't a directory!");
+               if(!directory.exists() || !directory.isDirectory())
+                       throw new IllegalArgumentException("The specified path 
isn't a directory! or doesn't exist or the node doesn't have access to it!");

                File writeFile = (write ? new File(path, "DDACheck-" + new 
Random().nextInt() + ".tmp") : null);

@@ -380,8 +380,8 @@
         */
        protected DDACheckJob popDDACheck(String path) throws 
IllegalArgumentException {
                File directory = FileUtil.getCanonicalFile(new File(path));
-               if(!directory.isDirectory())
-                       throw new IllegalArgumentException("The specified path 
isn't a directory!");
+               if(!directory.exists() || !directory.isDirectory())
+                       throw new IllegalArgumentException("The specified path 
isn't a directory! or doesn't exist or the node doesn't have access to it!");

                synchronized (inTestDirectories) {
                        return (DDACheckJob)inTestDirectories.remove(directory);


Reply via email to