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


##########
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've checked DefaultGetServlets and it looks like this type is not used by 
default for rendering the content. For directories, we fall into this 
condition: 
[here](https://github.com/apache/sling-org-apache-sling-servlets-get/blob/org.apache.sling.servlets.get-2.1.44/src/main/java/org/apache/sling/servlets/get/impl/helpers/StreamRenderer.java#L131)
 , for files we pass control back to BundleResource: 
[here](https://github.com/apache/sling-org-apache-sling-servlets-get/blob/org.apache.sling.servlets.get-2.1.44/src/main/java/org/apache/sling/servlets/get/impl/helpers/StreamRenderer.java#L157)



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