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 name != 
repository path name. Not sure what node path is supposed to contain here.



-- 
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: dev-unsubscr...@sling.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to