You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Carsten Ziegeler (JIRA)" <ji...@apache.org> on 2017/05/11 07:46:04 UTC
[jira] [Updated] (SLING-6501) Incorrect normalization of path of an
asset with name beginning with '.'
[ https://issues.apache.org/jira/browse/SLING-6501?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Carsten Ziegeler updated SLING-6501:
------------------------------------
Fix Version/s: API 2.16.4
> Incorrect normalization of path of an asset with name beginning with '.'
> ------------------------------------------------------------------------
>
> Key: SLING-6501
> URL: https://issues.apache.org/jira/browse/SLING-6501
> Project: Sling
> Issue Type: Bug
> Components: API
> Reporter: Gaurav Gupta
> Fix For: API 2.16.4
>
>
> When a new asset named ".jpg" is being modified in JCR, [ResourceUtil.normalize()|https://sling.apache.org/apidocs/sling7/org/apache/sling/api/resource/ResourceUtil.html#normalize-java.lang.String-] method returns an incorrect normalized path which leads to the creation of a folder named '.jp' under the same parent node. A small test shows this anomaly.
> {code:java}
> public class RUNormalizeTest {
> public static String toPropertyPath(String paramName, String path) {
> if (!paramName.startsWith("/")) {
> paramName = ResourceUtil.normalize(path + '/' + paramName);
> }
> return paramName;
> }
>
> public static void main(String[] args) {
> String pName = "./jpg_folder/.jpg/jcr:content/metadata/dc:title";
> String path = "/content/dam";
> System.out.println(toPropertyPath(pName,path));
> }
> }
> {code}
> Expected output: /content/dam/jpg_folder/.jpg/jcr:content/metadata/dc:title
> Output: /content/dam/jpg_folder/.jp/jcr:content/metadata/dc:title
> In the above code, the properties of an asset named '.jpg' are being modified. However, the normalize method returns an incorrect path for the input path.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)