jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r585495 - in /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs: FileSystem.java mem/MemoryFileSystem.java
Date Wed, 17 Oct 2007 13:36:46 GMT
Author: jukka
Date: Wed Oct 17 06:36:45 2007
New Revision: 585495

URL: http://svn.apache.org/viewvc?rev=585495&view=rev
Log:
JCR-1176: MemoryFileSystem is different from other FileSystems
    - Clarified that isFile() and isFolder() should check for existence
      (LocalFileSystem and DatabaseFileSystem already work this way)
    - Fixed MemoryFileSystem accordingly

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/FileSystem.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/mem/MemoryFileSystem.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/FileSystem.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/FileSystem.java?rev=585495&r1=585494&r2=585495&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/FileSystem.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/FileSystem.java
Wed Oct 17 06:36:45 2007
@@ -108,13 +108,14 @@
      * Tests whether the file system entry denoted by this path exists.
      *
      * @param path the path of a file system entry.
-     * @return true if the file system entry at path is a file; false otherwise.
+     * @return true if the file system entry at path exists; false otherwise.
      * @throws FileSystemException
      */
     boolean exists(String path) throws FileSystemException;
 
     /**
-     * Tests whether the file system entry denoted by this path is a file.
+     * Tests whether the file system entry denoted by this path exists and
+     * is a file.
      *
      * @param path the path of a file system entry.
      * @return true if the file system entry at path is a file; false otherwise.
@@ -123,7 +124,8 @@
     boolean isFile(String path) throws FileSystemException;
 
     /**
-     * Tests whether the file system entry denoted by this path is a folder.
+     * Tests whether the file system entry denoted by this path exists and
+     * is a folder.
      *
      * @param path the path of a file system entry.
      * @return true if the file system entry at path is a folder; false otherwise.

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/mem/MemoryFileSystem.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/mem/MemoryFileSystem.java?rev=585495&r1=585494&r2=585495&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/mem/MemoryFileSystem.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/mem/MemoryFileSystem.java
Wed Oct 17 06:36:45 2007
@@ -170,8 +170,7 @@
     }
 
     public boolean isFile(String path) throws FileSystemException {
-        assertExistence(path);
-        return !getEntry(path).isFolder();
+        return exists(path) && !getEntry(path).isFolder();
     }
 
     private MemoryFileSystemEntry getEntry(String path) {
@@ -187,8 +186,7 @@
         if (path.equals("/")) {
             return true;
         } else {
-            assertExistence(path);
-            return getEntry(path).isFolder();
+            return exists(path) && getEntry(path).isFolder();
         }
     }
 



Mime
View raw message