jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Klimetschek <aklim...@adobe.com>
Subject Re: Node.getNode and Session.getNode specification
Date Tue, 07 Jun 2011 13:01:28 GMT
On 07.06.11 14:44, "David Buchmann" <david.buchmann@liip.ch> wrote:
>while implementing the jcr interfaces in php [1] we are a bit confused
>about access by relative path [2].
>
>what is a valid relative path? if it would be just names without any
>"/", it would be straightforward. but at least jackrabbit can handle
>../somethingelse or child/propertyname as path.

Support for those relative "sub" paths is defined by the specification. In
my experience, this was a good idea, as they are very often very useful
when coding against the JCR API.

Paths are very clearly defined in the spec in section 3.4:

http://www.day.com/specs/jcr/2.0/3_Repository_Model.html#3.4%20Paths


>however, /somethingelse triggers an invalidargumentexception that no
>absolute path is allowed. what is the reason for that?

The javadocs clearly state that relative paths are expected here. AFAIU,
throwing an IllegalArgumentEx here is the choice of the implementation
(Jackrabbit), but I think it is good to make application code be aware of
absolute/relative path errors by throwing an exception instead of silently
accepting an absolute path (or "incorrect, but repairable path").

Regards,
Alex

-- 
Alexander Klimetschek
Developer // Adobe (Day) // Berlin - Basel


Mime
View raw message