jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r355124 - /incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/fs/db/DbFileSystem.java
Date Thu, 08 Dec 2005 15:33:50 GMT
Author: stefan
Date: Thu Dec  8 07:33:45 2005
New Revision: 355124

URL: http://svn.apache.org/viewcvs?rev=355124&view=rev
Log:
DbFileSystem.copy(): throw exception if srcfile doesn't exist

Modified:
    incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/fs/db/DbFileSystem.java

Modified: incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/fs/db/DbFileSystem.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/fs/db/DbFileSystem.java?rev=355124&r1=355123&r2=355124&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/fs/db/DbFileSystem.java
(original)
+++ incubator/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/fs/db/DbFileSystem.java
Thu Dec  8 07:33:45 2005
@@ -1358,6 +1358,7 @@
             deleteFile(destPath);
         }
 
+        int count = 0;
         PreparedStatement stmt = copyFileStmt;
         synchronized (stmt) {
             try {
@@ -1365,7 +1366,7 @@
                 stmt.setString(2, destName);
                 stmt.setString(3, srcParentDir);
                 stmt.setString(4, srcName);
-                stmt.executeUpdate();
+                count = stmt.executeUpdate();
             } catch (SQLException e) {
                 String msg = "failed to copy file from " + srcPath + " to " + destPath;
                 log.error(msg, e);
@@ -1373,6 +1374,10 @@
             } finally {
                 resetStatement(stmt);
             }
+        }
+
+        if (count == 0) {
+            throw new FileSystemException("no such file: " + srcPath);
         }
     }
 



Mime
View raw message