Author: cziegeler
Date: Sat Jun 13 15:59:58 2015
New Revision: 1685279
URL: http://svn.apache.org/r1685279
Log:
SLING-4750 : New resource provider API
Modified:
sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceResolver.java
sling/trunk/bundles/api/src/main/java/org/apache/sling/spi/resource/provider/ResourceProvider.java
Modified:
sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceResolver.java
URL:
http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceResolver.java?rev=1685279&r1=1685278&r2=1685279&view=diff
==============================================================================
---
sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceResolver.java
(original)
+++
sling/trunk/bundles/api/src/main/java/org/apache/sling/api/resource/ResourceResolver.java
Sat Jun 13 15:59:58 2015
@@ -710,19 +710,21 @@ public interface ResourceResolver extend
/**
* This method copies the subgraph rooted at, and including, the resource
at
- * <code>srcAbsPath</code> to the new location at <code>destAbsPath</code>.
- * <p>
- * TODO - clarify whether destAbsPath is the parent of the new tree or the
root
+ * <code>srcAbsPath</code> to the new location at <code>destAbsPath</code>
and
+ * adds it as a child node of the resource at <code>destAbsPath</code>.
*
* If the copy operation is within a single resource provider, the
resource provider
* can use an optimized copy operation. Otherwise the resource resolver
copies resources
* from one provider to another.
*
+ * The resource at <code>destAbsPath</code> needs to exist, if not a
{@code PersistenceException}
+ * is thrown. If a child resource with the same name already exists at
<code>destAbsPath</code>
+ * a {@code PersistenceException} is thrown.
+ *
* @param srcAbsPath the path of the resource to be copied.
* @param destAbsPath the location to which the resource at
* <code>srcAbsPath</code> is to be copied.
- * @throws PersistenceException
- * @throws org.apache.sling.api.SlingException
+ * @throws PersistenceException If an error occurs.
* @throws IllegalStateException if this resource resolver has already been
* {@link #close() closed}.
* @since 2.9 (Sling API Bundle 2.10.0)
@@ -733,19 +735,21 @@ public interface ResourceResolver extend
/**
* This method moves the subgraph rooted at, and including, the resource at
- * <code>srcAbsPath</code> to the new location at <code>destAbsPath</code>.
- * <p>
- * TODO - clarify whether destAbsPath is the parent of the new tree or the
root
+ * <code>srcAbsPath</code> to the new location at <code>destAbsPath</code>
and
+ * adds it as a child node of the resource at <code>destAbsPath</code>.
*
* If the move operation is within a single resource provider, the
resource provider
* can use an optimized move operation. Otherwise the resource resolver
moves resources
* from one provider to another.
*
+ * The resource at <code>destAbsPath</code> needs to exist, if not a
{@code PersistenceException}
+ * is thrown. If a child resource with the same name already exists at
<code>destAbsPath</code>
+ * a {@code PersistenceException} is thrown.
+ *
* @param srcAbsPath the path of the resource to be copied.
* @param destAbsPath the location to which the resource at
- * <code>srcAbsPath</code> is to be copied.
- * @throws PersistenceException
- * @throws org.apache.sling.api.SlingException
+ * <code>srcAbsPath</code> is to be moved.
+ * @throws PersistenceException If an error occurs.
* @throws IllegalStateException if this resource resolver has already been
* {@link #close() closed}.
* @since 2.9 (Sling API Bundle 2.10.0)
Modified:
sling/trunk/bundles/api/src/main/java/org/apache/sling/spi/resource/provider/ResourceProvider.java
URL:
http://svn.apache.org/viewvc/sling/trunk/bundles/api/src/main/java/org/apache/sling/spi/resource/provider/ResourceProvider.java?rev=1685279&r1=1685278&r2=1685279&view=diff
==============================================================================
---
sling/trunk/bundles/api/src/main/java/org/apache/sling/spi/resource/provider/ResourceProvider.java
(original)
+++
sling/trunk/bundles/api/src/main/java/org/apache/sling/spi/resource/provider/ResourceProvider.java
Sat Jun 13 15:59:58 2015
@@ -421,7 +421,21 @@ public abstract class ResourceProvider<T
}
/**
- * TODO
+ * This method copies the subgraph rooted at, and including, the resource
at
+ * <code>srcAbsPath</code> to the new location at <code>destAbsPath</code>
and
+ * adds it as a child node of the resource at <code>destAbsPath</code>.
+ *
+ * Both resources are resources from this provider and the full tree is
+ * provided by this provider as well.
+ *
+ * The resource at <code>destAbsPath</code> needs to exist, if not a
{@code PersistenceException}
+ * is thrown. If a child resource with the same name already exists at
<code>destAbsPath</code>
+ * a {@code PersistenceException} is thrown.
+ *
+ * @param srcAbsPath the path of the resource to be copied.
+ * @param destAbsPath the location to which the resource at
+ * <code>srcAbsPath</code> is to be copied.
+ * @throws PersistenceException If an error occurs.
* @return {@code true} if the provider can perform the copy
*/
public boolean copy(final String srcAbsPath,
@@ -431,7 +445,21 @@ public abstract class ResourceProvider<T
}
/**
- * TODO
+ * This method moves the subgraph rooted at, and including, the resource at
+ * <code>srcAbsPath</code> to the new location at <code>destAbsPath</code>
and
+ * adds it as a child node of the resource at <code>destAbsPath</code>.
+ *
+ * Both resources are resources from this provider and the full tree is
+ * provided by this provider as well.
+ *
+ * The resource at <code>destAbsPath</code> needs to exist, if not a
{@code PersistenceException}
+ * is thrown. If a child resource with the same name already exists at
<code>destAbsPath</code>
+ * a {@code PersistenceException} is thrown.
+ *
+ * @param srcAbsPath the path of the resource to be copied.
+ * @param destAbsPath the location to which the resource at
+ * <code>srcAbsPath</code> is to be moved.
+ * @throws PersistenceException If an error occurs.
* @return {@code true} if the provider can perform the move
*/