Return-Path: Delivered-To: apmail-incubator-sling-commits-archive@locus.apache.org Received: (qmail 81868 invoked from network); 25 Aug 2008 13:21:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Aug 2008 13:21:24 -0000 Received: (qmail 95530 invoked by uid 500); 25 Aug 2008 13:21:23 -0000 Delivered-To: apmail-incubator-sling-commits-archive@incubator.apache.org Received: (qmail 95514 invoked by uid 500); 25 Aug 2008 13:21:23 -0000 Mailing-List: contact sling-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: sling-dev@incubator.apache.org Delivered-To: mailing list sling-commits@incubator.apache.org Received: (qmail 95505 invoked by uid 99); 25 Aug 2008 13:21:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Aug 2008 06:21:23 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Aug 2008 13:20:34 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 01F522388970; Mon, 25 Aug 2008 06:20:34 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r688719 - /incubator/sling/trunk/api/src/main/java/org/apache/sling/api/resource/ResourceMetadata.java Date: Mon, 25 Aug 2008 13:20:33 -0000 To: sling-commits@incubator.apache.org From: fmeschbe@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080825132034.01F522388970@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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. *

* 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 String. + * 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 String. *

* Note, that the prefix sling. 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 + * resolutionPathInfo if not null. + */ + public void setResolutionPathInfo(String resolutionPathInfo) { + if (resolutionPathInfo != null) { + put(RESOLUTION_PATH_INFO, resolutionPathInfo); + } + } + + /** + * Returns the {@link #RESOLUTION_PATH_INFO} property if not + * null and a String instance. Otherwise + * null is returned. + */ + public String getResolutionPathInfo() { + Object value = get(RESOLUTION_PATH_INFO); + if (value instanceof String) { + return (String) value; + } + + return null; + } }