You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by kw...@apache.org on 2020/09/21 08:02:15 UTC

[sling-site] branch master updated: Further tweak binary support documentation

This is an automated email from the ASF dual-hosted git repository.

kwin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-site.git


The following commit(s) were added to refs/heads/master by this push:
     new 43f89dd  Further tweak binary support documentation
43f89dd is described below

commit 43f89ddbace5974518373e8aa61be53967a5af96
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Mon Sep 21 10:02:03 2020 +0200

    Further tweak binary support documentation
---
 src/main/jbake/content/documentation/the-sling-engine/resources.md | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/main/jbake/content/documentation/the-sling-engine/resources.md b/src/main/jbake/content/documentation/the-sling-engine/resources.md
index 69c445d..d1a0304 100644
--- a/src/main/jbake/content/documentation/the-sling-engine/resources.md
+++ b/src/main/jbake/content/documentation/the-sling-engine/resources.md
@@ -27,7 +27,7 @@ For a complete description of the `Resource` interface, please refer to the [`Re
 
 The properties are either exposed via the `ValueMap` or `ModifiableValueMap` adaptable or by calling `Resource.getValueMap()`.
 
-To get the *main* binary property from a given resource one can adapt it to an `InputStream`. Most resource providers return the underlying wrapper binary in that case. For arbitrary binary properties one must use the `ValueMap` which will return `InputStream` for such properties.
+To get the *main* binary property from a given resource one can adapt it to an `InputStream`. Most resource providers return the underlying wrapper binary in that case. The handling of arbitrary binary properties is resource provider specific (some expose lazy `InputStreams` others may not support binary properties via `ValueMap` at all).
 
 ### Resource Types
 
@@ -144,7 +144,9 @@ Path Parameter | Example Value | Description | Since
  --- | --- | --- | ---
 | `v` | `1.0` | Retrieves the underlying JCR node from the [version history](https://docs.adobe.com/docs/en/spec/jcr/2.0/15_Versioning.html) leveraging the version label given in the value. | [SLING-848](https://issues.apache.org/jira/browse/SLING-848)
 
-#### Main Binary Property
+#### Binary Support
+
+Binary properties are exposed as `InputStream` in the resource's `ValueMap`. That input stream only needs to be closed in case one reads from it. This prevents always checking the `ValueMap` for dangling `InputStream` properties.
 
 The main binary property (i.e. the one being exposed by `Resource.adaptTo(InputStream.class)`) is determined like follows: