You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2015/10/29 15:34:42 UTC

svn commit: r1711280 - /sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java

Author: cziegeler
Date: Thu Oct 29 14:34:42 2015
New Revision: 1711280

URL: http://svn.apache.org/viewvc?rev=1711280&view=rev
Log:
SLING-5186 : Implement Copy/move

Modified:
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java?rev=1711280&r1=1711279&r2=1711280&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java (original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java Thu Oct 29 14:34:42 2015
@@ -509,12 +509,12 @@ public class JcrResourceProvider extends
             final String srcAbsPath,
             final String destAbsPath) throws PersistenceException {
         final String srcNodePath = pathMapper.mapResourcePathToJCRPath(srcAbsPath);
-        final String dstNodePath = pathMapper.mapResourcePathToJCRPath(destAbsPath);
+        final String dstNodePath = pathMapper.mapResourcePathToJCRPath(destAbsPath + '/' + ResourceUtil.getName(srcAbsPath));
         try {
             ctx.getProviderState().getSession().move(srcNodePath, dstNodePath);
             return true;
-        } catch (RepositoryException e) {
-            throw new PersistenceException("Can't move resource", e);
+        } catch (final RepositoryException e) {
+            throw new PersistenceException("Unable to move resource to " + destAbsPath, e, srcAbsPath, null);
         }
     }