| Parses a URL path into its name, is_node_of, options, and subpath.
"is_node_of" is a special flag. It's equivalent short-hand is "~". It
takes precidence over all other options.
For example, "/$(a,b)~foo/bar" is parsed into:
name: "foo"
is_node_of: true
options: ["a", "b"]
subpath: "/bar"
In the above example, if "foo" is local to our node then we'll invoke
our node's "/bar" servlet, otherwise we'll attempt the "a"
redirector then the "b" redirector.
Additional examples:
- "/$x" == local x, else use default redirectors
- "/$()x" == local x, else fail
- "/$~x" == local node if x is local, else use default redirectors
- "/$(~)x" == local node if x is local, else use default redirectors
- "/$()~x" == local node if x is local, else fail
- "/$!x" == local x, else use "!" redirector
- "/$(!)x" == local x, else use "!" redirector
- "/$(!)~x" == local node if x is local, else use "!" redirector
- "/$(!,~)x" == local node if x is local, else use "!" redirector
We separate out our
PathParser.isNodeOf flag from the
PathParser.getOptions to
distinguish between "/$~x" and "/$()~x". If the "~" was in the options list
then we couldn't distinguish between these two cases.
|