cziegeler commented on a change in pull request #36:
URL:
https://github.com/apache/sling-org-apache-sling-api/pull/36#discussion_r737533620
##########
File path:
src/main/java/org/apache/sling/spi/resource/provider/ResourceProvider.java
##########
@@ -509,6 +509,28 @@ public boolean isLive(final @NotNull ResolveContext<T>
ctx) {
throw new PersistenceException("create is not supported.");
}
+ /**
+ * Reorders the child resources returned by {@link
#listChildren(ResolveContext, Resource)} so that a given resource is listed
before the given sibling resource.
+ *
+ * The changes are transient until {@link #commit(ResolveContext)} is
called..
+ *
+ * @param ctx The {@link ResolveContext}.
+ * @param parent the parent resource containing the child resources to
reorder.
+ * @param name the name of the child resource in {@code parent} to
reorder. Must be an existing child name.
+ * @param followingSiblingName the name of the resource child in {@code
parent} which should come after the reordered resource. If {@code null} is
given the resource is ordered as last among all sibling resources.
+ * @return {@code true} in case the order of the child resources in {@code
parent} have been changed, {@code false} if the given resource were already in
the desired order.
+ * @throws UnsupportedOperationException in case the underlying resource
provider does not support ordering or the child resources of {@code parent} are
provided by different providers.
+ * @throws IllegalArgumentException if either {@code name} or {@code
followingSiblingName} are not existing child names of {@code parent}.
+ * @throws PersistenceException If the operation fails in the underlying
resource provider, e.g. in case the parent resource does not support orderable
children.
+ * @since 1.3.0 (Sling API Bundle 2.24.0)
+ * @see #listChildren(Resource)
+ * @see #getChildren(Resource)
+ */
+ public boolean orderBefore(final @NotNull ResolveContext<T> ctx, final
@NotNull Resource parent, final @NotNull String name, final @Nullable String
followingSiblingName)
+ throws PersistenceException {
+ throw new PersistenceException("reorderBefore is not supported.");
Review comment:
Shouldn't this throw UnsupportedOperationException ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]