ghenzler commented on a change in pull request #23:
URL: 
https://github.com/apache/sling-org-apache-sling-api/pull/23#discussion_r490883976



##########
File path: src/main/java/org/apache/sling/api/resource/uri/ResourceUri.java
##########
@@ -0,0 +1,184 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.api.resource.uri;
+
+import static org.apache.commons.lang3.StringUtils.isBlank;
+import static org.apache.commons.lang3.StringUtils.isNotBlank;
+
+import java.net.URI;
+import java.util.Map;
+import java.util.function.Consumer;
+
+import org.apache.sling.api.request.RequestPathInfo;
+import org.apache.sling.api.resource.Resource;
+
+/**
+ * Represents an immutable URI that points to a resource or alternatively, can 
contain opaque URIs like {@code mailto:} or
+ * {@code javascript:}. Use {@link ResourceUri#adjust(Consumer)} or {@link 
ResourceUriBuilder} to create new or modified instances.
+ */
+public interface ResourceUri extends RequestPathInfo {
+
+    /**
+     * @return returns the URI.
+     */
+    public URI toUri();
+
+    /**
+     * @return returns the URI as String.
+     */
+    public String toString();
+
+    /**
+     * @return returns the scheme of the ResourceUri or null if not set

Review comment:
       Inheriting from RequestPathInfo brings a lot of advantages though down 
the line (for the planned changes for the Resource Mapping SPI)
   
   Also often developers will more use the builder with its setter methods and 
then just toString() - so weighing pros/cons I'd rather leave it as is.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to