kwin commented on code in PR #159:
URL: 
https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/159#discussion_r1116814303


##########
src/main/java/org/apache/sling/feature/cpconverter/index/IndexDefinitionsJsonWriter.java:
##########
@@ -145,7 +147,7 @@ private void write(JsonGenerator json, DocViewNode2 index, 
String parentPath) th
             json.writeStartObject(JcrConstants.JCR_CONTENT);
             String blobAsString = new String(binary.get(), 
StandardCharsets.UTF_8);
             write(json, JcrConstants.JCR_PRIMARYTYPE, 
Collections.singletonList(JcrConstants.NT_RESOURCE),  s -> 
Json.createValue("nam:" + s ));
-            write(json, 
JcrConstants.JCR_MIMETYPE,Collections.singletonList(Files.probeContentType(Paths.get(nodePath))),
 Json::createValue );
+            write(json, 
JcrConstants.JCR_MIMETYPE,Collections.singletonList(Files.probeContentType(Paths.get(FilenameUtils.getName(nodePath)))),
 Json::createValue );

Review Comment:
   Maybe also the variable naming is just confusing because FS path != 
repository path. Not sure what node path is supposed to contain here. To 
convert from one to the other use 
https://github.com/apache/jackrabbit-filevault/blob/master/vault-core/src/main/java/org/apache/jackrabbit/vault/util/PlatformNameFormat.java



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to