You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by fm...@apache.org on 2008/08/25 15:20:33 UTC
svn commit: r688719 -
/incubator/sling/trunk/api/src/main/java/org/apache/sling/api/resource/ResourceMetadata.java
Author: fmeschbe
Date: Mon Aug 25 06:20:33 2008
New Revision: 688719
URL: http://svn.apache.org/viewvc?rev=688719&view=rev
Log:
SLING-627 Add sling.resolutionPathInfo property and declare it mandatory
Modified:
incubator/sling/trunk/api/src/main/java/org/apache/sling/api/resource/ResourceMetadata.java
Modified: incubator/sling/trunk/api/src/main/java/org/apache/sling/api/resource/ResourceMetadata.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/api/src/main/java/org/apache/sling/api/resource/ResourceMetadata.java?rev=688719&r1=688718&r2=688719&view=diff
==============================================================================
--- incubator/sling/trunk/api/src/main/java/org/apache/sling/api/resource/ResourceMetadata.java (original)
+++ incubator/sling/trunk/api/src/main/java/org/apache/sling/api/resource/ResourceMetadata.java Mon Aug 25 06:20:33 2008
@@ -26,10 +26,11 @@
* just a map of objects indexed by string keys.
* <p>
* The actual contents of the meta data map is implementation specific with the
- * exception for the {@link #RESOLUTION_PATH sling.resolutionPath} property
- * which must be provided by all implementations and contain the part of the
- * request URI used to resolve the resource. The type of this property value is
- * defined to be <code>String</code>.
+ * exception the {@link #RESOLUTION_PATH sling.resolutionPath} and
+ * {@link #RESOLUTION_PATH_INFO sling.resolutionPathInfo} properties which must
+ * be provided by all implementations and contain the parts of the request URI
+ * used to resolve the resource. The type of these property values is defined to
+ * be <code>String</code>.
* <p>
* Note, that the prefix <em>sling.</em> to key names is reserved for the
* Sling implementation.
@@ -44,6 +45,18 @@
public static final String RESOLUTION_PATH = "sling.resolutionPath";
/**
+ * The name of the required property providing the part of the request URI
+ * which was not used to the resolve the resource to which the meta data
+ * instance belongs (value is "sling.resolutionPathInfo"). The value of this
+ * property concatenated to the value of the
+ * {@link #RESOLUTION_PATH sling.resolutionPath} property returns the
+ * original request URI leading to the resource.
+ *
+ * @since 2.0.3-incubator-SNAPSHOT
+ */
+ public static final String RESOLUTION_PATH_INFO = "sling.resolutionPathInfo";
+
+ /**
* The name of the optional property providing the content type of the
* resource if the resource is streamable (value is "sling.contentType").
* This property may be missing if the resource is not streamable or if the
@@ -228,4 +241,28 @@
return null;
}
+
+ /**
+ * Sets the {@link #RESOLUTION_PATH_INFO} property to
+ * <code>resolutionPathInfo</code> if not <code>null</code>.
+ */
+ public void setResolutionPathInfo(String resolutionPathInfo) {
+ if (resolutionPathInfo != null) {
+ put(RESOLUTION_PATH_INFO, resolutionPathInfo);
+ }
+ }
+
+ /**
+ * Returns the {@link #RESOLUTION_PATH_INFO} property if not
+ * <code>null</code> and a <code>String</code> instance. Otherwise
+ * <code>null</code> is returned.
+ */
+ public String getResolutionPathInfo() {
+ Object value = get(RESOLUTION_PATH_INFO);
+ if (value instanceof String) {
+ return (String) value;
+ }
+
+ return null;
+ }
}