Return-Path: Delivered-To: apmail-sling-commits-archive@www.apache.org Received: (qmail 91543 invoked from network); 7 Jul 2010 13:39:13 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 7 Jul 2010 13:39:13 -0000 Received: (qmail 27413 invoked by uid 500); 7 Jul 2010 13:39:13 -0000 Delivered-To: apmail-sling-commits-archive@sling.apache.org Received: (qmail 27357 invoked by uid 500); 7 Jul 2010 13:39:12 -0000 Mailing-List: contact commits-help@sling.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sling.apache.org Delivered-To: mailing list commits@sling.apache.org Received: (qmail 27349 invoked by uid 99); 7 Jul 2010 13:39:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Jul 2010 13:39:12 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Jul 2010 13:39:09 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 23A712388A64; Wed, 7 Jul 2010 13:37:47 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r961371 - /sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/operations/AbstractCopyMoveOperation.java Date: Wed, 07 Jul 2010 13:37:47 -0000 To: commits@sling.apache.org From: justin@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100707133747.23A712388A64@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: justin Date: Wed Jul 7 13:37:46 2010 New Revision: 961371 URL: http://svn.apache.org/viewvc?rev=961371&view=rev Log: SLING-1447 - fixing relative copy/move path to remove workspace if necessary Modified: sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/operations/AbstractCopyMoveOperation.java Modified: sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/operations/AbstractCopyMoveOperation.java URL: http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/operations/AbstractCopyMoveOperation.java?rev=961371&r1=961370&r2=961371&view=diff ============================================================================== --- sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/operations/AbstractCopyMoveOperation.java (original) +++ sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/operations/AbstractCopyMoveOperation.java Wed Jul 7 13:37:46 2010 @@ -46,6 +46,8 @@ abstract class AbstractCopyMoveOperation HtmlResponse response, List changes) throws RepositoryException { + Session session = request.getResourceResolver().adaptTo(Session.class); + VersioningConfiguration versioningConfiguration = getVersioningConfiguration(request); Resource resource = request.getResource(); @@ -66,12 +68,12 @@ abstract class AbstractCopyMoveOperation dest = ResourceUtil.getParent(source) + "/" + dest; } dest = ResourceUtil.normalize(dest); + dest = removeAndValidateWorkspace(dest, session); // destination parent and name String dstParent = trailingSlash ? dest : ResourceUtil.getParent(dest); // delete destination if already exists - Session session = request.getResourceResolver().adaptTo(Session.class); if (!trailingSlash && session.itemExists(dest)) { final String replaceString = request.getParameter(SlingPostConstants.RP_REPLACE);