Fork me on GitHub


Item Names

The JCR specification already restricts what can go into the “local” part of an item name - see JCR v2.0 Specification, Section 3.2. In particular:

On top of that, Oak implements several additional restrictions (as per JCR v2.0 Specification, Section 3.2.4):

  • The space character (U+0020) is disallowed at the beginning and the end of a (local) name (see JCR v2.0 Specification, Section for motivation).
  • Other ASCII whitespace characters (CR, LF, TAB) are always disallowed (before OAK 1.10, more were disallowed, see OAK-4857).

Finally, the chosen persistence implementation might restrict node names even further, for instance:

  • in the “Document NodeStore”, the UTF-8 representation of local names can not exceed ~150 bytes.

Invalid Java Strings

Due to the way Java represents characters in strings, not every String is a valid sequence of Unicode code points. This is because two characters are needed to represent Unicode “supplementary characters”. If these “surrogate” characters do not appear as a well formed pair, the Java string can not be serialized to a sequence of Unicode characters, nor to a byte sequence (using UTF-8 character encoding).

The system behaviour for these strings is currently undefined. This means that they might get rejected, that they might get accepted but information is lost when they are stored, or they might be stored and retrieved faithfully.

See OAK-5505 fur further information.