You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by kw...@apache.org on 2021/07/22 09:14:08 UTC

[sling-org-apache-sling-api] branch feature/requestpathinfowrapper created (now 6004332)

This is an automated email from the ASF dual-hosted git repository.

kwin pushed a change to branch feature/requestpathinfowrapper
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-api.git.


      at 6004332  SLING-10650 add RequestPathInfo wrapper

This branch includes the following new commits:

     new 6004332  SLING-10650 add RequestPathInfo wrapper

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[sling-org-apache-sling-api] 01/01: SLING-10650 add RequestPathInfo wrapper

Posted by kw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kwin pushed a commit to branch feature/requestpathinfowrapper
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-api.git

commit 6004332b0de3b70eed0638b82b4e2a82ba4f9a8b
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Thu Jul 22 11:13:53 2021 +0200

    SLING-10650 add RequestPathInfo wrapper
---
 .../sling/api/wrappers/RequestPathInfoWrapper.java | 62 ++++++++++++++++++++++
 .../apache/sling/api/wrappers/package-info.java    |  2 +-
 2 files changed, 63 insertions(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/api/wrappers/RequestPathInfoWrapper.java b/src/main/java/org/apache/sling/api/wrappers/RequestPathInfoWrapper.java
new file mode 100644
index 0000000..72fa680
--- /dev/null
+++ b/src/main/java/org/apache/sling/api/wrappers/RequestPathInfoWrapper.java
@@ -0,0 +1,62 @@
+/*
+ * 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.wrappers;
+
+import org.apache.sling.api.request.RequestPathInfo;
+import org.apache.sling.api.resource.Resource;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * The <code>RequestPathInfoWrapper</code> class is a default wrapper
+ * class around a {@link RequestPathInfo} which may be extended to amend
+ * the functionality of the original request path info object.
+ */
+public class RequestPathInfoWrapper implements RequestPathInfo {
+
+    private final RequestPathInfo delegate;
+    
+    public RequestPathInfoWrapper(RequestPathInfo delegate) {
+        this.delegate = delegate;
+    }
+
+    public @NotNull String getResourcePath() {
+        return delegate.getResourcePath();
+    }
+
+    public @Nullable String getExtension() {
+        return delegate.getExtension();
+    }
+
+    public @Nullable String getSelectorString() {
+        return delegate.getSelectorString();
+    }
+
+    public @NotNull String[] getSelectors() {
+        return delegate.getSelectors();
+    }
+
+    public @Nullable String getSuffix() {
+        return delegate.getSuffix();
+    }
+
+    public @Nullable Resource getSuffixResource() {
+        return delegate.getSuffixResource();
+    }
+}
diff --git a/src/main/java/org/apache/sling/api/wrappers/package-info.java b/src/main/java/org/apache/sling/api/wrappers/package-info.java
index 39ff070..8a2b990 100644
--- a/src/main/java/org/apache/sling/api/wrappers/package-info.java
+++ b/src/main/java/org/apache/sling/api/wrappers/package-info.java
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-@Version("2.7.0")
+@Version("2.8.0")
 package org.apache.sling.api.wrappers;
 
 import org.osgi.annotation.versioning.Version;