You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Konrad Windszus (Jira)" <ji...@apache.org> on 2025/06/10 18:10:00 UTC

[jira] [Updated] (OAK-11756) Add method isValidJcrName(String) to o.a.j.util.Text

     [ https://issues.apache.org/jira/browse/OAK-11756?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Konrad Windszus updated OAK-11756:
----------------------------------
    Description: 
Currently there is only https://jackrabbit.apache.org/api/trunk/org/apache/jackrabbit/util/Text.html#escapeIllegalJcrChars(java.lang.String) and https://jackrabbit.apache.org/api/trunk/org/apache/jackrabbit/util/Text.html#unescapeIllegalJcrChars(java.lang.String) but no direct method which allows to check whether a name needs escaping or not.

Just checking the return value of {{Text.escapeIllegalJcrChars(...)}} is not suitable, as this will even escape the percent character ({{%}}) which is valid in JCR names.

  was:
Currently there is only https://jackrabbit.apache.org/api/trunk/org/apache/jackrabbit/util/Text.html#escapeIllegalJcrChars(java.lang.String) and https://jackrabbit.apache.org/api/trunk/org/apache/jackrabbit/util/Text.html#unescapeIllegalJcrChars(java.lang.String) but no direct method which allows to check whether a name needs escaping or not.

Just checking the return value of escapeIllegalJcrChars(...) is not enough, as this will even escape the percent character ({{%}}) which is valid in JCR names.


> Add method isValidJcrName(String) to o.a.j.util.Text
> ----------------------------------------------------
>
>                 Key: OAK-11756
>                 URL: https://issues.apache.org/jira/browse/OAK-11756
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: commons
>            Reporter: Konrad Windszus
>            Priority: Major
>
> Currently there is only https://jackrabbit.apache.org/api/trunk/org/apache/jackrabbit/util/Text.html#escapeIllegalJcrChars(java.lang.String) and https://jackrabbit.apache.org/api/trunk/org/apache/jackrabbit/util/Text.html#unescapeIllegalJcrChars(java.lang.String) but no direct method which allows to check whether a name needs escaping or not.
> Just checking the return value of {{Text.escapeIllegalJcrChars(...)}} is not suitable, as this will even escape the percent character ({{%}}) which is valid in JCR names.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)