Hi,
those two rules sound reasonable and is probably the only check that the
resource resolver itself could do.
I don't think that a general escaping method helps as providers usually
do their own escaping already today. If these providers do not switch to
the general one, it does not help. If they switch to the general one,
these might be a breaking change.
Regards
Carsten
On 28.05.2025 11:57, Konrad Windszus wrote:
Hi,
Currently the documentation at
https://sling.apache.org/documentation/the-sling-engine/resources.html doesn’t
list which resource names are valid in Sling
However the Sling API imposes the following restrictions already:
- “/“ must not be used as it is the path separator.
- “.” must not be used as the only character (arbitrarily often) in a resource
name, as this is used for relative path segments
Obviously each resource provider may impose additional restrictions.
Is this observation correct? Is there other characters which must not be used
in resource names?
Should Sling API have a an escape/unescape method in
https://github.com/apache/sling-org-apache-sling-api/blob/master/src/main/java/org/apache/sling/api/resource/ResourceUtil.java?
If so which escape rules should we propose?
Thanks in advance for your input.
Konrad
--
Carsten Ziegeler
Adobe
cziege...@apache.org