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


##########
src/main/java/org/apache/sling/feature/cpconverter/handlers/IndexDefinitionsEntryHandler.java:
##########
@@ -126,8 +126,9 @@ public void handle(@NotNull String path, @NotNull Archive 
archive, @NotNull Entr
 
                 } else {
                     // binary file, should we attach?
-                    if ( 
archive.getMetaInf().getFilter().contains(repositoryPath)) {
-                        
indexManager.getIndexes().registerBinary(repositoryPath, is);
+                    String binaryParentPath  = 
repositoryPath.substring(0,repositoryPath.lastIndexOf("/")) ;
+                    if ( 
archive.getMetaInf().getFilter().contains(binaryParentPath)) {
+                        
indexManager.getIndexes().registerBinary(binaryParentPath, is);

Review Comment:
   for me it would make more sense to find the parent within the 
`registerBinary` method.



##########
src/main/java/org/apache/sling/feature/cpconverter/handlers/IndexDefinitionsEntryHandler.java:
##########
@@ -126,8 +126,9 @@ public void handle(@NotNull String path, @NotNull Archive 
archive, @NotNull Entr
 
                 } else {
                     // binary file, should we attach?
-                    if ( 
archive.getMetaInf().getFilter().contains(repositoryPath)) {
-                        
indexManager.getIndexes().registerBinary(repositoryPath, is);
+                    String binaryParentPath  = 
repositoryPath.substring(0,repositoryPath.lastIndexOf("/")) ;

Review Comment:
   I don't think this is how FileVault works, you really need to check if the 
node path given through repository path is contained in the filter (otherwise 
it won't be imported). Just think about more complicated use cases like 
excludes below a specific filter root.



-- 
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