Class PathInfo

java.lang.Object
com.day.cq.commons.PathInfo
All Implemented Interfaces:
RequestPathInfo

public class PathInfo extends Object implements RequestPathInfo
Utility class for creating a sling RequestPathInfo by parsing a URL path. Note that this does not check for the existence of the resource and finding the longest-matching path as the default Sling resource resolution does, it only works by parsing the raw string.

The parsing structure looks like this: /resource/path.selector.ext/suffix. The rules are (following the Sling convention):

  • extension is everything between the last dot in the URL and the next slash (or the end of the string)
  • suffix is everything after the extension (including the slash)
  • resource path is everything from the start up to the first dot after the last slash (excluding extension and suffix)
  • selectors are the dot-separated elements between the path and the extension