bdelacretaz commented on a change in pull request #40:
URL:
https://github.com/apache/sling-org-apache-sling-api/pull/40#discussion_r785825886
##########
File path: src/main/java/org/apache/sling/api/resource/external/URIProvider.java
##########
@@ -91,4 +85,34 @@
*/
PUBLIC
}
+
+ /**
+ * Return a URI applicable to the defined scope.
+ * @param resource the resource to convert from.
+ * @param scope the required scope.
+ * @param operation the required operation.
+ * @return a URI if the resource has a URI suitable for the requested
scope and operation, otherwise the implementation should throw an {@link
IllegalArgumentException}.
+ * @throws IllegalArgumentException if a URI for the requested scope and
operation cannot be provided to the caller.
+ * @deprecated Use {@link #getOptionalUriForResource(Resource, Scope,
Operation)} instead.
+ */
+ @Deprecated
+ @NotNull URI toURI(@NotNull Resource resource, @NotNull Scope scope,
@NotNull Operation operation);
+
+ /**
+ * Return a URI applicable to the defined scope.
+ * @param resource the resource to convert from.
+ * @param scope the required scope.
+ * @param operation the required operation.
+ * @return a URI if the resource has a URI suitable for the requested
scope and operation, otherwise {@link Optional#empty()}.
+ * @since 1.1.0 (Sling API Bundle 2.25.0)
+ */
+ default @NotNull Optional<URI> getOptionalUriForResource(@NotNull Resource
resource, @NotNull Scope scope, @NotNull Operation operation) {
Review comment:
Unless there's a good reason to use a different name I think this should
be called `toOptionalURI` based on the original `toURI` name.
--
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]