jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r650532 - in /jackrabbit/branches/1.4/jackrabbit-core/src: main/java/org/apache/jackrabbit/core/fs/mem/MemoryFileSystem.java test/java/org/apache/jackrabbit/core/fs/AbstractFileSystemTest.java
Date Tue, 22 Apr 2008 14:28:02 GMT
Author: jukka
Date: Tue Apr 22 07:27:42 2008
New Revision: 650532

URL: http://svn.apache.org/viewvc?rev=650532&view=rev
Log:
1.4: Merged revisions 635583 and 635591 (JCR-1444)

Modified:
    jackrabbit/branches/1.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/mem/MemoryFileSystem.java
    jackrabbit/branches/1.4/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/fs/AbstractFileSystemTest.java

Modified: jackrabbit/branches/1.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/mem/MemoryFileSystem.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/mem/MemoryFileSystem.java?rev=650532&r1=650531&r2=650532&view=diff
==============================================================================
--- jackrabbit/branches/1.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/mem/MemoryFileSystem.java
(original)
+++ jackrabbit/branches/1.4/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/fs/mem/MemoryFileSystem.java
Tue Apr 22 07:27:42 2008
@@ -136,6 +136,10 @@
 
     public OutputStream getOutputStream(String filePath)
             throws FileSystemException {
+        if (isFolder(filePath)) {
+            throw new FileSystemException("path denotes folder: " + filePath);
+        }
+
         String folderPath = filePath;
         if (filePath.lastIndexOf(FileSystem.SEPARATOR) > 0) {
             folderPath = filePath.substring(0, filePath.lastIndexOf("/"));

Modified: jackrabbit/branches/1.4/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/fs/AbstractFileSystemTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/1.4/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/fs/AbstractFileSystemTest.java?rev=650532&r1=650531&r2=650532&view=diff
==============================================================================
--- jackrabbit/branches/1.4/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/fs/AbstractFileSystemTest.java
(original)
+++ jackrabbit/branches/1.4/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/fs/AbstractFileSystemTest.java
Tue Apr 22 07:27:42 2008
@@ -152,6 +152,14 @@
         assertEquals(1, list.length);
         assertEquals("subfolder", list[0]);
 
+        // Try to create a file coliding with an exisiting folder
+        try {
+            createFile("/folder2/subfolder", sampleBytes);
+            fail("FileSystemException expected");
+        } catch (FileSystemException e) {
+            // ok
+        }
+
         // Delete the subfolder
         fs.deleteFolder("/folder2/subfolder");
         assertFalse(fs.exists("/folder2/subfolder"));



Mime
View raw message