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 2007/11/02 07:58:05 UTC
svn commit: r591244 -
/incubator/sling/trunk/sling-api/src/main/java/org/apache/sling/api/request/RequestPathInfo.java
Author: fmeschbe
Date: Thu Nov 1 23:58:03 2007
New Revision: 591244
URL: http://svn.apache.org/viewvc?rev=591244&view=rev
Log:
SLING-28 Specify to return null if no selectors, extension or suffix exists and clarify resource path JavaDoc.
(see also http://www.mail-archive.com/sling-dev@incubator.apache.org/msg00714.html)
Modified:
incubator/sling/trunk/sling-api/src/main/java/org/apache/sling/api/request/RequestPathInfo.java
Modified: incubator/sling/trunk/sling-api/src/main/java/org/apache/sling/api/request/RequestPathInfo.java
URL: http://svn.apache.org/viewvc/incubator/sling/trunk/sling-api/src/main/java/org/apache/sling/api/request/RequestPathInfo.java?rev=591244&r1=591243&r2=591244&view=diff
==============================================================================
--- incubator/sling/trunk/sling-api/src/main/java/org/apache/sling/api/request/RequestPathInfo.java (original)
+++ incubator/sling/trunk/sling-api/src/main/java/org/apache/sling/api/request/RequestPathInfo.java Thu Nov 1 23:58:03 2007
@@ -23,28 +23,30 @@
* <p id="decomp">
* <b>Decomposition of a Request URL</b>
* <ol>
- * <li>{@link #getPath() content path} - The longest substring of the
- * request URI resolving to a {@link org.apache.sling.api.resource.Resource} object such that the content path
- * is either the complete request URI the next character in the request URI
- * after the content path is either a dot (<code>.</code>) or a slash (<code>/</code>).
+ * <li>{@link #getPath() content path} - The longest substring of the request
+ * URI resolving to a {@link org.apache.sling.api.resource.Resource} object such
+ * that the content path is either the complete request URI or the next
+ * character in the request URI after the content path is either a dot (<code>.</code>)
+ * or a slash (<code>/</code>).
* <li>{@link #getSelectors() selectors} - If the first character in the
* request URI after the content path is a dot, the string after the dot upto
* but not including the last dot before the next slash character or the end of
* the request URI. If the content path spans the complete request URI or if a
- * slash follows the content path in the request, the no seletors exist. If only
- * one dot follows the content path before the end of the request URI or the
- * next slash, no selectors exist. The selectors are available as
- * {@link #getSelectorString() a single string} and an
+ * slash follows the content path in the request, then no seletors exist. If
+ * only one dot follows the content path before the end of the request URI or
+ * the next slash, no selectors exist. The selectors are available as
+ * {@link #getSelectorString() a single string} and as an
* {@link #getSelectors() array of strings}, which is the selector string
* splitted on dots.
* <li>{@link #getExtension() extension} - The string after the last dot after
* the content path in the request uri but before the end of the request uri or
- * the next slash after the content path in the request uri. If a slash follows
- * the content path in the request URI, the extension is empty.
- * <li>{@link #getSuffix() suffix path} - If the request URI contains more a
- * slash character after the content path and optional selectors and extension,
- * the path starting with the slash upto the end of the request URI is the
- * suffix path.
+ * the next slash after the content path in the request uri. If the content path
+ * spans the complete request URI or a slash follows the content path in the
+ * request URI, the extension is empty.
+ * <li>{@link #getSuffix() suffix path} - If the request URI contains a slash
+ * character after the content path and optional selectors and extension, the
+ * path starting with the slash upto the end of the request URI is the suffix
+ * path.
* </ol>
* <p>
* Examples: <table>
@@ -141,11 +143,21 @@
* </tr>
* </table>
*/
-
public interface RequestPathInfo {
+
+ /**
+ * Return the "resource path" part of the URL, what comes before selectors,
+ * extension and suffix. This string is part of the request URL and need not
+ * be equal to the {@link org.apache.sling.api.resource.Resource#getURI()}.
+ * Rather it is equal to the
+ * {@link org.apache.sling.api.resource.ResourceMetadata#RESOLUTION_PATH resolution path metadata property}
+ * of the resource.
+ */
+ String getResourcePath();
+
/**
- * Returns the extension from the URL or an empty string if the request URL
- * does not contain an extension.
+ * Returns the extension from the URL or <code>null</code> if the request
+ * URL does not contain an extension.
* <p>
* Decomposition of the request URL is defined in the <a
* href="#decomp">Decomposition of a Request URL</a> above.
@@ -155,32 +167,32 @@
String getExtension();
/**
- * Returns the selectors decoded from the request URL as an array of
- * strings. This array is derived from the
- * {@link #getSelectorString() selector string} by splitting the string on
- * dots. Returns an empty array if the request has no selectors.
+ * Returns the selectors decoded from the request URL as string. Returns
+ * <code>null</code> if the request has no selectors.
* <p>
* Decomposition of the request URL is defined in the <a
* href="#decomp">Decomposition of a Request URL</a> above.
*
- * @see #getSelectorString()
+ * @see #getSelectors()
*/
- String[] getSelectors();
+ String getSelectorString();
/**
- * Returns the selectors decoded from the request URL as string. Returns an
- * empty string if the request has no selectors.
+ * Returns the selectors decoded from the request URL as an array of
+ * strings. This array is derived from the
+ * {@link #getSelectorString() selector string} by splitting the string on
+ * dots. Returns an empty array if the request has no selectors.
* <p>
* Decomposition of the request URL is defined in the <a
* href="#decomp">Decomposition of a Request URL</a> above.
*
- * @see #getSelectors()
+ * @see #getSelectorString()
*/
- String getSelectorString();
+ String[] getSelectors();
/**
- * Returns the suffix part of the URL or an empty string if the request URL
- * does not contain a suffix.
+ * Returns the suffix part of the URL or <code>null</code> if the request
+ * URL does not contain a suffix.
* <p>
* Decomposition of the request URL is defined in the <a
* href="#decomp">Decomposition of a Request URL</a> above.
@@ -189,9 +201,4 @@
*/
String getSuffix();
- /**
- * Return the "resource path" part of the URL, what comes before selectors,
- * extension and suffix
- */
- String getResourcePath();
}