ghenzler commented on a change in pull request #23: URL: https://github.com/apache/sling-org-apache-sling-api/pull/23#discussion_r491726353
########## File path: src/main/java/org/apache/sling/api/resource/uri/ResourceUri.java ########## @@ -0,0 +1,181 @@ +/* + * 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 { Review comment: Inheriting from `RequestPathInfo` helps to simplify the implementation of the planned changes in resourceresolver/engine/auth.core. Also the initial motivation of this class is to be able to extend the resource mapping by an SPI interface (not on this PR, but "waiting" on another branch, see https://github.com/apache/sling-org-apache-sling-api/blob/2325681b27413d23c8aa841278aaa6e168104cf0/src/main/java/org/apache/sling/spi/resource/mapping/ResourceUriMapper.java#L45) - for the approach to have a chain of ResourceUriMappers it is important that there is exactly one class that is passed through the chain. But now thinking of URIs like `#justfragment` or `mailto:j...@example.com`, I actually think it would be better to use the name `SlingUri` rather than `ResourceUri` - most Uris will have a corresponding Resource but the given examples have no relation to a resource, hence the name `SlingUri` would be better I guess... ########## File path: src/main/java/org/apache/sling/api/resource/uri/ResourceUri.java ########## @@ -0,0 +1,181 @@ +/* + * 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 { Review comment: I updated the PR accordingly (using `SlingUri` and `SlingUriBuilder` now) ---------------------------------------------------------------- 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: us...@infra.apache.org