joerghoh commented on code in PR #1:
URL: 
https://github.com/apache/sling-org-apache-sling-bundleresource-impl/pull/1#discussion_r934619468


##########
src/main/java/org/apache/sling/bundleresource/impl/BundleResource.java:
##########
@@ -229,7 +228,11 @@ public String getPath() {
 
     @Override
     public String getResourceType() {
-        return this.valueMap.get(ResourceResolver.PROPERTY_RESOURCE_TYPE, 
String.class);
+        String resourceType = 
this.valueMap.get(ResourceResolver.PROPERTY_RESOURCE_TYPE, String.class);
+        if ( resourceType == null ) {
+            resourceType = this.isFolder ? NT_FOLDER : NT_FILE;

Review Comment:
   I think specifically about this provider. It does not make sense to return 
JCR NodeTypes here; I want to be able to run Sling without any JCR (not sure if 
that's possible, but I think it's a good goal).  That means, we should not use 
these JCR constants here, but rather introduce new Sling-specific constants. 
   
   For the sake of implementation, I am also not against making it 
configurable; in that case you can adjust them to your own needs and still use 
"NT:FILE" and "NT:FOLDER" if you have code which needs to work the same on both 
JcrResourceProvider and the BundleResourceProvider.
   
   
   
   
   
   
   
   
   
   



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