org.apache.sling.engine.impl.request
Class SlingRequestPathInfo

java.lang.Object
  extended by org.apache.sling.engine.impl.request.SlingRequestPathInfo
All Implemented Interfaces:
RequestPathInfo

public class SlingRequestPathInfo
extends Object
implements RequestPathInfo

Sling request URI parser that provides SlingRequestPathInfo for the current request, based on the path of the Resource. The values provided by this depend on the Resource.getPath() value, as the ResourceResolver might use all or only part of the request URI path to locate the resource (see also SLING-60 ). What we're after is the remainder of the path, the part that was not used to locate the Resource, and we split that part in different subparts: selectors, extension and suffix.

See Also:
for a number of examples.

Constructor Summary
SlingRequestPathInfo(Resource r)
          break requestPath as required by SlingRequestPathInfo
 
Method Summary
 String getExtension()
          Returns the extension from the URL or null if the request URL does not contain an extension.
 String getResourcePath()
          Return the "resource path" part of the URL, what comes before selectors, extension and suffix.
 String[] getSelectors()
          Returns the selectors decoded from the request URL as an array of strings.
 String getSelectorString()
          Returns the selectors decoded from the request URL as string.
 String getSuffix()
          Returns the suffix part of the URL or null if the request URL does not contain a suffix.
 SlingRequestPathInfo merge(RequestDispatcherOptions options)
           
 SlingRequestPathInfo merge(RequestPathInfo baseInfo)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SlingRequestPathInfo

public SlingRequestPathInfo(Resource r)
break requestPath as required by SlingRequestPathInfo

Method Detail

merge

public SlingRequestPathInfo merge(RequestPathInfo baseInfo)

merge

public SlingRequestPathInfo merge(RequestDispatcherOptions options)

toString

public String toString()
Overrides:
toString in class Object

getExtension

public String getExtension()
Description copied from interface: RequestPathInfo
Returns the extension from the URL or null if the request URL does not contain an extension.

Decomposition of the request URL is defined in the Decomposition of a Request URL above.

Specified by:
getExtension in interface RequestPathInfo
Returns:
The extension from the request URL.

getSelectors

public String[] getSelectors()
Description copied from interface: RequestPathInfo
Returns the selectors decoded from the request URL as an array of strings. This array is derived from the selector string by splitting the string on dots. Returns an empty array if the request has no selectors.

Decomposition of the request URL is defined in the Decomposition of a Request URL above.

Specified by:
getSelectors in interface RequestPathInfo
See Also:
RequestPathInfo.getSelectorString()

getSelectorString

public String getSelectorString()
Description copied from interface: RequestPathInfo
Returns the selectors decoded from the request URL as string. Returns null if the request has no selectors.

Decomposition of the request URL is defined in the Decomposition of a Request URL above.

Specified by:
getSelectorString in interface RequestPathInfo
See Also:
RequestPathInfo.getSelectors()

getSuffix

public String getSuffix()
Description copied from interface: RequestPathInfo
Returns the suffix part of the URL or null if the request URL does not contain a suffix.

Decomposition of the request URL is defined in the Decomposition of a Request URL above.

Specified by:
getSuffix in interface RequestPathInfo
Returns:
The suffix part of the request URL.

getResourcePath

public String getResourcePath()
Description copied from 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 Resource.getPath(). Rather it is equal to the resolution path metadata property of the resource.

Specified by:
getResourcePath in interface RequestPathInfo


Copyright © 2007-2013 The Apache Software Foundation. All Rights Reserved.