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 2022/08/08 11:49:23 UTC
[sling-org-apache-sling-fsresource] branch bugfix/fix-adapter-metadata created (now 986a559)
This is an automated email from the ASF dual-hosted git repository.
kwin pushed a change to branch bugfix/fix-adapter-metadata
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-fsresource.git
at 986a559 SLING-11519 Include adapter metadata in the resulting bundle
This branch includes the following new commits:
new 986a559 SLING-11519 Include adapter metadata in the resulting bundle
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[sling-org-apache-sling-fsresource] 01/01: SLING-11519 Include adapter metadata in the resulting bundle
Posted by kw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
kwin pushed a commit to branch bugfix/fix-adapter-metadata
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-fsresource.git
commit 986a559bc7e9dff7add36e33ac856d9e2812a590
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Mon Aug 8 13:49:19 2022 +0200
SLING-11519 Include adapter metadata in the resulting bundle
Also mention adaptations to ValueMap and Node
---
pom.xml | 4 ++++
.../org/apache/sling/fsprovider/internal/mapper/FileResource.java | 5 +++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index 062c939..614087e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -57,6 +57,10 @@
<goals>
<goal>generate-adapter-metadata</goal>
</goals>
+ <configuration>
+ <!-- relying on https://issues.apache.org/jira/browse/MNG-5001 until https://issues.apache.org/jira/browse/SLING-10022 is released -->
+ <outputDirectory>${project.build.outputDirectory}</outputDirectory>
+ </configuration>
</execution>
</executions>
</plugin>
diff --git a/src/main/java/org/apache/sling/fsprovider/internal/mapper/FileResource.java b/src/main/java/org/apache/sling/fsprovider/internal/mapper/FileResource.java
index 75c98d2..b7705fe 100644
--- a/src/main/java/org/apache/sling/fsprovider/internal/mapper/FileResource.java
+++ b/src/main/java/org/apache/sling/fsprovider/internal/mapper/FileResource.java
@@ -58,8 +58,9 @@ import org.slf4j.LoggerFactory;
* a Sling Resource.
*/
@Adaptable(adaptableClass=Resource.class, adapters={
- @Adapter({File.class, URL.class}),
- @Adapter(condition="If the resource is an FsResource and is a readable file.", value=InputStream.class)
+ @Adapter({File.class, URL.class, ValueMap.class}),
+ @Adapter(value=InputStream.class, condition="If the resource is an FsResource and is a readable file."),
+ @Adapter(value=Node.class, condition="If the resource is an FsResource and is providing content in JSON or FileVault XML format.")
})
public final class FileResource extends AbstractResource {