You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 09:37:17 UTC

[sling-org-apache-sling-fsresource] 02/23: backport of changes from SLING-6440 and SLING-6537 to 1.1.x version of fsresource based on old resource provider SPI

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

rombert pushed a commit to annotated tag org.apache.sling.fsresource-1.3.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-fsresource.git

commit 54e89e7508ec978f0bef398bc6b432af89de1593
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Tue Feb 28 15:40:56 2017 +0000

    backport of changes from SLING-6440 and SLING-6537 to 1.1.x version of fsresource based on old resource provider SPI
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/branches/fsresource-1.1.x@1784765 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            | 120 ++++-
 .../fsprovider/internal/ContentFileExtensions.java |  75 +++
 .../sling/fsprovider/internal/FileMonitor.java     | 185 +++++--
 .../fsprovider/internal/FsResourceMapper.java      |  47 ++
 .../fsprovider/internal/FsResourceProvider.java    | 368 +++++++-------
 .../fsprovider/internal/mapper/ContentFile.java    | 166 +++++++
 .../internal/mapper/ContentFileResource.java       | 127 +++++
 .../internal/mapper/ContentFileResourceMapper.java | 155 ++++++
 .../{FsResource.java => mapper/FileResource.java}  |  77 ++-
 .../internal/mapper/FileResourceMapper.java        | 145 ++++++
 .../fsprovider/internal/mapper/ValueMapUtil.java   |  66 +++
 .../fsprovider/internal/mapper/jcr/FsItem.java     | 161 ++++++
 .../fsprovider/internal/mapper/jcr/FsNode.java     | 549 +++++++++++++++++++++
 .../internal/mapper/jcr/FsNodeIterator.java        |  98 ++++
 .../fsprovider/internal/mapper/jcr/FsNodeType.java | 157 ++++++
 .../fsprovider/internal/mapper/jcr/FsProperty.java | 242 +++++++++
 .../internal/mapper/jcr/FsPropertyDefinition.java  | 100 ++++
 .../internal/mapper/jcr/FsPropertyIterator.java    |  82 +++
 .../fsprovider/internal/mapper/jcr/FsValue.java    | 162 ++++++
 .../internal/parser/ContentFileCache.java          | 107 ++++
 .../internal/parser/ContentFileParser.java         |  62 +++
 .../internal/parser/ContentFileTypes.java          |  40 ++
 .../internal/parser/JcrXmlFileParser.java          | 147 ++++++
 .../internal/parser/JcrXmlValueConverter.java      | 168 +++++++
 .../fsprovider/internal/parser/JsonFileParser.java | 125 +++++
 .../OSGI-INF/metatype/metatype.properties          |  45 --
 .../sling/fsprovider/internal/FileMonitorTest.java | 238 +++++++++
 .../sling/fsprovider/internal/FilesFolderTest.java |  82 +++
 .../fsprovider/internal/InvalidRootFolderTest.java |  75 +++
 .../sling/fsprovider/internal/JcrMixedTest.java    | 103 ++++
 .../fsprovider/internal/JcrXmlContentTest.java     | 168 +++++++
 .../sling/fsprovider/internal/JsonContentTest.java | 259 ++++++++++
 .../sling/fsprovider/internal/TestUtils.java       |  97 ++++
 .../internal/mapper/ContentFileTest.java           | 115 +++++
 .../internal/mapper/ValueMapUtilTest.java          |  55 +++
 .../internal/parser/ContentFileCacheTest.java      |  92 ++++
 .../internal/parser/ContentFileParserTest.java     |  66 +++
 .../internal/parser/JcrXmlFileParserTest.java      |  34 ++
 .../internal/parser/JcrXmlValueConverterTest.java  | 105 ++++
 src/test/resources/fs-test/folder1/file1a.txt      |   1 +
 src/test/resources/fs-test/folder1/file1b.txt      |   1 +
 .../resources/fs-test/folder1/folder11/file11a.txt |   1 +
 src/test/resources/fs-test/folder2/content.json    | 262 ++++++++++
 .../fs-test/folder2/content/content2.json          |   4 +
 .../fs-test/folder2/content/file2content.txt       |   1 +
 .../resources/fs-test/folder2/folder21/file21a.txt |   1 +
 src/test/resources/fs-test/folder3/content.jcr.xml | 192 +++++++
 .../fs-test/folder3/content/content2.jcr.xml       |  29 ++
 .../resources/fs-test/folder3/folder31/file31a.txt |   1 +
 src/test/resources/invalid-test/invalid.jcr.xml    |   1 +
 src/test/resources/invalid-test/invalid.json       |   1 +
 src/test/resources/simplelogger.properties         |  19 +
 .../vaultfs-test/META-INF/vault/filter.xml         |  23 +
 .../vaultfs-test/META-INF/vault/settings.xml       |  23 +
 .../resources/vaultfs-test/jcr_root/.content.xml   |  24 +
 .../vaultfs-test/jcr_root/content/.content.xml     |  28 ++
 .../vaultfs-test/jcr_root/content/dam/.content.xml |  24 +
 .../jcr_root/content/dam/talk.png/.content.xml     |  46 ++
 .../dam/talk.png/_jcr_content/renditions/original  | Bin 0 -> 8668 bytes
 .../renditions/original.dir/.content.xml           |  25 +
 .../_jcr_content/renditions/web.1280.1280.png      | Bin 0 -> 5252 bytes
 .../jcr_root/content/samples/.content.xml          |  23 +
 .../jcr_root/content/samples/en/.content.xml       | 191 +++++++
 .../content/samples/en/conference/.content.xml     |  89 ++++
 .../jcr_root/content/samples/en/tools/.content.xml |  29 ++
 .../samples/en/tools/navigation/.content.xml       |  27 +
 66 files changed, 5979 insertions(+), 352 deletions(-)

diff --git a/pom.xml b/pom.xml
index 896f9f8..c871b0c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,8 +22,8 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>26</version>
-        <relativePath/>
+        <version>29</version>
+        <relativePath />
     </parent>
 
     <artifactId>org.apache.sling.fsresource</artifactId>
@@ -41,17 +41,10 @@
         <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/fsresource</developerConnection>
         <url>http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/fsresource</url>
     </scm>
-
+    
     <build>
         <plugins>
             <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-scr-plugin</artifactId>
-                <configuration>
-                    <specVersion>1.1</specVersion>
-                </configuration>
-            </plugin>
-            <plugin>
                 <groupId>org.apache.sling</groupId>
                 <artifactId>maven-sling-plugin</artifactId>
                 <executions>
@@ -68,25 +61,60 @@
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
                 <extensions>true</extensions>
+                <executions>
+                    <!-- Configure extra execution of 'manifest' in process-classes phase to make sure SCR metadata is generated before unit test runs -->
+                    <execution>
+                        <id>scr-metadata</id>
+                        <goals>
+                            <goal>manifest</goal>
+                        </goals>
+                        <configuration>
+                            <supportIncrementalBuild>true</supportIncrementalBuild>
+                        </configuration>
+                    </execution>
+                </executions>
                 <configuration>
+                    <!-- Export SCR metadata to classpath to have them available in unit tests -->
+                    <exportScr>true</exportScr>
                     <instructions>
-                        <Private-Package>
-                            org.apache.sling.fsprovider.internal
-                        </Private-Package>
+                        <!-- Embed Apache Johnzon -->
+                        <Embed-Dependency>
+                            johnzon-core;scope=compile;inline=false,
+                            geronimo-json_1.0_spec;scope=compile;inline=false
+                        </Embed-Dependency>
+                        <!-- Embed the nessecary parts of the jackrabbit-jcr-commons bundle as described in http://njbartlett.name/2014/05/26/static-linking.html -->
+                        <Conditional-Package>org.apache.jackrabbit.util</Conditional-Package>
+                        <Import-Package>
+                          !org.apache.jackrabbit.*,
+                          *
+                        </Import-Package>
                     </instructions>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>org.apache.rat</groupId>
+                <artifactId>apache-rat-plugin</artifactId>
+                <configuration>
+                    <excludes>
+                      <exclude>src/test/resources/fs-test/**</exclude>
+                      <exclude>src/test/resources/invalid-test/**</exclude>
+                      <exclude>src/test/resources/vaultfs-test/**/original</exclude>
+                    </excludes>
+                </configuration>
+            </plugin>
         </plugins>
     </build>
     <dependencies>
         <dependency>
             <groupId>javax.servlet</groupId>
             <artifactId>servlet-api</artifactId>
+            <version>2.4</version>
+            <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.api</artifactId>
-            <version>2.3.0</version>
+            <version>2.4.0</version>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
@@ -95,19 +123,41 @@
         </dependency>
         <dependency>
             <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.core</artifactId>
+            <artifactId>osgi.core</artifactId>
         </dependency>
         <dependency>
             <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.compendium</artifactId>
+            <artifactId>osgi.cmpn</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+            <version>3.3.2</version>
+            <scope>compile</scope>
         </dependency>
         <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
+            <groupId>commons-collections</groupId>
+            <artifactId>commons-collections</artifactId>
+            <version>3.2.1</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.johnzon</groupId>
+            <artifactId>johnzon-core</artifactId>
+            <version>1.0.0</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-json_1.0_spec</artifactId>
+            <version>1.0-alpha-1</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.jackrabbit</groupId>
+            <artifactId>jackrabbit-jcr-commons</artifactId>
+            <version>2.8.0</version>
+            <scope>compile</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
@@ -116,9 +166,33 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.scr.annotations</artifactId>
-            <scope>compile</scope>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.testing.sling-mock</artifactId>
+            <version>1.9.4</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.testing.osgi-mock</artifactId>
+            <version>2.2.2</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.testing.logging-mock</artifactId>
+            <version>1.0.0</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.testing.hamcrest</artifactId>
+            <version>1.0.2</version>
+            <scope>test</scope>
         </dependency>
     </dependencies>
 </project>
diff --git a/src/main/java/org/apache/sling/fsprovider/internal/ContentFileExtensions.java b/src/main/java/org/apache/sling/fsprovider/internal/ContentFileExtensions.java
new file mode 100644
index 0000000..5097750
--- /dev/null
+++ b/src/main/java/org/apache/sling/fsprovider/internal/ContentFileExtensions.java
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.fsprovider.internal;
+
+import java.io.File;
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.commons.lang3.StringUtils;
+
+/**
+ * Matches file names for content file extensions.
+ */
+public final class ContentFileExtensions {
+    
+    private final List<String> contentFileSuffixes;
+
+    public ContentFileExtensions(List<String> contentFileSuffixes) {
+        this.contentFileSuffixes = contentFileSuffixes;
+    }
+    
+    /**
+     * Get suffix from file name.
+     * @param file File
+     * @return Content file name suffix or null if not a context file.
+     */
+    public String getSuffix(File file) {
+        for (String suffix : contentFileSuffixes) {
+            if (StringUtils.endsWith(file.getName(), suffix)) {
+                return suffix;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Checks suffix from file name.
+     * @param file File
+     * @return true if content file
+     */
+    public boolean matchesSuffix(File file) {
+        return getSuffix(file) != null;
+    }
+    
+    /**
+     * @return Content file suffixes.
+     */
+    public Collection<String> getSuffixes() {
+        return contentFileSuffixes;
+    }
+    
+    /**
+     * @return true if not suffixes are defined.
+     */
+    public boolean isEmpty() {
+        return contentFileSuffixes.isEmpty();
+    }
+    
+}
diff --git a/src/main/java/org/apache/sling/fsprovider/internal/FileMonitor.java b/src/main/java/org/apache/sling/fsprovider/internal/FileMonitor.java
index 336f1c1..f1d4c90 100644
--- a/src/main/java/org/apache/sling/fsprovider/internal/FileMonitor.java
+++ b/src/main/java/org/apache/sling/fsprovider/internal/FileMonitor.java
@@ -19,12 +19,21 @@
 package org.apache.sling.fsprovider.internal;
 
 import java.io.File;
+import java.util.ArrayList;
 import java.util.Dictionary;
+import java.util.HashSet;
 import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 import java.util.Timer;
 import java.util.TimerTask;
 
+import org.apache.commons.lang3.StringUtils;
 import org.apache.sling.api.SlingConstants;
+import org.apache.sling.fsprovider.internal.mapper.ContentFile;
+import org.apache.sling.fsprovider.internal.mapper.FileResource;
+import org.apache.sling.fsprovider.internal.parser.ContentFileCache;
 import org.osgi.service.event.EventAdmin;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -33,10 +42,9 @@ import org.slf4j.LoggerFactory;
  * This class is a monitor for the file system
  * that periodically checks for changes.
  */
-public class FileMonitor extends TimerTask {
+public final class FileMonitor extends TimerTask {
 
-    /** The logger. */
-    private final Logger logger = LoggerFactory.getLogger(this.getClass());
+    private final Logger log = LoggerFactory.getLogger(this.getClass());
 
     private final Timer timer = new Timer();
     private boolean stop = false;
@@ -45,17 +53,23 @@ public class FileMonitor extends TimerTask {
     private final Monitorable root;
 
     private final FsResourceProvider provider;
+    
+    private final ContentFileExtensions contentFileExtensions;
+    private final ContentFileCache contentFileCache;
 
     /**
      * Creates a new instance of this class.
      * @param provider The resource provider.
      * @param interval The interval between executions of the task, in milliseconds.
      */
-    public FileMonitor(final FsResourceProvider provider, final long interval) {
+    public FileMonitor(final FsResourceProvider provider, final long interval,
+            final ContentFileExtensions contentFileExtensions, final ContentFileCache contentFileCache) {
         this.provider = provider;
-        this.root = new Monitorable(this.provider.getProviderRoot(), this.provider.getRootFile());
-        createStatus(this.root);
-        logger.debug("Starting file monitor for {} with an interval of {}ms", this.root.file, interval);
+        this.contentFileExtensions = contentFileExtensions;
+        this.contentFileCache = contentFileCache;
+        this.root = new Monitorable(this.provider.getProviderRoot(), this.provider.getRootFile(), null);
+        createStatus(this.root, contentFileExtensions, contentFileCache);
+        log.debug("Starting file monitor for {} with an interval of {}ms", this.root.file, interval);
         timer.schedule(this, 0, interval);
     }
 
@@ -85,12 +99,13 @@ public class FileMonitor extends TimerTask {
                 Thread.currentThread().interrupt();
             }
         }
-        logger.debug("Stopped file monitor for {}", this.root.file);
+        log.debug("Stopped file monitor for {}", this.root.file);
     }
 
     /**
      * @see java.util.TimerTask#run()
      */
+    @Override
     public void run() {
         synchronized (timer) {
             stopped = false;
@@ -123,24 +138,21 @@ public class FileMonitor extends TimerTask {
      * @param localEA The event admin
      */
     private void check(final Monitorable monitorable, final EventAdmin localEA) {
-        logger.debug("Checking {}", monitorable.file);
+        log.trace("Checking {}", monitorable.file);
         // if the file is non existing, check if it has been readded
         if ( monitorable.status instanceof NonExistingStatus ) {
             if ( monitorable.file.exists() ) {
                 // new file and reset status
-                createStatus(monitorable);
-                sendEvents(monitorable,
-                           SlingConstants.TOPIC_RESOURCE_ADDED,
-                           localEA);
+                createStatus(monitorable, contentFileExtensions, contentFileCache);
+                sendEvents(monitorable, SlingConstants.TOPIC_RESOURCE_ADDED, localEA);
             }
         } else {
             // check if the file has been removed
             if ( !monitorable.file.exists() ) {
                 // removed file and update status
-                sendEvents(monitorable,
-                           SlingConstants.TOPIC_RESOURCE_REMOVED,
-                           localEA);
+                sendEvents(monitorable, SlingConstants.TOPIC_RESOURCE_REMOVED, localEA);
                 monitorable.status = NonExistingStatus.SINGLETON;
+                contentFileCache.remove(monitorable.path);
             } else {
                 // check for changes
                 final FileStatus fs = (FileStatus)monitorable.status;
@@ -148,10 +160,9 @@ public class FileMonitor extends TimerTask {
                 if ( fs.lastModified < monitorable.file.lastModified() ) {
                     fs.lastModified = monitorable.file.lastModified();
                     // changed
-                    sendEvents(monitorable,
-                               SlingConstants.TOPIC_RESOURCE_CHANGED,
-                               localEA);
+                    sendEvents(monitorable, SlingConstants.TOPIC_RESOURCE_CHANGED, localEA);
                     changed = true;
+                    contentFileCache.remove(monitorable.path);
                 }
                 if ( fs instanceof DirStatus ) {
                     // directory
@@ -174,9 +185,8 @@ public class FileMonitor extends TimerTask {
                                     }
                                 }
                                 if (children[i] == null) {
-                                    children[i] = new Monitorable(
-                                        monitorable.path + '/'
-                                            + files[i].getName(), files[i]);
+                                    children[i] = new Monitorable(monitorable.path + '/' + files[i].getName(), files[i],
+                                            contentFileExtensions.getSuffix(files[i]));
                                     children[i].status = NonExistingStatus.SINGLETON;
                                     check(children[i], localEA);
                                 }
@@ -195,40 +205,112 @@ public class FileMonitor extends TimerTask {
      * Send the event async via the event admin.
      */
     private void sendEvents(final Monitorable monitorable, final String topic, final EventAdmin localEA) {
-        if ( logger.isDebugEnabled() ) {
-            logger.debug("Detected change for resource {} : {}", monitorable.path, topic);
+        if (log.isDebugEnabled()) {
+            log.debug("Detected change for resource {} : {}", monitorable.path, topic);
         }
 
-        final Dictionary<String, String> properties = new Hashtable<String, String>();
-        properties.put(SlingConstants.PROPERTY_PATH, monitorable.path);
-        final String type = monitorable.status instanceof FileStatus ?
-                FsResource.RESOURCE_TYPE_FILE : FsResource.RESOURCE_TYPE_FOLDER;
-        properties.put(SlingConstants.PROPERTY_RESOURCE_TYPE, type);
-        localEA.postEvent(new org.osgi.service.event.Event(topic, properties));
+        List<ResourceChange> changes = collectResourceChanges(monitorable, topic);
+        for (ResourceChange change : changes) {
+            if (log.isTraceEnabled()) {
+                log.debug("Send change for resource {}: {}", change.path, change.topic);
+            }
+            final Dictionary<String, String> properties = new Hashtable<String, String>();
+            properties.put(SlingConstants.PROPERTY_PATH, change.path);
+            if (change.resourceType != null) {
+                properties.put(SlingConstants.PROPERTY_RESOURCE_TYPE, change.resourceType);
+            }
+            localEA.postEvent(new org.osgi.service.event.Event(change.topic, properties));
+        }        
+    }
+    
+    @SuppressWarnings("unchecked")
+    private List<ResourceChange> collectResourceChanges(final Monitorable monitorable, final String topic) {
+        List<ResourceChange> changes = new ArrayList<>();
+        if (monitorable.status instanceof ContentFileStatus) {
+            ContentFile contentFile = ((ContentFileStatus)monitorable.status).contentFile;
+            if (StringUtils.equals(topic, SlingConstants.TOPIC_RESOURCE_CHANGED)) {
+                Map<String,Object> content = (Map<String,Object>)contentFile.getContent();
+                // we cannot easily report the diff of resource changes between two content files
+                // so we simulate a removal of the toplevel node and then add all nodes contained in the current content file again.
+                changes.add(buildContentResourceChange(SlingConstants.TOPIC_RESOURCE_REMOVED, content, monitorable.path));
+                addContentResourceChanges(changes, SlingConstants.TOPIC_RESOURCE_ADDED, content, monitorable.path);
+            }
+            else {
+                addContentResourceChanges(changes, topic, (Map<String,Object>)contentFile.getContent(), monitorable.path);
+            }
+        }
+        else {
+            ResourceChange change = new ResourceChange();
+            change.path = monitorable.path;
+            change.resourceType = monitorable.status instanceof FileStatus ?
+                    FileResource.RESOURCE_TYPE_FILE : FileResource.RESOURCE_TYPE_FOLDER;
+            change.topic = topic;
+            changes.add(change);
+        }
+        return changes;
+    }
+    @SuppressWarnings("unchecked")
+    private void addContentResourceChanges(final List<ResourceChange> changes, final String topic,
+            final Map<String,Object> content, final String path) {
+        changes.add(buildContentResourceChange(topic, content, path));
+        if (content != null) {
+            for (Map.Entry<String,Object> entry : content.entrySet()) {
+                if (entry.getValue() instanceof Map) {
+                    String childPath = path + "/" + entry.getKey();
+                    addContentResourceChanges(changes, topic, (Map<String,Object>)entry.getValue(), childPath);
+                }
+            }
+        }
+    }
+    private ResourceChange buildContentResourceChange(final String topic, final Map<String,Object> content, final String path) {
+        Set<String> addedPropertyNames = null;
+        if (content != null && topic == SlingConstants.TOPIC_RESOURCE_ADDED) {
+            addedPropertyNames = new HashSet<>();
+            for (Map.Entry<String,Object> entry : content.entrySet()) {
+                if (!(entry.getValue() instanceof Map)) {
+                    addedPropertyNames.add(entry.getKey());
+                }
+            }
+        }
+        ResourceChange change = new ResourceChange();
+        change.path = path;
+        change.resourceType = content != null ? (String)content.get("sling:resourceType") : null;
+        change.topic = topic;
+        return change;
     }
 
     /**
      * Create a status object for the monitorable
      */
-    private static void createStatus(final Monitorable monitorable) {
+    private static void createStatus(final Monitorable monitorable, ContentFileExtensions contentFileExtensions, ContentFileCache contentFileCache) {
         if ( !monitorable.file.exists() ) {
             monitorable.status = NonExistingStatus.SINGLETON;
         } else if ( monitorable.file.isFile() ) {
-            monitorable.status = new FileStatus(monitorable.file);
+            if (contentFileExtensions.matchesSuffix(monitorable.file)) {
+                monitorable.status = new ContentFileStatus(monitorable.file,
+                        new ContentFile(monitorable.file, monitorable.path, null, contentFileCache));
+            }
+            else {
+                monitorable.status = new FileStatus(monitorable.file);
+            }
         } else {
-            monitorable.status = new DirStatus(monitorable.file, monitorable.path);
+            monitorable.status = new DirStatus(monitorable.file, monitorable.path, contentFileExtensions, contentFileCache);
         }
     }
 
     /** The monitorable to hold the resource path, the file and the status. */
     private static final class Monitorable {
         public final String path;
-        public final File   file;
+        public final File file;
         public Object status;
-
-        public Monitorable(final String path, final File file) {
-            this.path = path;
+        public Monitorable(final String path, final File file, String contentFileSuffix) {
             this.file = file;
+            if (contentFileSuffix != null) {
+                this.path = StringUtils.substringBeforeLast(path, contentFileSuffix);
+            }
+            else {
+                this.path = path;
+            }
         }
     }
 
@@ -239,20 +321,30 @@ public class FileMonitor extends TimerTask {
             this.lastModified = file.lastModified();
         }
     }
-
+    
+    /** Status for content files */
+    private static class ContentFileStatus extends FileStatus {
+        public final ContentFile contentFile;
+        public ContentFileStatus(final File file, final ContentFile contentFile) {
+            super(file);
+            this.contentFile = contentFile;
+        }
+    }
+    
     /** Status for directories. */
     private static final class DirStatus extends FileStatus {
         public Monitorable[] children;
 
-        public DirStatus(final File dir, final String path) {
+        public DirStatus(final File dir, final String path,
+                final ContentFileExtensions contentFileExtensions, final ContentFileCache contentFileCache) {
             super(dir);
             final File[] files = dir.listFiles();
             if (files != null) {
                 this.children = new Monitorable[files.length];
                 for (int i = 0; i < files.length; i++) {
-                    this.children[i] = new Monitorable(path + '/'
-                        + files[i].getName(), files[i]);
-                    FileMonitor.createStatus(this.children[i]);
+                    this.children[i] = new Monitorable(path + '/' + files[i].getName(), files[i],
+                            contentFileExtensions.getSuffix(files[i]));
+                    FileMonitor.createStatus(this.children[i], contentFileExtensions, contentFileCache);
                 }
             } else {
                 this.children = new Monitorable[0];
@@ -264,4 +356,11 @@ public class FileMonitor extends TimerTask {
     private static final class NonExistingStatus {
         public static NonExistingStatus SINGLETON = new NonExistingStatus();
     }
-}
\ No newline at end of file
+
+    static class ResourceChange {
+        public String path;
+        public String resourceType;
+        public String topic;
+    }
+    
+}
diff --git a/src/main/java/org/apache/sling/fsprovider/internal/FsResourceMapper.java b/src/main/java/org/apache/sling/fsprovider/internal/FsResourceMapper.java
new file mode 100644
index 0000000..4cb2c17
--- /dev/null
+++ b/src/main/java/org/apache/sling/fsprovider/internal/FsResourceMapper.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.fsprovider.internal;
+
+import java.util.Iterator;
+
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceResolver;
+
+/**
+ * Maps files to resources.
+ */
+public interface FsResourceMapper {
+
+    /**
+     * Get single resource.
+     * @param resolver Resource resolver
+     * @param resourcePath Resource path
+     * @return Resource or null if not exists
+     */
+    Resource getResource(ResourceResolver resolver, String resourcePath);
+    
+    /**
+     * Get children of resource.
+     * @param resolver Resource resolver.
+     * @param parent Parent resource.
+     * @return Child resources or null if no children exist
+     */
+    Iterator<Resource> getChildren(ResourceResolver resolver, Resource parent);
+    
+}
diff --git a/src/main/java/org/apache/sling/fsprovider/internal/FsResourceProvider.java b/src/main/java/org/apache/sling/fsprovider/internal/FsResourceProvider.java
index 4b96f05..e3e3bad 100644
--- a/src/main/java/org/apache/sling/fsprovider/internal/FsResourceProvider.java
+++ b/src/main/java/org/apache/sling/fsprovider/internal/FsResourceProvider.java
@@ -19,101 +19,135 @@
 package org.apache.sling.fsprovider.internal;
 
 import java.io.File;
-import java.util.Collections;
+import java.util.ArrayList;
+import java.util.HashSet;
 import java.util.Iterator;
-import java.util.Map;
-import java.util.NoSuchElementException;
+import java.util.List;
+import java.util.Set;
 
 import javax.servlet.http.HttpServletRequest;
 
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.ConfigurationPolicy;
-import org.apache.felix.scr.annotations.Properties;
-import org.apache.felix.scr.annotations.Property;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.ReferenceCardinality;
-import org.apache.felix.scr.annotations.ReferencePolicy;
-import org.apache.felix.scr.annotations.Service;
+import org.apache.commons.collections.IteratorUtils;
+import org.apache.commons.collections.Predicate;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceProvider;
 import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.fsprovider.internal.mapper.ContentFileResourceMapper;
+import org.apache.sling.fsprovider.internal.mapper.FileResourceMapper;
+import org.apache.sling.fsprovider.internal.parser.ContentFileCache;
+import org.apache.sling.fsprovider.internal.parser.ContentFileTypes;
 import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.ConfigurationPolicy;
+import org.osgi.service.component.annotations.Deactivate;
+import org.osgi.service.component.annotations.Reference;
+import org.osgi.service.component.annotations.ReferenceCardinality;
+import org.osgi.service.component.annotations.ReferencePolicy;
 import org.osgi.service.event.EventAdmin;
+import org.osgi.service.metatype.annotations.AttributeDefinition;
+import org.osgi.service.metatype.annotations.Designate;
+import org.osgi.service.metatype.annotations.ObjectClassDefinition;
 
 /**
  * The <code>FsResourceProvider</code> is a resource provider which maps
- * filesystem files and folders into the virtual resource tree. The provider is
+ * file system files and folders into the virtual resource tree. The provider is
  * implemented in terms of a component factory, that is multiple instances of
  * this provider may be created by creating respective configuration.
  * <p>
  * Each provider instance is configured with two properties: The location in the
- * resource tree where resources are provided ({@link ResourceProvider#ROOTS})
+ * resource tree where resources are provided (provider.root)
  * and the file system path from where files and folders are mapped into the
- * resource ({@link #PROP_PROVIDER_FILE}).
+ * resource (provider.file).
  */
-@Component(
-        name="org.apache.sling.fsprovider.internal.FsResourceProvider",
-        label="%resource.resolver.name",
-        description="%resource.resolver.description",
-        configurationFactory=true,
-        policy=ConfigurationPolicy.REQUIRE,
-        metatype=true
-        )
-@Service(ResourceProvider.class)
-@Properties({
-    @Property(name="service.description", value="Sling Filesystem Resource Provider"),
-    @Property(name="service.vendor", value="The Apache Software Foundation"),
-    @Property(name=ResourceProvider.ROOTS),
-    @Property(name = "webconsole.configurationFactory.nameHint", 
-        value = "Root paths: {" + ResourceProvider.ROOTS + "}")
-})
-public class FsResourceProvider implements ResourceProvider {
-
-    /**
-     * The name of the configuration property providing file system path of
-     * files and folders mapped into the resource tree (value is
-     * "provider.file").
-     */
-    @Property
-    public static final String PROP_PROVIDER_FILE = "provider.file";
-
-    /**
-     * The name of the configuration property providing the check interval
-     * for file changes (value is "provider.checkinterval").
-     */
-    @Property(longValue=FsResourceProvider.DEFAULT_CHECKINTERVAL)
-    public static final String PROP_PROVIDER_CHECKINTERVAL = "provider.checkinterval";
-
-    public static final long DEFAULT_CHECKINTERVAL = 1000;
+@Component(name="org.apache.sling.fsprovider.internal.FsResourceProvider",
+           service=ResourceProvider.class,
+           configurationPolicy=ConfigurationPolicy.REQUIRE,
+           property={
+                   Constants.SERVICE_DESCRIPTION + "=Sling Filesystem Resource Provider",
+                   Constants.SERVICE_VENDOR + "=The Apache Software Foundation"
+           })
+@Designate(ocd=FsResourceProvider.Config.class, factory=true)
+public final class FsResourceProvider implements ResourceProvider {
+    
+    @ObjectClassDefinition(name = "Apache Sling Filesystem Resource Provider",
+            description = "Configure an instance of the filesystem " +
+                          "resource provider in terms of provider root and filesystem location")
+    public @interface Config {
+        /**
+         * The name of the configuration property providing file system path of
+         * files and folders mapped into the resource tree (value is
+         * "provider.file").
+         */
+        @AttributeDefinition(name = "Filesystem Root",
+                description = "Filesystem directory mapped to the virtual " +
+                        "resource tree. This property must not be an empty string. If the path is " +
+                        "relative it is resolved against sling.home or the current working directory. " +
+                        "The path may be a file or folder. If the path does not address an existing " +
+                        "file or folder, an empty folder is created.")
+        String provider_file();
+
+        /**
+         * The name of the configuration property providing the check interval
+         * for file changes (value is "provider.checkinterval").
+         */
+        @AttributeDefinition(name = "Check Interval",
+                             description = "If the interval has a value higher than 100, the provider will " +
+             "check the file system for changes periodically. This interval defines the period in milliseconds " +
+             "(the default is 1000). If a change is detected, resource events are sent through the event admin.")
+        long provider_checkinterval() default 1000;
+
+        @AttributeDefinition(name = "Provider Roots",
+                description = "Locations in the virtual resource tree where the " +
+                "filesystem resources are mapped in. This property must contain at least one non-empty string.")
+        String[] provider_roots();
+        
+        @AttributeDefinition(name = "Mount json",
+                description = "Mount .json files as content in the resource hierarchy.")
+        boolean provider_json_content();
+       
+        @AttributeDefinition(name = "Mount jcr.xml",
+                description = "Mount .jcr.xml files as content in the resource hierarchy.")
+        boolean provider_jcrxml_content();
+        
+        @AttributeDefinition(name = "Cache Size",
+                description = "Max. number of content files cached in memory.")
+        int provider_cache_size() default 1000;
+
+        /**
+         * Internal Name hint for web console.
+         */
+        String webconsole_configurationFactory_nameHint() default "Root paths: {" + ResourceProvider.ROOTS + "}";
+    }
 
     // The location in the resource tree where the resources are mapped
     private String providerRoot;
 
-    // providerRoot + "/" to be used for prefix matching of paths
-    private String providerRootPrefix;
-
     // The "root" file or folder in the file system
     private File providerFile;
 
-    /** The monitor to detect file changes. */
+    // The monitor to detect file changes.
     private FileMonitor monitor;
-
-    @Reference(cardinality=ReferenceCardinality.OPTIONAL_UNARY, policy=ReferencePolicy.DYNAMIC)
+    
+    // maps filesystem to resources
+    private FsResourceMapper fileMapper;
+    private FsResourceMapper contentFileMapper;
+    
+    // cache for parsed content files
+    private ContentFileCache contentFileCache;
+
+    @Reference(cardinality=ReferenceCardinality.OPTIONAL, policy=ReferencePolicy.DYNAMIC)
     private volatile EventAdmin eventAdmin;
-
-    /**
-     * Same as {@link #getResource(ResourceResolver, String)}, i.e. the
-     * <code>request</code> parameter is ignored.
-     *
-     * @see #getResource(ResourceResolver, String)
-     */
-    public Resource getResource(ResourceResolver resourceResolver,
-            HttpServletRequest request, String path) {
+    
+    @Override
+    public Resource getResource(ResourceResolver resourceResolver, HttpServletRequest request, String path) {
         return getResource(resourceResolver, path);
     }
 
     /**
-     * Returns a resource wrapping a filesystem file or folder for the given
+     * Returns a resource wrapping a file system file or folder for the given
      * path. If the <code>path</code> is equal to the configured resource tree
      * location of this provider, the configured file system file or folder is
      * used for the resource. Otherwise the configured resource tree location
@@ -121,130 +155,107 @@ public class FsResourceProvider implements ResourceProvider {
      * to access the file or folder. If no such file or folder exists, this
      * method returns <code>null</code>.
      */
-    public Resource getResource(ResourceResolver resourceResolver, String path) {
-        return getResource(resourceResolver, path, getFile(path));
+    @Override
+    public Resource getResource(ResourceResolver resolver, String path) {
+        Resource rsrc = contentFileMapper.getResource(resolver, path);
+        if (rsrc == null) {
+            rsrc = fileMapper.getResource(resolver, path);
+        }
+        return rsrc;
     }
-
+    
     /**
      * Returns an iterator of resources.
      */
+    @SuppressWarnings("unchecked")
+    @Override
     public Iterator<Resource> listChildren(Resource parent) {
-        File parentFile = parent.adaptTo(File.class);
-
-        // not a FsResource, try to create one from the resource
-        if (parentFile == null) {
-            // if the parent path is at or below the provider root, get
-            // the respective file
-            parentFile = getFile(parent.getPath());
-
-            // if the parent path is actually the parent of the provider
-            // root, return a single element iterator just containing the
-            // provider file, unless the provider file is a directory and
-            // a repository item with the same path actually exists
-            if (parentFile == null) {
-
-                String parentPath = parent.getPath().concat("/");
-                if (providerRoot.startsWith(parentPath)) {
-                    String relPath = providerRoot.substring(parentPath.length());
-                    if (relPath.indexOf('/') < 0) {
-                        Resource res = getResource(
-                                parent.getResourceResolver(), providerRoot,
-                                providerFile);
-                        if (res != null) {
-                            return Collections.singletonList(res).iterator();
-                        }
-                    }
-                }
-
-                // no children here
-                return null;
-            }
+        ResourceResolver resolver = parent.getResourceResolver();
+        
+        List<Iterator<Resource>> allChildren = new ArrayList<>();
+        Iterator<Resource> children;
+        
+        children = contentFileMapper.getChildren(resolver, parent);
+        if (children != null) {
+            allChildren.add(children);
         }
-
-        final File[] children = parentFile.listFiles();
-
-        if (children != null && children.length > 0) {
-            final ResourceResolver resolver = parent.getResourceResolver();
-            final String parentPath = parent.getPath();
-            return new Iterator<Resource>() {
-                int index = 0;
-
-                Resource next = seek();
-
-                public boolean hasNext() {
-                    return next != null;
-                }
-
-                public Resource next() {
-                    if (!hasNext()) {
-                        throw new NoSuchElementException();
-                    }
-
-                    Resource result = next;
-                    next = seek();
-                    return result;
-                }
-
-                public void remove() {
-                    throw new UnsupportedOperationException("remove");
-                }
-
-                private Resource seek() {
-                    while (index < children.length) {
-                        File file = children[index++];
-                        String path = parentPath + "/" + file.getName();
-                        Resource result = getResource(resolver, path, file);
-                        if (result != null) {
-                            return result;
-                        }
-                    }
-
-                    // nothing found any more
-                    return null;
-                }
-            };
+        
+        children = fileMapper.getChildren(resolver, parent);
+        if (children != null) {
+            allChildren.add(children);
         }
-
-        // no children
-        return null;
+        
+    	if (allChildren.isEmpty()) {
+    	    return null;
+    	}
+    	else if (allChildren.size() == 1) {
+    	    return allChildren.get(0);
+    	}
+    	else {
+    	    // merge all children from the different iterators, but filter out potential duplicates with same resource name
+    	    return IteratorUtils.filteredIterator(IteratorUtils.chainedIterator(allChildren), new Predicate() {
+    	        private Set<String> names = new HashSet<>();
+                @Override
+                public boolean evaluate(Object object) {
+                    Resource resource = (Resource)object;
+                    return names.add(resource.getName());
+                }
+            });
+    	}
     }
 
     // ---------- SCR Integration
-
-    protected void activate(BundleContext bundleContext, Map<?, ?> props) {
-        String providerRoot = (String) props.get(ROOTS);
-        if (providerRoot == null || providerRoot.length() == 0) {
-            throw new IllegalArgumentException(ROOTS + " property must be set");
+    @Activate
+    protected void activate(BundleContext bundleContext, final Config config) {
+        String[] providerRoots = config.provider_roots();
+        if (providerRoots == null || providerRoots.length != 1 || StringUtils.isBlank(providerRoots[0])) {
+            throw new IllegalArgumentException("provider.roots property must be set to exactly one entry.");
         }
+        String providerRoot = config.provider_roots()[0];
 
-        String providerFileName = (String) props.get(PROP_PROVIDER_FILE);
+        String providerFileName = config.provider_file();
         if (providerFileName == null || providerFileName.length() == 0) {
-            throw new IllegalArgumentException(PROP_PROVIDER_FILE
-                    + " property must be set");
+            throw new IllegalArgumentException("provider.file property must be set");
         }
 
         this.providerRoot = providerRoot;
-        this.providerRootPrefix = providerRoot.concat("/");
         this.providerFile = getProviderFile(providerFileName, bundleContext);
-        // start background monitor if check interval is higher than 100
-        long checkInterval = DEFAULT_CHECKINTERVAL;
-        final Object interval = props.get(PROP_PROVIDER_CHECKINTERVAL);
-        if ( interval != null && interval instanceof Long ) {
-            checkInterval = (Long)interval;
+        
+        List<String> contentFileSuffixes = new ArrayList<>();
+        if (config.provider_json_content()) {
+            contentFileSuffixes.add(ContentFileTypes.JSON_SUFFIX);
         }
-        if ( checkInterval > 100 ) {
-            this.monitor = new FileMonitor(this, checkInterval);
+        if (config.provider_jcrxml_content()) {
+            contentFileSuffixes.add(ContentFileTypes.JCR_XML_SUFFIX);
+        }
+        ContentFileExtensions contentFileExtensions = new ContentFileExtensions(contentFileSuffixes);
+        
+        this.contentFileCache = new ContentFileCache(config.provider_cache_size());
+        this.fileMapper = new FileResourceMapper(this.providerRoot, this.providerFile, contentFileExtensions);
+        this.contentFileMapper = new ContentFileResourceMapper(this.providerRoot, this.providerFile,
+                contentFileExtensions, this.contentFileCache);
+        
+        // start background monitor if check interval is higher than 100
+        if ( config.provider_checkinterval() > 100 ) {
+            this.monitor = new FileMonitor(this, config.provider_checkinterval(),
+                    contentFileExtensions, this.contentFileCache);
         }
     }
 
+    @Deactivate
     protected void deactivate() {
         if ( this.monitor != null ) {
             this.monitor.stop();
             this.monitor = null;
         }
         this.providerRoot = null;
-        this.providerRootPrefix = null;
         this.providerFile = null;
+        this.fileMapper = null;
+        this.contentFileMapper = null;
+        if (this.contentFileCache != null) {
+            this.contentFileCache.clear();
+            this.contentFileCache = null;
+        }
     }
 
     EventAdmin getEventAdmin() {
@@ -288,41 +299,4 @@ public class FsResourceProvider implements ResourceProvider {
         return providerFile;
     }
 
-    /**
-     * Returns a file corresponding to the given absolute resource tree path. If
-     * the path equals the configured provider root, the provider root file is
-     * returned. If the path starts with the configured provider root, a file is
-     * returned relative to the provider root file whose relative path is the
-     * remains of the resource tree path without the provider root path.
-     * Otherwise <code>null</code> is returned.
-     */
-    private File getFile(String path) {
-        if (path.equals(providerRoot)) {
-            return providerFile;
-        }
-
-        if (path.startsWith(providerRootPrefix)) {
-            String relPath = path.substring(providerRootPrefix.length());
-            return new File(providerFile, relPath);
-        }
-
-        return null;
-    }
-
-    private Resource getResource(ResourceResolver resourceResolver,
-            String resourcePath, File file) {
-
-        if (file != null) {
-
-            // if the file exists, but is not a directory or no repository entry
-            // exists, return it as a resource
-            if (file.exists()) {
-                return new FsResource(resourceResolver, resourcePath, file);
-            }
-
-        }
-
-        // not applicable or not an existing file path
-        return null;
-    }
 }
diff --git a/src/main/java/org/apache/sling/fsprovider/internal/mapper/ContentFile.java b/src/main/java/org/apache/sling/fsprovider/internal/mapper/ContentFile.java
new file mode 100644
index 0000000..d31a851
--- /dev/null
+++ b/src/main/java/org/apache/sling/fsprovider/internal/mapper/ContentFile.java
@@ -0,0 +1,166 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.fsprovider.internal.mapper;
+
+import java.io.File;
+import java.util.Map;
+
+import org.apache.sling.api.resource.ValueMap;
+import org.apache.sling.fsprovider.internal.parser.ContentFileCache;
+
+/**
+ * Reference to a file that contains a content fragment (e.g. JSON, JCR XML).
+ */
+public final class ContentFile {
+    
+    private final File file;
+    private final String path;
+    private final String subPath;
+    private final ContentFileCache contentFileCache;
+    private boolean contentInitialized;
+    private Object content;
+    private ValueMap valueMap;
+    
+    /**
+     * @param file File with content fragment
+     * @param path Root path of the content file
+     * @param subPath Relative path addressing content fragment inside file
+     * @param contentFileCache Content file cache
+     */
+    public ContentFile(File file, String path, String subPath, ContentFileCache contentFileCache) {
+        this.file = file;
+        this.path = path;
+        this.subPath = subPath;
+        this.contentFileCache = contentFileCache;
+    }
+
+    /**
+     * @param file File with content fragment
+     * @param path Root path of the content file
+     * @param subPath Relative path addressing content fragment inside file
+     * @param contentFileCache Content file cache
+     * @param content Content
+     */
+    public ContentFile(File file, String path, String subPath, ContentFileCache contentFileCache, Object content) {
+        this(file, path, subPath, contentFileCache);
+        this.contentInitialized = true;
+        this.content = content;
+    }
+
+    /**
+     * @return File with content fragment
+     */
+    public File getFile() {
+        return file;
+    }
+    
+    /**
+     * @return Root path of content file
+     */
+    public String getPath() {
+        return path;
+    }
+
+    /**
+     * @return Relative path addressing content fragment inside file
+     */
+    public String getSubPath() {
+        return subPath;
+    }
+    
+    /**
+     * Content object referenced by sub path.
+     * @return Map if resource, property value if property.
+     */
+    public Object getContent() {
+        if (!contentInitialized) {
+            Map<String,Object> rootContent = contentFileCache.get(path, file);
+            content = getDeepContent(rootContent, subPath);
+            contentInitialized = true;
+        }
+        return content;
+    }
+    
+    /**
+     * @return true if any content was found.
+     */
+    public boolean hasContent() {
+        return getContent() != null;
+    }
+    
+    /**
+     * @return true if content references resource map.
+     */
+    public boolean isResource() {
+        return (getContent() instanceof Map);
+    }
+    
+    /**
+     * @return ValueMap for resource. Never null.
+     */
+    @SuppressWarnings("unchecked")
+    public ValueMap getValueMap() {
+        if (valueMap == null) {
+            Object currentContent = getContent();
+            if (currentContent instanceof Map) {
+                valueMap = ValueMapUtil.toValueMap((Map<String,Object>)currentContent);
+            }
+            else {
+                valueMap = ValueMap.EMPTY;
+            }
+        }
+        return valueMap;
+    }
+    
+    /**
+     * Navigate to another sub path position in content file.
+     * @param newSubPath New sub path
+     * @return Content file
+     */
+    public ContentFile navigateTo(String newSubPath) {
+        return new ContentFile(file, path, newSubPath, contentFileCache);
+    }
+        
+    @SuppressWarnings("unchecked")
+    private static Object getDeepContent(Object object, String subPath) {
+        if (object == null) {
+            return null;
+        }
+        if (subPath == null) {
+            return object;
+        }
+        if (!(object instanceof Map)) {
+            return null;
+        }
+        String name;
+        String remainingSubPath;
+        int slashIndex = subPath.indexOf('/');
+        if (slashIndex >= 0) {
+            name = subPath.substring(0, slashIndex);
+            remainingSubPath = subPath.substring(slashIndex + 1);
+        }
+        else {
+            name = subPath;
+            remainingSubPath = null;
+        }
+        Object subObject = ((Map<String,Object>)object).get(name);
+        return getDeepContent(subObject, remainingSubPath);
+    }
+    
+}
diff --git a/src/main/java/org/apache/sling/fsprovider/internal/mapper/ContentFileResource.java b/src/main/java/org/apache/sling/fsprovider/internal/mapper/ContentFileResource.java
new file mode 100644
index 0000000..622deba
--- /dev/null
+++ b/src/main/java/org/apache/sling/fsprovider/internal/mapper/ContentFileResource.java
@@ -0,0 +1,127 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.fsprovider.internal.mapper;
+
+import javax.jcr.Node;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import org.apache.sling.api.resource.AbstractResource;
+import org.apache.sling.api.resource.ResourceMetadata;
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.api.resource.ResourceUtil;
+import org.apache.sling.api.resource.ValueMap;
+import org.apache.sling.fsprovider.internal.mapper.jcr.FsNode;
+
+/**
+ * Represents a JSON File with resource content.
+ */
+public final class ContentFileResource extends AbstractResource {
+
+    // the owning resource resolver
+    private final ResourceResolver resolver;
+
+    // the path of this resource in the resource tree
+    private final String resourcePath;
+
+    // the file wrapped by this instance
+    private final ContentFile contentFile;
+
+    // the resource type, assigned on demand
+    private String resourceType;
+    private String resourceSuperType;
+
+    // the resource metadata, assigned on demand
+    private ResourceMetadata metaData;
+
+    /**
+     * @param resolver The owning resource resolver
+     * @param resourcePath The resource path in the resource tree
+     * @param contentFile Content file with sub path
+     */
+    ContentFileResource(ResourceResolver resolver, ContentFile contentFile) {
+        this.resolver = resolver;
+        this.contentFile = contentFile;
+        this.resourcePath = contentFile.getPath()
+                + (contentFile.getSubPath() != null ? "/" + contentFile.getSubPath() : "");
+    }
+
+    public String getPath() {
+        return resourcePath;
+    }
+
+    public ResourceMetadata getResourceMetadata() {
+        if (metaData == null) {
+            metaData = new ResourceMetadata();
+            metaData.setModificationTime(contentFile.getFile().lastModified());
+            metaData.setResolutionPath(resourcePath);
+        }
+        return metaData;
+    }
+
+    public ResourceResolver getResourceResolver() {
+        return resolver;
+    }
+
+    public String getResourceSuperType() {
+        if (resourceSuperType == null) {
+            resourceSuperType = ResourceUtil.getValueMap(this).get("sling:resourceSuperType", String.class);
+        }
+        return resourceSuperType;
+    }
+
+    public String getResourceType() {
+        if (resourceType == null) {
+            ValueMap props = ResourceUtil.getValueMap(this);
+            resourceType = props.get("sling:resourceType", String.class);
+            if (resourceType == null) {
+                // fallback to jcr:primaryType when resource type not set
+                resourceType = props.get("jcr:primaryType", String.class);
+            }
+        }
+        return resourceType;
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public <AdapterType> AdapterType adaptTo(Class<AdapterType> type) {
+        if (type == ContentFile.class) {
+            return (AdapterType)this.contentFile;
+        }
+        else if (type == ValueMap.class) {
+            return (AdapterType)contentFile.getValueMap();
+        }
+        else if (type == Node.class && contentFile.isResource()) {
+            // support a subset of JCR API for content file resources
+            return (AdapterType)new FsNode(contentFile, getResourceResolver());
+        }
+        return super.adaptTo(type);
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
+                .append("path", resourcePath)
+                .append("file", contentFile.getFile().getPath())
+                .append("subPath", contentFile.getSubPath())
+                .append("resourceType", getResourceType())
+                .build();
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/fsprovider/internal/mapper/ContentFileResourceMapper.java b/src/main/java/org/apache/sling/fsprovider/internal/mapper/ContentFileResourceMapper.java
new file mode 100644
index 0000000..e6edd04
--- /dev/null
+++ b/src/main/java/org/apache/sling/fsprovider/internal/mapper/ContentFileResourceMapper.java
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.fsprovider.internal.mapper;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.collections.IteratorUtils;
+import org.apache.commons.collections.Transformer;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.api.resource.ResourceUtil;
+import org.apache.sling.fsprovider.internal.ContentFileExtensions;
+import org.apache.sling.fsprovider.internal.FsResourceMapper;
+import org.apache.sling.fsprovider.internal.parser.ContentFileCache;
+
+public final class ContentFileResourceMapper implements FsResourceMapper {
+    
+    // providerRoot + "/" to be used for prefix matching of paths
+    private final String providerRootPrefix;
+
+    // The "root" file or folder in the file system
+    private final File providerFile;
+    
+    private final ContentFileExtensions contentFileExtensions;
+    private final ContentFileCache contentFileCache;
+    
+    public ContentFileResourceMapper(String providerRoot, File providerFile,
+            ContentFileExtensions contentFileExtensions, ContentFileCache contentFileCache) {
+        this.providerRootPrefix = providerRoot.concat("/");
+        this.providerFile = providerFile;
+        this.contentFileExtensions = contentFileExtensions;
+        this.contentFileCache = contentFileCache;
+    }
+    
+    @Override
+    public Resource getResource(final ResourceResolver resolver, final String resourcePath) {
+        if (contentFileExtensions.isEmpty()) {
+            return null;
+        }
+        ContentFile contentFile = getFile(resourcePath, null);
+        if (contentFile != null && contentFile.hasContent()) {
+            return new ContentFileResource(resolver, contentFile);
+        }
+        else {
+            return null;
+        }
+    }
+    
+    @SuppressWarnings("unchecked")
+    @Override
+    public Iterator<Resource> getChildren(final ResourceResolver resolver, final Resource parent) {
+        if (contentFileExtensions.isEmpty()) {
+            return null;
+        }
+        final String parentPath = parent.getPath();
+        ContentFile parentContentFile = parent.adaptTo(ContentFile.class);
+
+        // not a FsResource, try to create one from the resource
+        if (parentContentFile == null) {
+            parentContentFile = getFile(parentPath, null);
+            if (parentContentFile == null) {
+                
+                // check if parent is a file resource that contains a file content resource
+                File parentFile = parent.adaptTo(File.class);
+                if (parentFile != null && parentFile.isDirectory()) {
+                    List<Resource> childResources = new ArrayList<>();
+                    for (File file : parentFile.listFiles()) {
+                        String filenameSuffix = contentFileExtensions.getSuffix(file);
+                        if (filenameSuffix != null) {
+                            String path = parentPath + "/" + StringUtils.substringBeforeLast(file.getName(), filenameSuffix);
+                            ContentFile contentFile = new ContentFile(file, path, null, contentFileCache);
+                            childResources.add(new ContentFileResource(resolver, contentFile));
+                        }
+                    }
+                    if (!childResources.isEmpty()) {
+                        return childResources.iterator();
+                    }
+                }
+                
+                // no children here
+                return null;
+            }
+        }
+
+        // get child resources from content fragments in content file
+        List<ContentFile> children = new ArrayList<>();
+        if (parentContentFile.hasContent() && parentContentFile.isResource()) {
+            Map<String,Object> content = (Map<String,Object>)parentContentFile.getContent();
+            for (Map.Entry<String, Object> entry: content.entrySet()) {
+                if (entry.getValue() instanceof Map) {
+                    String subPath;
+                    if (parentContentFile.getSubPath() == null) {
+                        subPath = entry.getKey();
+                    }
+                    else {
+                        subPath = parentContentFile.getSubPath() + "/" + entry.getKey();
+                    }
+                    children.add(new ContentFile(parentContentFile.getFile(), parentContentFile.getPath(), subPath, contentFileCache, entry.getValue()));
+                }
+            }
+        }
+        if (children.isEmpty()) {
+            return null;
+        }
+        else {
+            return IteratorUtils.transformedIterator(children.iterator(), new Transformer() {
+                @Override
+                public Object transform(Object input) {
+                    ContentFile contentFile = (ContentFile)input;
+                    return new ContentFileResource(resolver, contentFile);
+                }
+            });
+        }
+    }
+    
+    private ContentFile getFile(String path, String subPath) {
+        if (!StringUtils.startsWith(path, providerRootPrefix)) {
+            return null;
+        }
+        String relPath = path.substring(providerRootPrefix.length());
+        for (String filenameSuffix : contentFileExtensions.getSuffixes()) {
+            File file = new File(providerFile, relPath + filenameSuffix);
+            if (file.exists()) {
+                return new ContentFile(file, path, subPath, contentFileCache);
+            }
+        }
+        // try to find in parent path which contains content fragment
+        String parentPath = ResourceUtil.getParent(path);
+        String nextSubPath = path.substring(parentPath.length() + 1)
+                + (subPath != null ? "/" + subPath : "");
+        return getFile(parentPath, nextSubPath);
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/fsprovider/internal/FsResource.java b/src/main/java/org/apache/sling/fsprovider/internal/mapper/FileResource.java
similarity index 79%
rename from src/main/java/org/apache/sling/fsprovider/internal/FsResource.java
rename to src/main/java/org/apache/sling/fsprovider/internal/mapper/FileResource.java
index 1397045..67cd178 100644
--- a/src/main/java/org/apache/sling/fsprovider/internal/FsResource.java
+++ b/src/main/java/org/apache/sling/fsprovider/internal/mapper/FileResource.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.sling.fsprovider.internal;
+package org.apache.sling.fsprovider.internal.mapper;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -28,6 +28,8 @@ import java.util.Calendar;
 import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
 import org.apache.sling.adapter.annotations.Adaptable;
 import org.apache.sling.adapter.annotations.Adapter;
 import org.apache.sling.api.resource.AbstractResource;
@@ -47,22 +49,19 @@ import org.slf4j.LoggerFactory;
     @Adapter({File.class, URL.class}),
     @Adapter(condition="If the resource is an FsResource and is a readable file.", value=InputStream.class)
 })
-public class FsResource extends AbstractResource {
+public final class FileResource extends AbstractResource {
 
     /**
      * The resource type for file system files mapped into the resource tree by
      * the {@link FsResourceProvider} (value is "nt:file").
      */
-    static final String RESOURCE_TYPE_FILE = "nt:file";
+    public static final String RESOURCE_TYPE_FILE = "nt:file";
 
     /**
      * The resource type for file system folders mapped into the resource tree
      * by the {@link FsResourceProvider} (value is "nt:folder").
      */
-    static final String RESOURCE_TYPE_FOLDER = "nt:folder";
-
-    // default log, assigned on demand
-    private Logger log;
+    public static final String RESOURCE_TYPE_FOLDER = "nt:folder";
 
     // the owning resource resolver
     private final ResourceResolver resolver;
@@ -79,6 +78,8 @@ public class FsResource extends AbstractResource {
     // the resource metadata, assigned on demand
     private ResourceMetadata metaData;
 
+    private static final Logger log = LoggerFactory.getLogger(FileResource.class);
+    
     /**
      * Creates an instance of this Filesystem resource.
      *
@@ -86,7 +87,7 @@ public class FsResource extends AbstractResource {
      * @param resourcePath The resource path in the resource tree
      * @param file The wrapped file
      */
-    FsResource(ResourceResolver resolver, String resourcePath, File file) {
+    FileResource(ResourceResolver resolver, String resourcePath, File file) {
         this.resolver = resolver;
         this.resourcePath = resourcePath;
         this.file = file;
@@ -139,11 +140,8 @@ public class FsResource extends AbstractResource {
      */
     public String getResourceType() {
         if (resourceType == null) {
-            resourceType = file.isFile()
-                    ? RESOURCE_TYPE_FILE
-                            : RESOURCE_TYPE_FOLDER;
+            resourceType = file.isFile() ? RESOURCE_TYPE_FILE : RESOURCE_TYPE_FOLDER;
         }
-
         return resourceType;
     }
 
@@ -156,39 +154,31 @@ public class FsResource extends AbstractResource {
     @SuppressWarnings("unchecked")
     public <AdapterType> AdapterType adaptTo(Class<AdapterType> type) {
         if (type == File.class) {
-
             return (AdapterType) file;
-
-        } else if (type == InputStream.class) {
-
+        }
+        else if (type == InputStream.class) {
             if (!file.isDirectory() && file.canRead()) {
-
                 try {
                     return (AdapterType) new FileInputStream(file);
-                } catch (IOException ioe) {
-                    getLog().info(
-                            "adaptTo: Cannot open a stream on the file " + file,
-                            ioe);
                 }
-
-            } else {
-
-                getLog().debug("adaptTo: File {} is not a readable file", file);
-
+                catch (IOException ioe) {
+                    log.info("adaptTo: Cannot open a stream on the file " + file, ioe);
+                }
             }
-
-        } else if (type == URL.class) {
-
+            else {
+                log.debug("adaptTo: File {} is not a readable file", file);
+            }
+        }
+        else if (type == URL.class) {
             try {
                 return (AdapterType) file.toURI().toURL();
-            } catch (MalformedURLException mue) {
-                getLog().info(
-                        "adaptTo: Cannot convert the file path " + file
-                        + " to an URL", mue);
+            }
+            catch (MalformedURLException mue) {
+                log.info("adaptTo: Cannot convert the file path " + file + " to an URL", mue);
             }
 
-        } else if (type == ValueMap.class) {
-
+        }
+        else if (type == ValueMap.class) {
             // this resource simulates nt:file/nt:folder behavior by returning it as resource type
             // we should simulate the corresponding JCR properties in a value map as well
             if (file.exists() && file.canRead()) {
@@ -200,18 +190,17 @@ public class FsResource extends AbstractResource {
                 props.put("jcr:created", lastModifed);
                 return (AdapterType) new ValueMapDecorator(props);
             }
-
         }
-
         return super.adaptTo(type);
     }
 
-    // ---------- internal
-
-    private Logger getLog() {
-        if (log == null) {
-            log = LoggerFactory.getLogger(getClass());
-        }
-        return log;
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
+                .append("path", resourcePath)
+                .append("file", file.getPath())
+                .append("resourceType", getResourceType())
+                .build();
     }
+
 }
diff --git a/src/main/java/org/apache/sling/fsprovider/internal/mapper/FileResourceMapper.java b/src/main/java/org/apache/sling/fsprovider/internal/mapper/FileResourceMapper.java
new file mode 100644
index 0000000..12b0f7a
--- /dev/null
+++ b/src/main/java/org/apache/sling/fsprovider/internal/mapper/FileResourceMapper.java
@@ -0,0 +1,145 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.fsprovider.internal.mapper;
+
+import java.io.File;
+import java.util.Iterator;
+
+import org.apache.commons.collections.IteratorUtils;
+import org.apache.commons.collections.Predicate;
+import org.apache.commons.collections.Transformer;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.fsprovider.internal.ContentFileExtensions;
+import org.apache.sling.fsprovider.internal.FsResourceMapper;
+
+public final class FileResourceMapper implements FsResourceMapper {
+
+    // The location in the resource tree where the resources are mapped
+    private final String providerRoot;
+
+    // providerRoot + "/" to be used for prefix matching of paths
+    private final String providerRootPrefix;
+
+    // The "root" file or folder in the file system
+    private final File providerFile;
+    
+    private final ContentFileExtensions contentFileExtensions;
+    
+    public FileResourceMapper(String providerRoot, File providerFile, ContentFileExtensions contentFileExtensions) {
+        this.providerRoot = providerRoot;
+        this.providerRootPrefix = providerRoot.concat("/");
+        this.providerFile = providerFile;
+        this.contentFileExtensions = contentFileExtensions;
+    }
+    
+    @Override
+    public Resource getResource(final ResourceResolver resolver, final String resourcePath) {
+        File file = getFile(resourcePath);
+        if (file != null) {
+            return new FileResource(resolver, resourcePath, file);
+        }
+        else {
+            return null;
+        }
+    }
+    
+    @SuppressWarnings("unchecked")
+    @Override
+    public Iterator<Resource> getChildren(final ResourceResolver resolver, final Resource parent) {
+        final String parentPath = parent.getPath();
+        File parentFile = parent.adaptTo(File.class);
+
+        // not a FsResource, try to create one from the resource
+        if (parentFile == null) {
+            // if the parent path is at or below the provider root, get
+            // the respective file
+            parentFile = getFile(parentPath);
+
+            // if the parent path is actually the parent of the provider
+            // root, return a single element iterator just containing the
+            // provider file, unless the provider file is a directory and
+            // a repository item with the same path actually exists
+            if (parentFile == null) {
+
+                if (providerFile.exists() && !StringUtils.startsWith(parentPath, providerRoot)) {
+                    String parentPathPrefix = parentPath.concat("/");
+                    if (providerRoot.startsWith(parentPathPrefix)) {
+                        String relPath = providerRoot.substring(parentPathPrefix.length());
+                        if (relPath.indexOf('/') < 0) {
+                            Resource res = new FileResource(resolver, providerRoot, providerFile);
+                            return IteratorUtils.singletonIterator(res);
+                        }
+                    }
+                }
+
+                // no children here
+                return null;
+            }
+        }
+        
+        // ensure parent is a directory
+        if (!parentFile.isDirectory()) {
+            return null;
+        }
+
+        Iterator<File> children = IteratorUtils.filteredIterator(IteratorUtils.arrayIterator(parentFile.listFiles()), new Predicate() {
+            @Override
+            public boolean evaluate(Object object) {
+                File file = (File)object;
+                return !contentFileExtensions.matchesSuffix(file);
+            }
+        });
+        if (!children.hasNext()) {
+            return null;
+        }
+        return IteratorUtils.transformedIterator(children, new Transformer() {
+            @Override
+            public Object transform(Object input) {
+                File file = (File)input;
+                String path = parentPath + "/" + file.getName();
+                return new FileResource(resolver, path, file);
+            }
+        });
+    }
+
+    /**
+     * Returns a file corresponding to the given absolute resource tree path. If
+     * the path equals the configured provider root, the provider root file is
+     * returned. If the path starts with the configured provider root, a file is
+     * returned relative to the provider root file whose relative path is the
+     * remains of the resource tree path without the provider root path.
+     * Otherwise <code>null</code> is returned.
+     */
+    private File getFile(String path) {
+        if (path.equals(providerRoot)) {
+            return providerFile;
+        }
+        if (path.startsWith(providerRootPrefix)) {
+            String relPath = path.substring(providerRootPrefix.length());
+            File file = new File(providerFile, relPath);
+            if (file.exists() && !contentFileExtensions.matchesSuffix(file)) {
+                return file;
+            }
+        }
+        return null;
+    }
+    
+}
diff --git a/src/main/java/org/apache/sling/fsprovider/internal/mapper/ValueMapUtil.java b/src/main/java/org/apache/sling/fsprovider/internal/mapper/ValueMapUtil.java
new file mode 100644
index 0000000..8ddbda7
--- /dev/null
+++ b/src/main/java/org/apache/sling/fsprovider/internal/mapper/ValueMapUtil.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.fsprovider.internal.mapper;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.jcr.nodetype.NodeType;
+
+import org.apache.sling.api.resource.ValueMap;
+import org.apache.sling.api.wrappers.ValueMapDecorator;
+
+final class ValueMapUtil {
+    
+    private ValueMapUtil() {
+        // static methods only
+    }
+    
+    /**
+     * Convert map to value map.
+     * @param content Content map.
+     * @return Value map.
+     */
+    public static ValueMap toValueMap(Map<String,Object> content) {
+        Map<String,Object> props = new HashMap<>();
+        
+        for (Map.Entry<String, Object> entry : ((Map<String,Object>)content).entrySet()) {
+            if (entry.getValue() instanceof Map) {
+                // skip child resources
+                continue;
+            }
+            else if (entry.getValue() instanceof Collection) {
+                // convert lists to arrays
+                props.put(entry.getKey(), ((Collection)entry.getValue()).toArray());
+            }
+            else {
+                props.put(entry.getKey(), entry.getValue());
+            }
+        }
+        
+        // fallback to default jcr:primaryType is none is set
+        if (!props.containsKey("jcr:primaryType")) {
+            props.put("jcr:primaryType", NodeType.NT_UNSTRUCTURED);
+        }
+        
+        return new ValueMapDecorator(props);
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/fsprovider/internal/mapper/jcr/FsItem.java b/src/main/java/org/apache/sling/fsprovider/internal/mapper/jcr/FsItem.java
new file mode 100644
index 0000000..d5689a9
--- /dev/null
+++ b/src/main/java/org/apache/sling/fsprovider/internal/mapper/jcr/FsItem.java
@@ -0,0 +1,161 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.fsprovider.internal.mapper.jcr;
+
+import javax.jcr.AccessDeniedException;
+import javax.jcr.InvalidItemStateException;
+import javax.jcr.Item;
+import javax.jcr.ItemExistsException;
+import javax.jcr.ItemNotFoundException;
+import javax.jcr.ItemVisitor;
+import javax.jcr.Node;
+import javax.jcr.ReferentialIntegrityException;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.lock.LockException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.nodetype.NoSuchNodeTypeException;
+import javax.jcr.version.VersionException;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.api.resource.ValueMap;
+import org.apache.sling.fsprovider.internal.mapper.ContentFile;
+
+/**
+ * Simplified implementation of read-only content access via the JCR API.
+ */
+abstract class FsItem implements Item {
+    
+    protected final ContentFile contentFile;
+    protected final ResourceResolver resolver;
+    protected final ValueMap props;
+    
+    public FsItem(ContentFile contentFile, ResourceResolver resolver) {
+        this.contentFile = contentFile;
+        this.resolver = resolver;
+        this.props = contentFile.getValueMap();
+    }
+
+    @Override
+    public String getPath() throws RepositoryException {
+        if (contentFile.getSubPath() == null) {
+            return contentFile.getPath();
+        }
+        else {
+            return contentFile.getPath() + "/" + contentFile.getSubPath();
+        }
+    }
+
+    @Override
+    public Item getAncestor(int depth) throws ItemNotFoundException, AccessDeniedException, RepositoryException {
+        String path;
+        if (depth == 0) {
+            path = "/";
+        }
+        else {
+            String[] pathParts = StringUtils.splitPreserveAllTokens(getPath(), "/");
+            path = StringUtils.join(pathParts, "/", 0, depth + 1);
+        }
+        Resource resource = resolver.getResource(path);
+        if (resource != null) {
+            Node refNode = resource.adaptTo(Node.class);
+            if (refNode != null) {
+                return refNode;
+            }
+        }
+        throw new ItemNotFoundException();
+    }
+
+    @Override
+    public int getDepth() throws RepositoryException {
+        if (StringUtils.equals("/", getPath())) {
+            return 0;
+        } else {
+            return StringUtils.countMatches(getPath(), "/");
+        }
+    }
+
+    @Override
+    public Session getSession() throws RepositoryException {
+        return resolver.adaptTo(Session.class);
+    }
+
+    @Override
+    public boolean isNode() {
+        return (this instanceof Node);
+    }
+
+    @Override
+    public boolean isNew() {
+        return false;
+    }
+
+    @Override
+    public boolean isModified() {
+        return false;
+    }
+
+    @Override
+    public boolean isSame(Item otherItem) throws RepositoryException {
+        return StringUtils.equals(getPath(), otherItem.getPath());
+    }
+
+    @Override
+    public void accept(ItemVisitor visitor) throws RepositoryException {
+        // do nothing
+    }
+    
+    @Override
+    public String toString() {
+        try {
+            return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
+                    .append("path", getPath())
+                    .build();
+        }
+        catch (RepositoryException ex) {
+            throw new RuntimeException(ex);
+        }
+    }
+    
+    
+    // --- unsupported methods ---
+
+    @Override
+    public void save() throws AccessDeniedException, ItemExistsException, ConstraintViolationException,
+            InvalidItemStateException, ReferentialIntegrityException, VersionException, LockException,
+            NoSuchNodeTypeException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void refresh(boolean keepChanges) throws InvalidItemStateException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void remove() throws VersionException, LockException, ConstraintViolationException, AccessDeniedException,
+            RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/fsprovider/internal/mapper/jcr/FsNode.java b/src/main/java/org/apache/sling/fsprovider/internal/mapper/jcr/FsNode.java
new file mode 100644
index 0000000..6f52691
--- /dev/null
+++ b/src/main/java/org/apache/sling/fsprovider/internal/mapper/jcr/FsNode.java
@@ -0,0 +1,549 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.fsprovider.internal.mapper.jcr;
+
+import java.io.InputStream;
+import java.math.BigDecimal;
+import java.util.Calendar;
+
+import javax.jcr.AccessDeniedException;
+import javax.jcr.Binary;
+import javax.jcr.InvalidItemStateException;
+import javax.jcr.InvalidLifecycleTransitionException;
+import javax.jcr.Item;
+import javax.jcr.ItemExistsException;
+import javax.jcr.ItemNotFoundException;
+import javax.jcr.MergeException;
+import javax.jcr.NoSuchWorkspaceException;
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.PathNotFoundException;
+import javax.jcr.Property;
+import javax.jcr.PropertyIterator;
+import javax.jcr.RepositoryException;
+import javax.jcr.UnsupportedRepositoryOperationException;
+import javax.jcr.Value;
+import javax.jcr.ValueFormatException;
+import javax.jcr.lock.Lock;
+import javax.jcr.lock.LockException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.nodetype.NoSuchNodeTypeException;
+import javax.jcr.nodetype.NodeDefinition;
+import javax.jcr.nodetype.NodeType;
+import javax.jcr.version.ActivityViolationException;
+import javax.jcr.version.Version;
+import javax.jcr.version.VersionException;
+import javax.jcr.version.VersionHistory;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.api.resource.ResourceUtil;
+import org.apache.sling.fsprovider.internal.mapper.ContentFile;
+
+/**
+ * Simplified implementation of read-only content access via the JCR API.
+ */
+public final class FsNode extends FsItem implements Node {
+    
+    public FsNode(ContentFile contentFile, ResourceResolver resolver) {
+        super(contentFile, resolver);
+    }
+    
+    private String getPrimaryTypeName() {
+        return props.get("jcr:primaryType", String.class);
+    }
+    
+    private String[] getMixinTypeNames() {
+        return props.get("jcr:mixinTypes", new String[0]);
+    }
+    
+    @Override
+    public String getName() throws RepositoryException {
+        if (contentFile.getSubPath() == null) {
+            return ResourceUtil.getName(contentFile.getPath());
+        }
+        else {
+            return ResourceUtil.getName(contentFile.getSubPath());
+        }
+    }
+
+    @Override
+    public Node getParent() throws ItemNotFoundException, AccessDeniedException, RepositoryException {
+        return getNode(ResourceUtil.getParent(getPath()));
+    }
+    
+    @Override
+    public Node getNode(String relPath) throws PathNotFoundException, RepositoryException {
+        if (relPath == null) {
+            throw new PathNotFoundException();
+        }
+        
+        // get absolute node path
+        String path = relPath;
+        if (!StringUtils.startsWith(path,  "/")) {
+            path = ResourceUtil.normalize(getPath() + "/" + relPath);
+        }
+
+        if (StringUtils.equals(path, contentFile.getPath()) || StringUtils.startsWith(path, contentFile.getPath() + "/")) {
+            // node is contained in content file
+            String subPath;
+            if (StringUtils.equals(path, contentFile.getPath())) {
+                subPath = null;
+            }
+            else {
+                subPath = path.substring(contentFile.getPath().length() + 1);
+            }
+            ContentFile referencedFile = contentFile.navigateTo(subPath);
+            if (referencedFile.hasContent()) {
+                return new FsNode(referencedFile, resolver);
+            }
+        }
+        else {
+            // node is outside content file
+            Node refNode = null;
+            Resource resource = resolver.getResource(path);
+            if (resource != null) {
+                refNode = resource.adaptTo(Node.class);
+                if (refNode != null) {
+                    return refNode;
+                }
+            }
+        }
+        throw new PathNotFoundException(relPath);
+    }
+
+    @Override
+    public NodeIterator getNodes() throws RepositoryException {
+        return new FsNodeIterator(contentFile, resolver);
+    }
+
+    @Override
+    public Property getProperty(String relPath) throws PathNotFoundException, RepositoryException {
+        if (props.containsKey(relPath)) {
+            return new FsProperty(contentFile, resolver, relPath, this);
+        }
+        throw new PathNotFoundException(relPath);
+    }
+
+    @Override
+    public PropertyIterator getProperties() throws RepositoryException {
+        return new FsPropertyIterator(props.keySet().iterator(), contentFile, resolver, this);
+    }
+
+    @Override
+    public String getUUID() throws UnsupportedRepositoryOperationException, RepositoryException {
+        String uuid = props.get("jcr:uuid", String.class);
+        if (uuid != null) {
+            return uuid;
+        }
+        else {
+            throw new UnsupportedRepositoryOperationException();
+        }
+    }
+
+    @Override
+    public boolean hasNode(String relPath) throws RepositoryException {
+        try {
+            getNode(relPath);
+            return true;
+        }
+        catch (RepositoryException ex) {
+            return false;
+        }
+    }
+
+    @Override
+    public boolean hasProperty(String relPath) throws RepositoryException {
+        return props.containsKey(relPath);
+    }
+
+    @Override
+    public boolean hasNodes() throws RepositoryException {
+        return getNodes().hasNext();
+    }
+
+    @Override
+    public boolean hasProperties() throws RepositoryException {
+        return !props.isEmpty();
+    }
+
+    @Override
+    public boolean isNodeType(String nodeTypeName) throws RepositoryException {
+        return StringUtils.equals(nodeTypeName, getPrimaryTypeName());
+    }
+
+    @Override
+    public boolean canAddMixin(String mixinName) throws NoSuchNodeTypeException, RepositoryException {
+        return false;
+    }
+
+    @Override
+    public boolean isCheckedOut() throws RepositoryException {
+        return false;
+    }
+
+    @Override
+    public boolean holdsLock() throws RepositoryException {
+        return false;
+    }
+
+    @Override
+    public boolean isLocked() throws RepositoryException {
+        return false;
+    }
+
+    @Override
+    public NodeType getPrimaryNodeType() throws RepositoryException {
+        return new FsNodeType(getPrimaryTypeName(), false);
+    }
+
+    @Override
+    public NodeType[] getMixinNodeTypes() throws RepositoryException {
+        String[] mixinTypeNames = getMixinTypeNames();
+        NodeType[] mixinTypes = new NodeType[mixinTypeNames.length];
+        for (int i=0; i<mixinTypeNames.length; i++) {
+            mixinTypes[i] = new FsNodeType(mixinTypeNames[i], true);
+        }
+        return mixinTypes;
+    }
+    
+
+    // --- unsupported methods ---
+    
+    @Override
+    public Node addNode(String relPath) throws ItemExistsException, PathNotFoundException, VersionException,
+            ConstraintViolationException, LockException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Node addNode(String relPath, String primaryNodeTypeName)
+            throws ItemExistsException, PathNotFoundException, NoSuchNodeTypeException, LockException, VersionException,
+            ConstraintViolationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void orderBefore(String srcChildRelPath, String destChildRelPath)
+            throws UnsupportedRepositoryOperationException, VersionException, ConstraintViolationException,
+            ItemNotFoundException, LockException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Property setProperty(String name, Value value) throws ValueFormatException, VersionException, LockException,
+            ConstraintViolationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Property setProperty(String name, Value value, int type) throws ValueFormatException, VersionException,
+            LockException, ConstraintViolationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Property setProperty(String name, Value[] values) throws ValueFormatException, VersionException,
+            LockException, ConstraintViolationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Property setProperty(String name, Value[] values, int type) throws ValueFormatException, VersionException,
+            LockException, ConstraintViolationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Property setProperty(String name, String[] values) throws ValueFormatException, VersionException,
+            LockException, ConstraintViolationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Property setProperty(String name, String[] values, int type) throws ValueFormatException, VersionException,
+            LockException, ConstraintViolationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Property setProperty(String name, String value) throws ValueFormatException, VersionException, LockException,
+            ConstraintViolationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Property setProperty(String name, String value, int type) throws ValueFormatException, VersionException,
+            LockException, ConstraintViolationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Property setProperty(String name, InputStream value) throws ValueFormatException, VersionException,
+            LockException, ConstraintViolationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Property setProperty(String name, Binary value) throws ValueFormatException, VersionException, LockException,
+            ConstraintViolationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Property setProperty(String name, boolean value) throws ValueFormatException, VersionException,
+            LockException, ConstraintViolationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Property setProperty(String name, double value) throws ValueFormatException, VersionException, LockException,
+            ConstraintViolationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Property setProperty(String name, BigDecimal value) throws ValueFormatException, VersionException,
+            LockException, ConstraintViolationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Property setProperty(String name, long value) throws ValueFormatException, VersionException, LockException,
+            ConstraintViolationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Property setProperty(String name, Calendar value) throws ValueFormatException, VersionException,
+            LockException, ConstraintViolationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Property setProperty(String name, Node value) throws ValueFormatException, VersionException, LockException,
+            ConstraintViolationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public PropertyIterator getReferences() throws RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public PropertyIterator getReferences(String name) throws RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public PropertyIterator getWeakReferences() throws RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public PropertyIterator getWeakReferences(String name) throws RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void setPrimaryType(String nodeTypeName) throws NoSuchNodeTypeException, VersionException,
+            ConstraintViolationException, LockException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void addMixin(String mixinName) throws NoSuchNodeTypeException, VersionException,
+            ConstraintViolationException, LockException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void removeMixin(String mixinName) throws NoSuchNodeTypeException, VersionException,
+            ConstraintViolationException, LockException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public NodeDefinition getDefinition() throws RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Version checkin() throws VersionException, UnsupportedRepositoryOperationException,
+            InvalidItemStateException, LockException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void checkout() throws UnsupportedRepositoryOperationException, LockException, ActivityViolationException,
+            RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void doneMerge(Version version) throws VersionException, InvalidItemStateException,
+            UnsupportedRepositoryOperationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void cancelMerge(Version version) throws VersionException, InvalidItemStateException,
+            UnsupportedRepositoryOperationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void update(String srcWorkspace) throws NoSuchWorkspaceException, AccessDeniedException, LockException,
+            InvalidItemStateException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public NodeIterator merge(String srcWorkspace, boolean bestEffort) throws NoSuchWorkspaceException,
+            AccessDeniedException, MergeException, LockException, InvalidItemStateException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public String getCorrespondingNodePath(String workspaceName)
+            throws ItemNotFoundException, NoSuchWorkspaceException, AccessDeniedException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public NodeIterator getSharedSet() throws RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void removeSharedSet()
+            throws VersionException, LockException, ConstraintViolationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void removeShare()
+            throws VersionException, LockException, ConstraintViolationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void restore(String versionName, boolean removeExisting) throws VersionException, ItemExistsException,
+            UnsupportedRepositoryOperationException, LockException, InvalidItemStateException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void restore(Version version, boolean removeExisting) throws VersionException, ItemExistsException,
+            InvalidItemStateException, UnsupportedRepositoryOperationException, LockException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void restore(Version version, String relPath, boolean removeExisting)
+            throws PathNotFoundException, ItemExistsException, VersionException, ConstraintViolationException,
+            UnsupportedRepositoryOperationException, LockException, InvalidItemStateException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void restoreByLabel(String versionLabel, boolean removeExisting)
+            throws VersionException, ItemExistsException, UnsupportedRepositoryOperationException, LockException,
+            InvalidItemStateException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public VersionHistory getVersionHistory() throws UnsupportedRepositoryOperationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Version getBaseVersion() throws UnsupportedRepositoryOperationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Lock lock(boolean isDeep, boolean isSessionScoped) throws UnsupportedRepositoryOperationException,
+            LockException, AccessDeniedException, InvalidItemStateException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Lock getLock()
+            throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void unlock() throws UnsupportedRepositoryOperationException, LockException, AccessDeniedException,
+            InvalidItemStateException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void followLifecycleTransition(String transition)
+            throws UnsupportedRepositoryOperationException, InvalidLifecycleTransitionException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public String[] getAllowedLifecycleTransistions()
+            throws UnsupportedRepositoryOperationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public NodeIterator getNodes(String namePattern) throws RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public NodeIterator getNodes(String[] nameGlobs) throws RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public String getIdentifier() throws RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public int getIndex() throws RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Item getPrimaryItem() throws ItemNotFoundException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public PropertyIterator getProperties(String namePattern) throws RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public PropertyIterator getProperties(String[] nameGlobs) throws RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/fsprovider/internal/mapper/jcr/FsNodeIterator.java b/src/main/java/org/apache/sling/fsprovider/internal/mapper/jcr/FsNodeIterator.java
new file mode 100644
index 0000000..f03b0a7
--- /dev/null
+++ b/src/main/java/org/apache/sling/fsprovider/internal/mapper/jcr/FsNodeIterator.java
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.fsprovider.internal.mapper.jcr;
+
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+
+import org.apache.commons.collections.IteratorUtils;
+import org.apache.commons.collections.Predicate;
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.fsprovider.internal.mapper.ContentFile;
+
+/**
+ * Simplified implementation of read-only content access via the JCR API.
+ */
+class FsNodeIterator implements NodeIterator {
+    
+    private final ContentFile contentFile;
+    private final ResourceResolver resolver;
+    private final Iterator<Map.Entry<String,Map<String,Object>>> children;
+
+    @SuppressWarnings("unchecked")
+    public FsNodeIterator(ContentFile contentFile, ResourceResolver resolver) {
+        this.contentFile = contentFile;
+        this.resolver = resolver;
+        Map<String,Object> content = (Map<String,Object>)contentFile.getContent();
+        this.children = IteratorUtils.filteredIterator(content.entrySet().iterator(), new Predicate() {
+            @Override
+            public boolean evaluate(Object object) {
+                Map.Entry<String,Object> entry = (Map.Entry<String,Object>)object;
+                return (entry.getValue() instanceof Map);
+            }
+        });
+    }
+
+    public boolean hasNext() {
+        return children.hasNext();
+    }
+
+    public Object next() {
+        return nextNode();
+    }
+
+    @Override
+    public Node nextNode() {
+        Map.Entry<String,Map<String,Object>> nextEntry = children.next();
+        String subPath;
+        if (contentFile.getSubPath() == null) {
+            subPath = nextEntry.getKey();
+        }
+        else {
+            subPath = contentFile.getSubPath() + "/" + nextEntry.getKey();
+        }
+        return new FsNode(contentFile.navigateTo(subPath), resolver);
+    }
+
+    
+    // --- unsupported methods ---
+        
+    public void remove() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void skip(long skipNum) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public long getSize() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public long getPosition() {
+        throw new UnsupportedOperationException();
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/fsprovider/internal/mapper/jcr/FsNodeType.java b/src/main/java/org/apache/sling/fsprovider/internal/mapper/jcr/FsNodeType.java
new file mode 100644
index 0000000..8d60812
--- /dev/null
+++ b/src/main/java/org/apache/sling/fsprovider/internal/mapper/jcr/FsNodeType.java
@@ -0,0 +1,157 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.fsprovider.internal.mapper.jcr;
+
+import javax.jcr.Value;
+import javax.jcr.nodetype.NodeDefinition;
+import javax.jcr.nodetype.NodeType;
+import javax.jcr.nodetype.NodeTypeIterator;
+import javax.jcr.nodetype.PropertyDefinition;
+
+import org.apache.commons.lang3.StringUtils;
+
+class FsNodeType implements NodeType {
+    
+    private final String name;
+    private final boolean mixin;
+    
+    public FsNodeType(String name, boolean mixin) {
+        this.name = name;
+        this.mixin = mixin;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+
+    @Override
+    public String[] getDeclaredSupertypeNames() {
+        return new String[0];
+    }
+
+    @Override
+    public boolean isAbstract() {
+        return false;
+    }
+
+    @Override
+    public boolean isMixin() {
+        return mixin;
+    }
+
+    @Override
+    public boolean hasOrderableChildNodes() {
+        return false;
+    }
+
+    @Override
+    public boolean isQueryable() {
+        return false;
+    }
+
+    @Override
+    public String getPrimaryItemName() {
+        return null;
+    }
+
+    @Override
+    public NodeType[] getSupertypes() {
+        return new NodeType[0];
+    }
+
+    @Override
+    public NodeType[] getDeclaredSupertypes() {
+        return new NodeType[0];
+    }
+
+    @Override
+    public boolean isNodeType(String nodeTypeName) {
+        return StringUtils.equals(name, nodeTypeName);
+    }
+
+
+    // --- unsupported methods ---    
+    
+    @Override
+    public PropertyDefinition[] getDeclaredPropertyDefinitions() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public NodeDefinition[] getDeclaredChildNodeDefinitions() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public NodeTypeIterator getSubtypes() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public NodeTypeIterator getDeclaredSubtypes() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public PropertyDefinition[] getPropertyDefinitions() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public NodeDefinition[] getChildNodeDefinitions() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public boolean canSetProperty(String propertyName, Value value) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public boolean canSetProperty(String propertyName, Value[] values) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public boolean canAddChildNode(String childNodeName) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public boolean canAddChildNode(String childNodeName, String nodeTypeName) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public boolean canRemoveItem(String itemName) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public boolean canRemoveNode(String nodeName) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public boolean canRemoveProperty(String propertyName) {
+        throw new UnsupportedOperationException();
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/fsprovider/internal/mapper/jcr/FsProperty.java b/src/main/java/org/apache/sling/fsprovider/internal/mapper/jcr/FsProperty.java
new file mode 100644
index 0000000..bf24aa7
--- /dev/null
+++ b/src/main/java/org/apache/sling/fsprovider/internal/mapper/jcr/FsProperty.java
@@ -0,0 +1,242 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.fsprovider.internal.mapper.jcr;
+
+import java.io.InputStream;
+import java.lang.reflect.Array;
+import java.math.BigDecimal;
+import java.util.Calendar;
+
+import javax.jcr.AccessDeniedException;
+import javax.jcr.Binary;
+import javax.jcr.ItemNotFoundException;
+import javax.jcr.Node;
+import javax.jcr.Property;
+import javax.jcr.RepositoryException;
+import javax.jcr.Value;
+import javax.jcr.ValueFormatException;
+import javax.jcr.lock.LockException;
+import javax.jcr.nodetype.ConstraintViolationException;
+import javax.jcr.nodetype.PropertyDefinition;
+import javax.jcr.version.VersionException;
+
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.fsprovider.internal.mapper.ContentFile;
+
+/**
+ * Simplified implementation of read-only content access via the JCR API.
+ */
+class FsProperty extends FsItem implements Property {
+    
+    private final String propertyName;
+    private final Node node;
+    
+    public FsProperty(ContentFile contentFile, ResourceResolver resolver, String propertyName, Node node) {
+        super(contentFile, resolver);
+        this.propertyName = propertyName;
+        this.node = node;
+    }
+    
+    @Override
+    public String getName() throws RepositoryException {
+        return propertyName;
+    }
+
+    @Override
+    public Node getParent() throws ItemNotFoundException, AccessDeniedException, RepositoryException {
+        return getNode();
+    }
+
+    @Override
+    public Node getNode() throws ItemNotFoundException, ValueFormatException, RepositoryException {
+        return node;
+    }
+    
+    @Override
+    public String getPath() throws RepositoryException {
+        return super.getPath() + "/" + propertyName;
+    }
+
+    @Override
+    public Value getValue() throws ValueFormatException, RepositoryException {
+        return new FsValue(props, propertyName);
+    }
+
+    @Override
+    public String getString() throws ValueFormatException, RepositoryException {
+        return getValue().getString();
+    }
+
+    @SuppressWarnings("deprecation")
+    @Override
+    public InputStream getStream() throws ValueFormatException, RepositoryException {
+        return getValue().getStream();
+    }
+
+    @Override
+    public Binary getBinary() throws ValueFormatException, RepositoryException {
+        return getValue().getBinary();
+    }
+
+    @Override
+    public long getLong() throws ValueFormatException, RepositoryException {
+        return getValue().getLong();
+    }
+
+    @Override
+    public double getDouble() throws ValueFormatException, RepositoryException {
+        return getValue().getDouble();
+    }
+
+    @Override
+    public BigDecimal getDecimal() throws ValueFormatException, RepositoryException {
+        return getValue().getDecimal();
+    }
+
+    @Override
+    public Calendar getDate() throws ValueFormatException, RepositoryException {
+        return getValue().getDate();
+    }
+
+    @Override
+    public boolean getBoolean() throws ValueFormatException, RepositoryException {
+        return getValue().getBoolean();
+    }
+
+    @Override
+    public Value[] getValues() throws ValueFormatException, RepositoryException {
+        if (!isMultiple()) {
+            throw new ValueFormatException();
+        }
+        Object value = props.get(propertyName);
+        int size = Array.getLength(value);
+        Value[] result = new Value[size];
+        for (int i=0; i<size; i++) {
+            result[i] = new FsValue(props, propertyName, i);
+        }
+        return result;
+    }
+
+    @Override
+    public boolean isMultiple() throws RepositoryException {
+        Object value = props.get(propertyName);
+        return value != null && value.getClass().isArray();
+    }
+
+    @Override
+    public int getType() throws RepositoryException {
+        return getValue().getType();
+    }
+    
+    @Override
+    public PropertyDefinition getDefinition() throws RepositoryException {
+        return new FsPropertyDefinition(propertyName);
+    }
+
+    
+    // --- unsupported methods ---
+    
+    @Override
+    public void setValue(Value value) throws ValueFormatException, VersionException, LockException,
+            ConstraintViolationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void setValue(Value[] values) throws ValueFormatException, VersionException, LockException,
+            ConstraintViolationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void setValue(String value) throws ValueFormatException, VersionException, LockException,
+            ConstraintViolationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void setValue(String[] values) throws ValueFormatException, VersionException, LockException,
+            ConstraintViolationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void setValue(InputStream value) throws ValueFormatException, VersionException, LockException,
+            ConstraintViolationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void setValue(Binary value) throws ValueFormatException, VersionException, LockException,
+            ConstraintViolationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void setValue(long value) throws ValueFormatException, VersionException, LockException,
+            ConstraintViolationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void setValue(double value) throws ValueFormatException, VersionException, LockException,
+            ConstraintViolationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void setValue(BigDecimal value) throws ValueFormatException, VersionException, LockException,
+            ConstraintViolationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void setValue(Calendar value) throws ValueFormatException, VersionException, LockException,
+            ConstraintViolationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void setValue(boolean value) throws ValueFormatException, VersionException, LockException,
+            ConstraintViolationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void setValue(Node value) throws ValueFormatException, VersionException, LockException,
+            ConstraintViolationException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Property getProperty() throws ItemNotFoundException, ValueFormatException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public long getLength() throws ValueFormatException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public long[] getLengths() throws ValueFormatException, RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/fsprovider/internal/mapper/jcr/FsPropertyDefinition.java b/src/main/java/org/apache/sling/fsprovider/internal/mapper/jcr/FsPropertyDefinition.java
new file mode 100644
index 0000000..85920cb
--- /dev/null
+++ b/src/main/java/org/apache/sling/fsprovider/internal/mapper/jcr/FsPropertyDefinition.java
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.fsprovider.internal.mapper.jcr;
+
+import javax.jcr.PropertyType;
+import javax.jcr.Value;
+import javax.jcr.nodetype.NodeType;
+import javax.jcr.nodetype.PropertyDefinition;
+import javax.jcr.version.OnParentVersionAction;
+
+class FsPropertyDefinition implements PropertyDefinition {
+    
+    private final String name;
+    
+    public FsPropertyDefinition(String name) {
+        this.name = name;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+
+    @Override
+    public NodeType getDeclaringNodeType() {
+        return null;
+    }
+
+    @Override
+    public boolean isAutoCreated() {
+        return false;
+    }
+
+    @Override
+    public boolean isMandatory() {
+        return false;
+    }
+
+    @Override
+    public int getOnParentVersion() {
+        return OnParentVersionAction.COPY;
+    }
+
+    @Override
+    public boolean isProtected() {
+        return false;
+    }
+
+    @Override
+    public int getRequiredType() {
+        return PropertyType.UNDEFINED;
+    }
+
+    @Override
+    public String[] getValueConstraints() {
+        return new String[0];
+    }
+
+    @Override
+    public Value[] getDefaultValues() {
+        return new Value[0];
+    }
+
+    @Override
+    public boolean isMultiple() {
+        return false;
+    }
+
+    @Override
+    public String[] getAvailableQueryOperators() {
+        return new String[0];
+    }
+
+    @Override
+    public boolean isFullTextSearchable() {
+        return false;
+    }
+
+    @Override
+    public boolean isQueryOrderable() {
+        return false;
+    }    
+
+}
diff --git a/src/main/java/org/apache/sling/fsprovider/internal/mapper/jcr/FsPropertyIterator.java b/src/main/java/org/apache/sling/fsprovider/internal/mapper/jcr/FsPropertyIterator.java
new file mode 100644
index 0000000..335472f
--- /dev/null
+++ b/src/main/java/org/apache/sling/fsprovider/internal/mapper/jcr/FsPropertyIterator.java
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.fsprovider.internal.mapper.jcr;
+
+import java.util.Iterator;
+
+import javax.jcr.Node;
+import javax.jcr.Property;
+import javax.jcr.PropertyIterator;
+
+import org.apache.sling.api.resource.ResourceResolver;
+import org.apache.sling.fsprovider.internal.mapper.ContentFile;
+
+/**
+ * Simplified implementation of read-only content access via the JCR API.
+ */
+class FsPropertyIterator implements PropertyIterator {
+    
+    private final Iterator<String> propertyNames;
+    private final ContentFile contentFile;
+    private final ResourceResolver resolver;
+    private final Node node;
+    
+    public FsPropertyIterator(Iterator<String> propertyNames, ContentFile contentFile, ResourceResolver resolver, Node node) {
+        this.propertyNames = propertyNames;
+        this.contentFile = contentFile;
+        this.resolver = resolver;
+        this.node = node;
+    }
+
+    public boolean hasNext() {
+        return propertyNames.hasNext();
+    }
+
+    public Object next() {
+        return nextProperty();
+    }
+
+    @Override
+    public Property nextProperty() {
+        return new FsProperty(contentFile, resolver, propertyNames.next(), node);
+    }
+
+    
+    // --- unsupported methods ---
+        
+    public void remove() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public void skip(long skipNum) {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public long getSize() {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public long getPosition() {
+        throw new UnsupportedOperationException();
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/fsprovider/internal/mapper/jcr/FsValue.java b/src/main/java/org/apache/sling/fsprovider/internal/mapper/jcr/FsValue.java
new file mode 100644
index 0000000..4ca2873
--- /dev/null
+++ b/src/main/java/org/apache/sling/fsprovider/internal/mapper/jcr/FsValue.java
@@ -0,0 +1,162 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.fsprovider.internal.mapper.jcr;
+
+import java.io.InputStream;
+import java.lang.reflect.Array;
+import java.math.BigDecimal;
+import java.util.Calendar;
+
+import javax.jcr.Binary;
+import javax.jcr.PropertyType;
+import javax.jcr.RepositoryException;
+import javax.jcr.Value;
+import javax.jcr.ValueFormatException;
+
+import org.apache.sling.api.resource.ValueMap;
+
+/**
+ * Simplified implementation of read-only content access via the JCR API.
+ */
+class FsValue implements Value {
+    
+    private final ValueMap props;
+    private final String propertyName;
+    private final int arrayIndex;
+    
+    public FsValue(ValueMap props, String propertyName) {
+        this.props = props;
+        this.propertyName = propertyName;
+        this.arrayIndex = -1;
+    }
+
+    public FsValue(ValueMap props, String propertyName, int arrayIndex) {
+        this.props = props;
+        this.propertyName = propertyName;
+        this.arrayIndex = arrayIndex;
+    }
+
+    @Override
+    public String getString() throws ValueFormatException, IllegalStateException, RepositoryException {
+        if (arrayIndex >= 0) {
+            return props.get(propertyName, String[].class)[arrayIndex];
+        }
+        else {
+            return props.get(propertyName, String.class);
+        }
+    }
+
+    @Override
+    public long getLong() throws ValueFormatException, RepositoryException {
+        if (arrayIndex >= 0) {
+            return props.get(propertyName, Long[].class)[arrayIndex];
+        }
+        else {
+            return props.get(propertyName, 0L);
+        }
+    }
+
+    @Override
+    public double getDouble() throws ValueFormatException, RepositoryException {
+        if (arrayIndex >= 0) {
+            return props.get(propertyName, Double[].class)[arrayIndex];
+        }
+        else {
+            return props.get(propertyName, 0d);
+        }
+    }
+
+    @Override
+    public BigDecimal getDecimal() throws ValueFormatException, RepositoryException {
+        if (arrayIndex >= 0) {
+            return props.get(propertyName, BigDecimal[].class)[arrayIndex];
+        }
+        else {
+            return props.get(propertyName, BigDecimal.ZERO);
+        }
+    }
+
+    @Override
+    public Calendar getDate() throws ValueFormatException, RepositoryException {
+        if (arrayIndex >= 0) {
+            return props.get(propertyName, Calendar[].class)[arrayIndex];
+        }
+        else {
+            return props.get(propertyName, Calendar.class);
+        }
+    }
+
+    @Override
+    public boolean getBoolean() throws ValueFormatException, RepositoryException {
+        if (arrayIndex >= 0) {
+            return props.get(propertyName, Boolean[].class)[arrayIndex];
+        }
+        else {
+            return props.get(propertyName, false);
+        }
+    }
+
+    @Override
+    public int getType() {
+        Object value = props.get(propertyName);
+        if (value == null) {
+            return PropertyType.UNDEFINED;
+        }
+        Class type = value.getClass();
+        if (type.isArray() && Array.getLength(value) > 0) {
+            Object firstItem = Array.get(value, 0);
+            if (firstItem != null) {
+                type = firstItem.getClass();
+            }
+        }
+        if (type == String.class) {
+            return PropertyType.STRING;
+        }
+        if (type == Boolean.class || type == boolean.class) {
+            return PropertyType.BOOLEAN;
+        }
+        if (type == BigDecimal.class) {
+            return PropertyType.DECIMAL;
+        }
+        if (type == Double.class || type == double.class || type == Float.class || type == float.class) {
+            return PropertyType.DOUBLE;
+        }
+        if (Number.class.isAssignableFrom(type)) {
+            return PropertyType.LONG;
+        }
+        if (type == Calendar.class) {
+            return PropertyType.DATE;
+        }
+        return PropertyType.UNDEFINED;
+    }
+
+
+    // --- unsupported methods ---
+    
+    @Override
+    public InputStream getStream() throws RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Binary getBinary() throws RepositoryException {
+        throw new UnsupportedOperationException();
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/fsprovider/internal/parser/ContentFileCache.java b/src/main/java/org/apache/sling/fsprovider/internal/parser/ContentFileCache.java
new file mode 100644
index 0000000..289fb67
--- /dev/null
+++ b/src/main/java/org/apache/sling/fsprovider/internal/parser/ContentFileCache.java
@@ -0,0 +1,107 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.fsprovider.internal.parser;
+
+import java.io.File;
+import java.util.Collections;
+import java.util.Map;
+
+import org.apache.commons.collections.map.LRUMap;
+
+/**
+ * Cache for parsed content from content files (e.g. JSON, JCR XML).
+ */
+public final class ContentFileCache {
+
+    private final Map<String,Map<String,Object>> contentCache;
+    private final Map<String,Object> NULL_MAP = Collections.emptyMap();
+    
+    /**
+     * @param maxSize Cache size. 0 = caching disabled.
+     */
+    @SuppressWarnings("unchecked")
+    public ContentFileCache(int maxSize) {
+        if (maxSize > 0) {
+            this.contentCache = Collections.synchronizedMap(new LRUMap(maxSize));
+        }
+        else {
+            this.contentCache = null;
+        }
+    }
+    
+    /**
+     * Get content.
+     * @param path Path (used as cache key).
+     * @param file File
+     * @return Content or null
+     */
+    public Map<String,Object> get(String path, File file) {
+        Map<String,Object> content = null;
+        if (contentCache != null) {
+            content = contentCache.get(path);
+        }
+        if (content == null) {
+            content = ContentFileParser.parse(file);
+            if (content == null) {
+                content = NULL_MAP;
+            }
+            if (contentCache != null) {
+                contentCache.put(path, content);
+            }
+        }
+        if (content == NULL_MAP) {
+            return null;
+        }
+        else {
+            return content;
+        }
+    }
+    
+    /**
+     * Remove content from cache.
+     * @param path Path (used as cache key)
+     */
+    public void remove(String path) {
+        if (contentCache != null) {
+            contentCache.remove(path);
+        }
+    }
+
+    /**
+     * Clear whole cache
+     */
+    public void clear() {
+        if (contentCache != null) {
+            contentCache.clear();
+        }
+    }
+    
+    /**
+     * @return Current cache size
+     */
+    public int size() {
+        if (contentCache != null) {
+            return contentCache.size();
+        }
+        else {
+            return 0;
+        }
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/fsprovider/internal/parser/ContentFileParser.java b/src/main/java/org/apache/sling/fsprovider/internal/parser/ContentFileParser.java
new file mode 100644
index 0000000..81a69a3
--- /dev/null
+++ b/src/main/java/org/apache/sling/fsprovider/internal/parser/ContentFileParser.java
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.fsprovider.internal.parser;
+
+import static org.apache.sling.fsprovider.internal.parser.ContentFileTypes.JCR_XML_SUFFIX;
+import static org.apache.sling.fsprovider.internal.parser.ContentFileTypes.JSON_SUFFIX;
+
+import java.io.File;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Parses files that contains content fragments (e.g. JSON, JCR XML).
+ */
+class ContentFileParser {
+    
+    private static final Logger log = LoggerFactory.getLogger(ContentFileParser.class);
+    
+    private ContentFileParser() {
+        // static methods only
+    }
+    
+    /**
+     * Parse content from file.
+     * @param file File. Type is detected automatically.
+     * @return Content or null if content could not be parsed.
+     */
+    public static Map<String,Object> parse(File file) {
+        try {
+            if (StringUtils.endsWith(file.getName(), JSON_SUFFIX)) {
+                return JsonFileParser.parse(file);
+            }
+            else if (StringUtils.endsWith(file.getName(), JCR_XML_SUFFIX)) {
+                return JcrXmlFileParser.parse(file);
+            }
+        }
+        catch (Throwable ex) {
+            log.warn("Error parsing content from " + file.getPath(), ex);
+        }
+        return null;
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/fsprovider/internal/parser/ContentFileTypes.java b/src/main/java/org/apache/sling/fsprovider/internal/parser/ContentFileTypes.java
new file mode 100644
index 0000000..85e6445
--- /dev/null
+++ b/src/main/java/org/apache/sling/fsprovider/internal/parser/ContentFileTypes.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.fsprovider.internal.parser;
+
+/**
+ * Content file types.
+ */
+public final class ContentFileTypes {
+    
+    /**
+     * JSON content files.
+     */
+    public static final String JSON_SUFFIX = ".json";
+
+    /**
+     * JCR XML content files.
+     */
+    public static final String JCR_XML_SUFFIX = ".jcr.xml";
+        
+    private ContentFileTypes() {
+        // static methods only
+    }
+    
+}
diff --git a/src/main/java/org/apache/sling/fsprovider/internal/parser/JcrXmlFileParser.java b/src/main/java/org/apache/sling/fsprovider/internal/parser/JcrXmlFileParser.java
new file mode 100644
index 0000000..6174bf9
--- /dev/null
+++ b/src/main/java/org/apache/sling/fsprovider/internal/parser/JcrXmlFileParser.java
@@ -0,0 +1,147 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.fsprovider.internal.parser;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Stack;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.apache.jackrabbit.util.ISO9075;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.helpers.DefaultHandler;
+
+/**
+ * Parses JCR XML files that contains content fragments.
+ */
+class JcrXmlFileParser {
+    
+    private static final Logger log = LoggerFactory.getLogger(JcrXmlFileParser.class);
+    
+    private static final SAXParserFactory SAX_PARSER_FACTORY;
+    static {
+        SAX_PARSER_FACTORY = SAXParserFactory.newInstance();
+        SAX_PARSER_FACTORY.setNamespaceAware(true);
+    }
+    
+    private JcrXmlFileParser() {
+        // static methods only
+    }
+    
+    /**
+     * Parse JSON file.
+     * @param file File
+     * @return Content
+     */
+    public static Map<String,Object> parse(File file) {
+        log.debug("Parse JCR XML content from {}", file.getPath());
+        try (FileInputStream fis = new FileInputStream(file)) {
+            XmlHandler xmlHandler = new XmlHandler();
+            SAXParser parser = SAX_PARSER_FACTORY.newSAXParser();
+            parser.parse(fis, xmlHandler);
+            if (xmlHandler.hasError()) {
+                throw xmlHandler.getError();
+            }
+            return xmlHandler.getContent();
+        }
+        catch (IOException | ParserConfigurationException | SAXException ex) {
+            log.warn("Error parsing JCR XML content from " + file.getPath(), ex);
+            return null;
+        }
+    }
+    
+    /**
+     * Decodes element or attribute names.
+     * @param qname qname
+     * @return Decoded name
+     */
+    static String decodeName(String qname) {
+        return ISO9075.decode(qname);
+    }
+    
+    /**
+     * Parses XML stream to Map.
+     */
+    static class XmlHandler extends DefaultHandler {
+        private final Map<String,Object> content = new LinkedHashMap<>();
+        private final Stack<Map<String,Object>> elements = new Stack<>();
+        private SAXParseException error;
+        
+        public Map<String,Object> getContent() {
+            return content;
+        }
+        
+        public boolean hasError() {
+            return error != null;
+        }
+        
+        public SAXParseException getError() {
+            return error;
+        }
+
+        @Override
+        public void startElement(String uri, String localName, String qName, Attributes attributes)
+                throws SAXException {
+            
+            // prepare map for element
+            Map<String,Object> element;
+            if (elements.isEmpty()) {
+                element = content;
+            }
+            else {
+                element = new HashMap<>();
+                elements.peek().put(decodeName(qName), element);
+            }
+            elements.push(element);
+            
+            // get attributes
+            for (int i=0; i<attributes.getLength(); i++) {
+                element.put(decodeName(attributes.getQName(i)), JcrXmlValueConverter.parseValue(attributes.getValue(i)));
+            }
+        }
+
+        @Override
+        public void endElement(String uri, String localName, String qName) throws SAXException {
+            elements.pop();
+        }
+
+        @Override
+        public void error(SAXParseException ex) throws SAXException {
+            this.error = ex;
+        }
+
+        @Override
+        public void fatalError(SAXParseException ex) throws SAXException {
+            this.error = ex;
+        }
+        
+    }
+    
+}
diff --git a/src/main/java/org/apache/sling/fsprovider/internal/parser/JcrXmlValueConverter.java b/src/main/java/org/apache/sling/fsprovider/internal/parser/JcrXmlValueConverter.java
new file mode 100644
index 0000000..8a0d0db
--- /dev/null
+++ b/src/main/java/org/apache/sling/fsprovider/internal/parser/JcrXmlValueConverter.java
@@ -0,0 +1,168 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.fsprovider.internal.parser;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.jackrabbit.util.ISO8601;
+
+/**
+ * Parses JCR XML files that contains content fragments.
+ */
+class JcrXmlValueConverter {
+    
+    private static final Pattern TYPE_PREFIX = Pattern.compile("^\\{([^\\{\\}]+)\\}(.+)$");
+    private static final Pattern VALUE_ARRAY = Pattern.compile("^\\[(.*)\\]$");
+    
+    private JcrXmlValueConverter() {
+        // static methods only
+    }
+    
+    /**
+     * Parse JSON value from XML Attribute.
+     * @param value XML attribute value
+     * @return Value object
+     */
+    public static Object parseValue(final String rawValue) {
+        String value = rawValue;
+        String[] valueArray = null;
+        
+        if (rawValue == null) {
+            return null;
+        }
+        
+        // detect type prefix
+        String typePrefix = null;
+        Matcher typePrefixMatcher = TYPE_PREFIX.matcher(value);
+        if (typePrefixMatcher.matches()) {
+            typePrefix = typePrefixMatcher.group(1);
+            value = typePrefixMatcher.group(2);
+        }
+        
+        // check for array
+        Matcher arrayMatcher = VALUE_ARRAY.matcher(value);
+        if (arrayMatcher.matches()) {
+            value = null;
+            valueArray = splitPreserveAllTokens(arrayMatcher.group(1), ',');
+        }
+
+        // convert values
+        if (valueArray != null) {
+            Object[] result = new Object[valueArray.length];
+            for (int i=0; i<valueArray.length; i++) {
+                result[i] = convertValue(valueArray[i], typePrefix, true);
+            }
+            return result;
+        }
+        else {
+            return convertValue(value, typePrefix, false);
+        }
+    }
+    
+    /**
+     * Split string preserving all tokens - but ignore separators that are escaped with \.
+     * @param str Combined string
+     * @param sep Separator
+     * @return Tokens
+     */
+    private static String[] splitPreserveAllTokens(String str, char sep) {
+        final int len = str.length();
+        if (len == 0) {
+            return ArrayUtils.EMPTY_STRING_ARRAY;
+        }
+        final List<String> list = new ArrayList<String>();
+        int i = 0, start = 0;
+        boolean match = false;
+        boolean lastMatch = false;
+        boolean escaped = false;
+        while (i < len) {
+            if (str.charAt(i) == '\\' && !escaped) {
+                escaped = true;
+            }
+            else {
+                if (str.charAt(i) == sep && !escaped) {
+                    lastMatch = true;
+                    list.add(str.substring(start, i));
+                    match = false;
+                    start = ++i;
+                    continue;
+                }
+                lastMatch = false;
+                match = true;
+                escaped = false;
+            }
+            i++;
+        }
+        if (match || lastMatch) {
+            list.add(str.substring(start, i));
+        }
+        return list.toArray(new String[list.size()]);        
+    }
+    
+    /**
+     * Parse value depending on type prefix.
+     * @param value Value
+     * @param typePrefix Type prefix
+     * @param inArray Value is in array
+     * @return Value object
+     */
+    private static Object convertValue(final String value, final String typePrefix, final boolean inArray) {
+        if (typePrefix == null || StringUtils.equals(typePrefix, "Name")) {
+            return deescapeStringValue(value, inArray);
+        }
+        else if (StringUtils.equals(typePrefix, "Boolean")) {
+            return Boolean.valueOf(value);
+        }
+        else if (StringUtils.equals(typePrefix, "Long")) {
+            return Long.valueOf(value);
+        }
+        else if (StringUtils.equals(typePrefix, "Decimal")) {
+            return Double.valueOf(value);
+        }
+        else if (StringUtils.equals(typePrefix, "Date")) {
+            return ISO8601.parse(value);
+        }
+        else {
+            throw new IllegalArgumentException("Unexpected type prefix: " + typePrefix);
+        }
+    }
+    
+    /**
+     * De-escape string value.
+     * @param value Escaped string value
+     * @param inArray In array
+     * @return De-escaped string value
+     */
+    private static String deescapeStringValue(final String value, final boolean inArray) {
+        String descapedValue = value;
+        if (inArray) {
+          descapedValue = StringUtils.replace(descapedValue, "\\,", ",");
+        }
+        else if (StringUtils.startsWith(descapedValue, "\\{") || StringUtils.startsWith(descapedValue, "\\[")) {
+            descapedValue = descapedValue.substring(1);
+        }
+        return StringUtils.replace(descapedValue, "\\\\", "\\");
+    }
+        
+}
diff --git a/src/main/java/org/apache/sling/fsprovider/internal/parser/JsonFileParser.java b/src/main/java/org/apache/sling/fsprovider/internal/parser/JsonFileParser.java
new file mode 100644
index 0000000..8070e0d
--- /dev/null
+++ b/src/main/java/org/apache/sling/fsprovider/internal/parser/JsonFileParser.java
@@ -0,0 +1,125 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.fsprovider.internal.parser;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import javax.json.Json;
+import javax.json.JsonArray;
+import javax.json.JsonNumber;
+import javax.json.JsonObject;
+import javax.json.JsonReader;
+import javax.json.JsonReaderFactory;
+import javax.json.JsonString;
+import javax.json.JsonValue;
+import javax.json.stream.JsonParsingException;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Parses JSON files that contains content fragments.
+ */
+class JsonFileParser {
+    
+    private static final Logger log = LoggerFactory.getLogger(JsonFileParser.class);
+    
+    private static final JsonReaderFactory JSON_READER_FACTORY;
+    static {
+        // allow comments in JSON files
+        Map<String,Object> jsonReaderFactoryConfig = new HashMap<>();
+        jsonReaderFactoryConfig.put("org.apache.johnzon.supports-comments", true);
+        // workaround for JsonProvider classloader issue until https://issues.apache.org/jira/browse/GERONIMO-6560 is fixed
+        ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
+        try {
+            Thread.currentThread().setContextClassLoader(JsonFileParser.class.getClassLoader());
+            JSON_READER_FACTORY = Json.createReaderFactory(jsonReaderFactoryConfig);
+        }
+        finally {
+            Thread.currentThread().setContextClassLoader(oldClassLoader);
+        }
+    }
+    
+    private JsonFileParser() {
+        // static methods only
+    }
+    
+    /**
+     * Parse JSON file.
+     * @param file File
+     * @return Content
+     */
+    public static Map<String,Object> parse(File file) {
+        log.debug("Parse JSON content from {}", file.getPath());
+        try (FileInputStream fis = new FileInputStream(file);
+                JsonReader reader = JSON_READER_FACTORY.createReader(fis)) {
+            return toMap(reader.readObject());
+        }
+        catch (IOException | JsonParsingException ex) {
+            log.warn("Error parsing JSON content from " + file.getPath(), ex);
+            return null;
+        }
+    }
+    
+    private static Map<String,Object> toMap(JsonObject object) {
+        Map<String,Object> map = new LinkedHashMap<>();
+        for (Map.Entry<String, JsonValue> entry : object.entrySet()) {
+            map.put(entry.getKey(), convertValue(entry.getValue()));
+        }
+        return map;
+    }
+    
+    private static Object convertValue(JsonValue value) {
+        switch (value.getValueType()) {
+            case STRING:
+                return ((JsonString)value).getString();
+            case NUMBER:
+                JsonNumber numberValue = (JsonNumber)value;
+                if (numberValue.isIntegral()) {
+                    return numberValue.longValue();
+                }
+                else {
+                    return numberValue.doubleValue();
+                }
+            case TRUE:
+                return true;
+            case FALSE:
+                return false;
+            case NULL:
+                return null;
+            case ARRAY:
+                JsonArray arrayValue = (JsonArray)value;
+                Object[] values = new Object[arrayValue.size()];
+                for (int i=0; i<values.length; i++) {
+                    values[i] = convertValue(arrayValue.get(i));
+                }
+                return values;
+            case OBJECT:
+                return toMap((JsonObject)value);
+            default:
+                throw new IllegalArgumentException("Unexpected JSON value type: " + value.getValueType());
+        }
+    }
+    
+}
diff --git a/src/main/resources/OSGI-INF/metatype/metatype.properties b/src/main/resources/OSGI-INF/metatype/metatype.properties
deleted file mode 100644
index 03f9ecf..0000000
--- a/src/main/resources/OSGI-INF/metatype/metatype.properties
+++ /dev/null
@@ -1,45 +0,0 @@
-#
-#  Licensed to the Apache Software Foundation (ASF) under one
-#  or more contributor license agreements.  See the NOTICE file
-#  distributed with this work for additional information
-#  regarding copyright ownership.  The ASF licenses this file
-#  to you under the Apache License, Version 2.0 (the
-#  "License"); you may not use this file except in compliance
-#  with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing,
-#  software distributed under the License is distributed on an
-#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-#  specific language governing permissions and limitations
-#  under the License.
-#
-
-
-#
-# This file contains localization strings for configuration labels and
-# descriptions as used in the metatype.xml descriptor generated by the
-# the SCR plugin
-
-#
-# Localizations for FsResourceProvider configuration
-resource.resolver.name = Apache Sling Filesystem Resource Provider
-resource.resolver.description = Configure an instance of the filesystem \
- resource provider in terms of provider root and filesystem location
-
-provider.roots.name = Provider Root
-provider.roots.description = Location in the virtual resource tree where the \
- filesystem resources are mapped in. This property must not be an empty string.
-provider.file.name = Filesystem Root
-provider.file.description = Filesystem directory mapped to the virtual \
- resource tree. This property must not be an empty string. If the path is \
- relative it is resolved against sling.home or the current working directory. \
- The path may be a file or folder. If the path does not address an existing \
- file or folder, an empty folder is created.
-
-provider.checkinterval.name = Check Interval
-provider.checkinterval.description = If the interval has a value higher than 100, the provider will \
- check the file system for changes periodically. This interval defines the period in milliseconds \
- (the default is 1000). If a change is detected, resource events are sent through the event admin.
\ No newline at end of file
diff --git a/src/test/java/org/apache/sling/fsprovider/internal/FileMonitorTest.java b/src/test/java/org/apache/sling/fsprovider/internal/FileMonitorTest.java
new file mode 100644
index 0000000..5341ced
--- /dev/null
+++ b/src/test/java/org/apache/sling/fsprovider/internal/FileMonitorTest.java
@@ -0,0 +1,238 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.fsprovider.internal;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.nio.file.Files;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.sling.api.SlingConstants;
+import org.apache.sling.fsprovider.internal.FileMonitor.ResourceChange;
+import org.apache.sling.testing.mock.sling.ResourceResolverType;
+import org.apache.sling.testing.mock.sling.junit.SlingContext;
+import org.apache.sling.testing.mock.sling.junit.SlingContextBuilder;
+import org.apache.sling.testing.mock.sling.junit.SlingContextCallback;
+import org.junit.Rule;
+import org.junit.Test;
+import org.osgi.service.event.Event;
+import org.osgi.service.event.EventConstants;
+import org.osgi.service.event.EventHandler;
+
+/**
+ * Test events when changing filesystem content.
+ */
+public class FileMonitorTest {
+
+    private final File tempDir;
+    private final EventAdminListener eventListener = new EventAdminListener();
+    
+    public FileMonitorTest() throws Exception {
+        tempDir = Files.createTempDirectory(getClass().getName()).toFile();
+    }
+
+    @Rule
+    public SlingContext context = new SlingContextBuilder(ResourceResolverType.JCR_MOCK)
+        .beforeSetUp(new SlingContextCallback() {
+            @Override
+            public void execute(SlingContext context) throws Exception {
+                // copy test content to temp. directory
+                tempDir.mkdirs();
+                File sourceDir = new File("src/test/resources/fs-test");
+                FileUtils.copyDirectory(sourceDir, tempDir);
+                
+                // mount temp. directory
+                context.registerInjectActivateService(new FsResourceProvider(),
+                        "provider.file", tempDir.getPath(),
+                        "provider.roots", "/fs-test",
+                        "provider.checkinterval", 120,
+                        "provider.json.content", true);
+                
+                // register resource change listener
+                context.registerService(EventHandler.class, eventListener,
+                        EventConstants.EVENT_TOPIC, new String[] {
+                                SlingConstants.TOPIC_RESOURCE_ADDED, 
+                                SlingConstants.TOPIC_RESOURCE_CHANGED,
+                                SlingConstants.TOPIC_RESOURCE_REMOVED
+                        });
+            }
+        })
+        .afterTearDown(new SlingContextCallback() {
+            @Override
+            public void execute(SlingContext context) throws Exception {
+                // remove temp directory
+                tempDir.delete();
+            }
+        })
+        .build();
+
+    @Test
+    public void testUpdateFile() throws Exception {
+        List<ResourceChange> changes = eventListener.getChanges();
+        assertTrue(changes.isEmpty());
+        
+        File file1a = new File(tempDir, "folder1/file1a.txt");
+        FileUtils.touch(file1a);
+        
+        Thread.sleep(250);
+
+        assertEquals(1, changes.size());
+        assertChange(changes, "/fs-test/folder1/file1a.txt", SlingConstants.TOPIC_RESOURCE_CHANGED);
+    }
+    
+    @Test
+    public void testAddFile() throws Exception {
+        List<ResourceChange> changes = eventListener.getChanges();
+        assertTrue(changes.isEmpty());
+        
+        File file1c = new File(tempDir, "folder1/file1c.txt");
+        FileUtils.write(file1c, "newcontent");
+        
+        Thread.sleep(250);
+
+        assertEquals(2, changes.size());
+        assertChange(changes, "/fs-test/folder1", SlingConstants.TOPIC_RESOURCE_CHANGED);
+        assertChange(changes, "/fs-test/folder1/file1c.txt", SlingConstants.TOPIC_RESOURCE_ADDED);
+    }
+    
+    @Test
+    public void testRemoveFile() throws Exception {
+        List<ResourceChange> changes = eventListener.getChanges();
+        assertTrue(changes.isEmpty());
+        
+        File file1a = new File(tempDir, "folder1/file1a.txt");
+        file1a.delete();
+        
+        Thread.sleep(250);
+
+        assertEquals(2, changes.size());
+        assertChange(changes, "/fs-test/folder1", SlingConstants.TOPIC_RESOURCE_CHANGED);
+        assertChange(changes, "/fs-test/folder1/file1a.txt", SlingConstants.TOPIC_RESOURCE_REMOVED);
+    }
+    
+    @Test
+    public void testAddFolder() throws Exception {
+        List<ResourceChange> changes = eventListener.getChanges();
+        assertTrue(changes.isEmpty());
+        
+        File folder99 = new File(tempDir, "folder99");
+        folder99.mkdir();
+        
+        Thread.sleep(250);
+
+        assertEquals(2, changes.size());
+        assertChange(changes, "/fs-test", SlingConstants.TOPIC_RESOURCE_CHANGED);
+        assertChange(changes, "/fs-test/folder99", SlingConstants.TOPIC_RESOURCE_ADDED);
+    }
+    
+    @Test
+    public void testRemoveFolder() throws Exception {
+        List<ResourceChange> changes = eventListener.getChanges();
+        assertTrue(changes.isEmpty());
+        
+        File folder1 = new File(tempDir, "folder1");
+        FileUtils.deleteDirectory(folder1);
+        
+        Thread.sleep(250);
+
+        assertEquals(2, changes.size());
+        assertChange(changes, "/fs-test", SlingConstants.TOPIC_RESOURCE_CHANGED);
+        assertChange(changes, "/fs-test/folder1", SlingConstants.TOPIC_RESOURCE_REMOVED);
+    }
+
+    @Test
+    public void testUpdateJsonContent() throws Exception {
+        List<ResourceChange> changes = eventListener.getChanges();
+        assertTrue(changes.isEmpty());
+        
+        File file1a = new File(tempDir, "folder2/content.json");
+        FileUtils.touch(file1a);
+        
+        Thread.sleep(250);
+
+        assertTrue(changes.size() > 1);
+        assertChange(changes, "/fs-test/folder2/content", SlingConstants.TOPIC_RESOURCE_REMOVED);
+        assertChange(changes, "/fs-test/folder2/content", SlingConstants.TOPIC_RESOURCE_ADDED);
+        assertChange(changes, "/fs-test/folder2/content/jcr:content", SlingConstants.TOPIC_RESOURCE_ADDED);
+    }
+    
+    @Test
+    public void testAddJsonContent() throws Exception {
+        List<ResourceChange> changes = eventListener.getChanges();
+        assertTrue(changes.isEmpty());
+        
+        File file1c = new File(tempDir, "folder1/file1c.json");
+        FileUtils.write(file1c, "{\"prop1\":\"value1\",\"child1\":{\"prop2\":\"value1\"}}");
+        
+        Thread.sleep(250);
+
+        assertEquals(3, changes.size());
+        assertChange(changes, "/fs-test/folder1", SlingConstants.TOPIC_RESOURCE_CHANGED);
+        assertChange(changes, "/fs-test/folder1/file1c", SlingConstants.TOPIC_RESOURCE_ADDED);
+        assertChange(changes, "/fs-test/folder1/file1c/child1", SlingConstants.TOPIC_RESOURCE_ADDED);
+    }
+    
+    @Test
+    public void testRemoveJsonContent() throws Exception {
+        List<ResourceChange> changes = eventListener.getChanges();
+        assertTrue(changes.isEmpty());
+        
+        File file1a = new File(tempDir, "folder2/content.json");
+        file1a.delete();
+        
+        Thread.sleep(250);
+
+        assertEquals(2, changes.size());
+        assertChange(changes, "/fs-test/folder2", SlingConstants.TOPIC_RESOURCE_CHANGED);
+        assertChange(changes, "/fs-test/folder2/content", SlingConstants.TOPIC_RESOURCE_REMOVED);
+    }
+    
+    
+    private void assertChange(List<ResourceChange> changes, String path, String topic) {
+        boolean found = false;
+        for (ResourceChange change : changes) {
+            if (StringUtils.equals(change.path, path) && StringUtils.equals(change.topic,  topic)) {
+                found = true;
+                break;
+            }
+        }
+        assertTrue("Change with path=" + path + ", topic=" + topic, found);
+    }
+    
+    static class EventAdminListener implements EventHandler {
+        private final List<ResourceChange> allChanges = new ArrayList<>();
+        public List<ResourceChange> getChanges() {
+            return allChanges;
+        }
+        @Override
+        public void handleEvent(Event event) {
+            ResourceChange change = new ResourceChange();
+            change.path = (String)event.getProperty(SlingConstants.PROPERTY_PATH);
+            change.resourceType = (String)event.getProperty(SlingConstants.PROPERTY_RESOURCE_TYPE);
+            change.topic = event.getTopic();
+            allChanges.add(change);
+        }
+    }
+
+}
diff --git a/src/test/java/org/apache/sling/fsprovider/internal/FilesFolderTest.java b/src/test/java/org/apache/sling/fsprovider/internal/FilesFolderTest.java
new file mode 100644
index 0000000..1930a94
--- /dev/null
+++ b/src/test/java/org/apache/sling/fsprovider/internal/FilesFolderTest.java
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.fsprovider.internal;
+
+import static org.apache.sling.fsprovider.internal.TestUtils.assertFile;
+import static org.apache.sling.fsprovider.internal.TestUtils.assertFolder;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThat;
+
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.fsprovider.internal.TestUtils.RegisterFsResourcePlugin;
+import org.apache.sling.hamcrest.ResourceMatchers;
+import org.apache.sling.testing.mock.sling.ResourceResolverType;
+import org.apache.sling.testing.mock.sling.junit.SlingContext;
+import org.apache.sling.testing.mock.sling.junit.SlingContextBuilder;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+/**
+ * Test access to files and folders from filesystem.
+ */
+public class FilesFolderTest {
+
+    private Resource root;
+    private Resource fsroot;
+
+    @Rule
+    public SlingContext context = new SlingContextBuilder(ResourceResolverType.JCR_MOCK)
+        .plugin(new RegisterFsResourcePlugin())
+        .build();
+
+    @Before
+    public void setUp() {
+        root = context.resourceResolver().getResource("/");
+        fsroot = context.resourceResolver().getResource("/fs-test");
+    }
+
+    @Test
+    public void testFolders() {
+        assertFolder(fsroot, "folder1");
+        assertFolder(fsroot, "folder1/folder11");
+        assertFolder(fsroot, "folder2");
+        assertFolder(fsroot, "folder3");
+    }
+
+    @Test
+    public void testFiles() {
+        assertFile(fsroot, "folder1/file1a.txt", "file1a");
+        assertFile(fsroot, "folder1/file1b.txt", "file1b");
+        assertFile(fsroot, "folder1/folder11/file11a.txt", "file11a");
+        assertFile(fsroot, "folder2/content.json", null);
+        assertFile(fsroot, "folder2/content/file2content.txt", "file2content");
+        assertFile(fsroot, "folder3/content.jcr.xml", null);
+    }
+
+    @Test
+    public void testListChildren() {
+        assertThat(root, ResourceMatchers.containsChildren("fs-test"));
+        assertThat(fsroot, ResourceMatchers.hasChildren("folder1", "folder2", "folder3"));
+        assertThat(fsroot.getChild("folder1"), ResourceMatchers.hasChildren("folder11", "file1a.txt", "file1b.txt"));
+        assertThat(fsroot.getChild("folder2"), ResourceMatchers.hasChildren("folder21", "content.json"));
+        assertFalse(fsroot.getChild("folder1/file1a.txt").listChildren().hasNext());
+    }
+
+}
diff --git a/src/test/java/org/apache/sling/fsprovider/internal/InvalidRootFolderTest.java b/src/test/java/org/apache/sling/fsprovider/internal/InvalidRootFolderTest.java
new file mode 100644
index 0000000..6d080b1
--- /dev/null
+++ b/src/test/java/org/apache/sling/fsprovider/internal/InvalidRootFolderTest.java
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.fsprovider.internal;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+
+import java.io.File;
+
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.fsprovider.internal.TestUtils.RegisterFsResourcePlugin;
+import org.apache.sling.testing.mock.sling.ResourceResolverType;
+import org.apache.sling.testing.mock.sling.junit.SlingContext;
+import org.apache.sling.testing.mock.sling.junit.SlingContextBuilder;
+import org.apache.sling.testing.mock.sling.junit.SlingContextCallback;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+/**
+ * Test with invalid fs folder.
+ */
+public class InvalidRootFolderTest {
+
+    private Resource fsroot;
+
+    @Rule
+    public SlingContext context = new SlingContextBuilder(ResourceResolverType.JCR_MOCK)
+        .plugin(new RegisterFsResourcePlugin("provider.file", "target/temp/invalid-folder"))
+        .afterTearDown(new SlingContextCallback() {
+            @Override
+            public void execute(SlingContext context) throws Exception {
+                File file = new File("target/temp/invalid-folder");
+                file.delete();
+            }
+        })
+        .build();
+
+    @Before
+    public void setUp() {
+        fsroot = context.resourceResolver().getResource("/fs-test");
+    }
+
+    @Test
+    public void testFolders() {
+        assertNull(fsroot.getChild("folder1"));
+    }
+
+    @Test
+    public void testFiles() {
+        assertNull(fsroot.getChild("folder1/file1a.txt"));
+    }
+
+    @Test
+    public void testListChildren() {
+        assertFalse(fsroot.listChildren().hasNext());
+    }
+
+}
diff --git a/src/test/java/org/apache/sling/fsprovider/internal/JcrMixedTest.java b/src/test/java/org/apache/sling/fsprovider/internal/JcrMixedTest.java
new file mode 100644
index 0000000..9a220d9
--- /dev/null
+++ b/src/test/java/org/apache/sling/fsprovider/internal/JcrMixedTest.java
@@ -0,0 +1,103 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.fsprovider.internal;
+
+import static org.apache.sling.fsprovider.internal.TestUtils.assertFile;
+import static org.hamcrest.Matchers.not;
+import static org.junit.Assert.assertThat;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.fsprovider.internal.TestUtils.RegisterFsResourcePlugin;
+import org.apache.sling.hamcrest.ResourceMatchers;
+import org.apache.sling.testing.mock.sling.ResourceResolverType;
+import org.apache.sling.testing.mock.sling.junit.SlingContext;
+import org.apache.sling.testing.mock.sling.junit.SlingContextBuilder;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+/**
+ * Test access mixed with JCR content on same path.
+ */
+public class JcrMixedTest {
+
+    private Resource root;
+    private Resource fsroot;
+
+    @Rule
+    public SlingContext context = new SlingContextBuilder(ResourceResolverType.JCR_MOCK)
+        .plugin(new RegisterFsResourcePlugin())
+        .build();
+
+    @Before
+    public void setUp() throws RepositoryException {
+        root = context.resourceResolver().getResource("/");
+        fsroot = context.resourceResolver().getResource("/fs-test");
+        
+        // prepare mixed JCR content
+        Node node = root.adaptTo(Node.class);
+        Node fstest = node.addNode("fs-test", "nt:folder");
+        // folder1
+        Node folder1 = fstest.addNode("folder1", "nt:folder");
+        folder1.setProperty("prop1", "value1");
+        folder1.setProperty("prop2", 123L);
+        // folder1/file1a.txt
+        Node file1a = folder1.addNode("file1a.txt", "nt:file");
+        file1a.setProperty("prop1", "value2");
+        file1a.setProperty("prop2", 234L);
+        // folder1/file1c.txt
+        folder1.addNode("file1c.txt", "nt:file");
+        // folder99
+        fstest.addNode("folder99", "nt:folder");
+    }
+
+    @Test
+    public void testFolders() {
+        // expected properties from JCR for folders
+        Resource folder1 = fsroot.getChild("folder1");
+        assertThat(folder1, ResourceMatchers.props("jcr:primaryType", "nt:folder",
+                "prop1", "value1",
+                "prop2", 123L));
+    }
+
+    @Test
+    public void testFiles() {
+        assertFile(fsroot, "folder1/file1a.txt", "file1a");
+        assertFile(fsroot, "folder1/file1b.txt", "file1b");
+        assertFile(fsroot, "folder1/folder11/file11a.txt", "file11a");
+        assertFile(fsroot, "folder2/content.json", null);
+
+        // do not expected properties from JCR for files
+        Resource file1a = fsroot.getChild("folder1/file1a.txt");
+        assertThat(file1a, not(ResourceMatchers.props(
+                "prop1", "value2",
+                "prop2", 234L)));
+    }
+
+    @Test
+    public void testListChildren() {
+        assertThat(root, ResourceMatchers.containsChildren("fs-test"));
+        assertThat(fsroot, ResourceMatchers.hasChildren("folder1", "folder2", "folder99"));
+        assertThat(fsroot.getChild("folder1"), ResourceMatchers.hasChildren("file1a.txt", "file1b.txt", "file1c.txt"));
+    }
+
+}
diff --git a/src/test/java/org/apache/sling/fsprovider/internal/JcrXmlContentTest.java b/src/test/java/org/apache/sling/fsprovider/internal/JcrXmlContentTest.java
new file mode 100644
index 0000000..3325ed4
--- /dev/null
+++ b/src/test/java/org/apache/sling/fsprovider/internal/JcrXmlContentTest.java
@@ -0,0 +1,168 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.fsprovider.internal;
+
+import static org.apache.sling.fsprovider.internal.TestUtils.assertFile;
+import static org.apache.sling.fsprovider.internal.TestUtils.assertFolder;
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertThat;
+
+import java.util.List;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceUtil;
+import org.apache.sling.api.resource.ValueMap;
+import org.apache.sling.fsprovider.internal.TestUtils.RegisterFsResourcePlugin;
+import org.apache.sling.hamcrest.ResourceMatchers;
+import org.apache.sling.testing.mock.sling.ResourceResolverType;
+import org.apache.sling.testing.mock.sling.junit.SlingContext;
+import org.apache.sling.testing.mock.sling.junit.SlingContextBuilder;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+
+import com.google.common.collect.ImmutableList;
+
+/**
+ * Test access to files and folders from filesystem.
+ */
+public class JcrXmlContentTest {
+
+    private Resource root;
+    private Resource fsroot;
+
+    @Rule
+    public SlingContext context = new SlingContextBuilder(ResourceResolverType.JCR_MOCK)
+        .plugin(new RegisterFsResourcePlugin("provider.jcrxml.content", true))
+        .build();
+
+    @Before
+    public void setUp() {
+        root = context.resourceResolver().getResource("/");
+        fsroot = context.resourceResolver().getResource("/fs-test");
+    }
+
+    @Test
+    public void testFolders() {
+        assertFolder(fsroot, "folder1");
+        assertFolder(fsroot, "folder1/folder11");
+        assertFolder(fsroot, "folder2");
+        assertFolder(fsroot, "folder3");
+    }
+
+    @Test
+    public void testFiles() {
+        assertFile(fsroot, "folder1/file1a.txt", "file1a");
+        assertFile(fsroot, "folder1/file1b.txt", "file1b");
+        assertFile(fsroot, "folder1/folder11/file11a.txt", "file11a");
+        assertFile(fsroot, "folder2/content.json", null);
+        assertNull(fsroot.getChild("folder3/content.jcr.xml"));
+    }
+
+    @Test
+    public void testListChildren() {
+        assertThat(root, ResourceMatchers.containsChildren("fs-test"));
+        assertThat(fsroot, ResourceMatchers.hasChildren("folder1", "folder2"));
+        assertThat(fsroot.getChild("folder1"), ResourceMatchers.hasChildren("folder11", "file1a.txt", "file1b.txt"));
+        assertThat(fsroot.getChild("folder2"), ResourceMatchers.hasChildren("folder21", "content"));
+    }
+
+    @Test
+    public void testJsonContent_Root() {
+        Resource underTest = fsroot.getChild("folder3/content");
+        assertNotNull(underTest);
+        assertEquals("app:Page", ResourceUtil.getValueMap(underTest).get("jcr:primaryType", String.class));
+        assertEquals("app:Page", underTest.getResourceType());
+        assertThat(underTest, ResourceMatchers.hasChildren("jcr:content"));
+    }
+
+    @Test
+    public void testJsonContent_Level1() {
+        Resource underTest = fsroot.getChild("folder3/content/jcr:content");
+        assertNotNull(underTest);
+        assertEquals("app:PageContent", ResourceUtil.getValueMap(underTest).get("jcr:primaryType", String.class));
+        assertEquals("samples/sample-app/components/content/page/homepage", underTest.getResourceType());
+        assertThat(underTest, ResourceMatchers.hasChildren("teaserbar", "aside", "content"));
+    }
+
+    @Test
+    public void testJsonContent_Level3() {
+        Resource underTest = fsroot.getChild("folder3/content/jcr:content/content/contentheadline");
+        assertNotNull(underTest);
+        assertEquals("nt:unstructured", ResourceUtil.getValueMap(underTest).get("jcr:primaryType", String.class));
+        assertEquals("samples/sample-app/components/content/common/contentHeadline", underTest.getResourceType());
+        assertFalse(underTest.listChildren().hasNext());
+    }
+
+    @Test
+    public void testJsonContent_Datatypes() {
+        Resource underTest = fsroot.getChild("folder3/content/jcr:content");
+        ValueMap props = ResourceUtil.getValueMap(underTest);
+        
+        assertEquals("en", props.get("jcr:title", String.class));
+        assertEquals(true, props.get("includeAside", false));
+        assertEquals((Long)1234567890123L, props.get("longProp", Long.class));
+        assertEquals((Double)1.2345d, props.get("decimalProp", Double.class), 0.00001d);
+        
+        assertArrayEquals(new String[] { "aa", "bb", "cc" }, props.get("stringPropMulti", String[].class));
+        assertArrayEquals(new Long[] { 1234567890123L, 55L }, props.get("longPropMulti", Long[].class));
+    }
+
+    @Test
+    public void testJsonContent_InvalidPath() {
+        Resource underTest = fsroot.getChild("folder2/content/jcr:content/xyz");
+        assertNull(underTest);
+    }
+
+    @Test
+    @Ignore  // jcr overlay is always active with the old sling resource provider API
+    public void testJcrMixedContent() throws RepositoryException {
+        // prepare mixed JCR content
+        Node node = root.adaptTo(Node.class);
+        Node fstest = node.addNode("fs-test", "nt:folder");
+        fstest.addNode("folder99", "nt:folder");
+
+        assertNull(fsroot.getChild("folder99"));
+    }
+
+    @Test
+    public void testFolder3ChildNodes() throws RepositoryException {
+        Resource folder3 = fsroot.getChild("folder3");
+        List<Resource> children = ImmutableList.copyOf(folder3.listChildren());
+        
+        assertEquals(2, children.size());
+        Resource child1 = children.get(0);
+        assertEquals("content", child1.getName());
+        assertEquals("app:Page", child1.getResourceType());
+        assertEquals("app:Page", ResourceUtil.getValueMap(child1).get("jcr:primaryType", String.class));
+
+        Resource child2 = children.get(1);
+        assertEquals("folder31", child2.getName());
+        assertEquals("nt:folder", ResourceUtil.getValueMap(child2).get("jcr:primaryType", String.class));
+    }
+
+}
diff --git a/src/test/java/org/apache/sling/fsprovider/internal/JsonContentTest.java b/src/test/java/org/apache/sling/fsprovider/internal/JsonContentTest.java
new file mode 100644
index 0000000..7aa29aa
--- /dev/null
+++ b/src/test/java/org/apache/sling/fsprovider/internal/JsonContentTest.java
@@ -0,0 +1,259 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.fsprovider.internal;
+
+import static org.apache.sling.fsprovider.internal.TestUtils.assertFile;
+import static org.apache.sling.fsprovider.internal.TestUtils.assertFolder;
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.PropertyIterator;
+import javax.jcr.PropertyType;
+import javax.jcr.RepositoryException;
+import javax.jcr.Value;
+import javax.jcr.nodetype.NodeType;
+
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.api.resource.ResourceUtil;
+import org.apache.sling.api.resource.ValueMap;
+import org.apache.sling.fsprovider.internal.TestUtils.RegisterFsResourcePlugin;
+import org.apache.sling.hamcrest.ResourceMatchers;
+import org.apache.sling.testing.mock.sling.ResourceResolverType;
+import org.apache.sling.testing.mock.sling.junit.SlingContext;
+import org.apache.sling.testing.mock.sling.junit.SlingContextBuilder;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Rule;
+import org.junit.Test;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * Test access to files and folders from filesystem.
+ */
+public class JsonContentTest {
+
+    private Resource root;
+    private Resource fsroot;
+
+    @Rule
+    public SlingContext context = new SlingContextBuilder(ResourceResolverType.JCR_MOCK)
+        .plugin(new RegisterFsResourcePlugin("provider.json.content", true))
+        .build();
+
+    @Before
+    public void setUp() {
+        root = context.resourceResolver().getResource("/");
+        fsroot = context.resourceResolver().getResource("/fs-test");
+    }
+
+    @Test
+    public void testFolders() {
+        assertFolder(fsroot, "folder1");
+        assertFolder(fsroot, "folder1/folder11");
+        assertFolder(fsroot, "folder2");
+    }
+
+    @Test
+    public void testFiles() {
+        assertFile(fsroot, "folder1/file1a.txt", "file1a");
+        assertFile(fsroot, "folder1/file1b.txt", "file1b");
+        assertFile(fsroot, "folder1/folder11/file11a.txt", "file11a");
+        assertNull(fsroot.getChild("folder2/content.json"));
+        assertFile(fsroot, "folder2/content/file2content.txt", "file2content");
+        assertFile(fsroot, "folder3/content.jcr.xml", null);
+    }
+
+    @Test
+    public void testListChildren() {
+        assertThat(root, ResourceMatchers.containsChildren("fs-test"));
+        assertThat(fsroot, ResourceMatchers.hasChildren("folder1", "folder2"));
+        assertThat(fsroot.getChild("folder1"), ResourceMatchers.hasChildren("folder11", "file1a.txt", "file1b.txt"));
+        assertThat(fsroot.getChild("folder2"), ResourceMatchers.hasChildren("folder21", "content"));
+    }
+
+    @Test
+    public void testJsonContent_Root() {
+        Resource underTest = fsroot.getChild("folder2/content");
+        assertNotNull(underTest);
+        assertEquals("app:Page", ResourceUtil.getValueMap(underTest).get("jcr:primaryType", String.class));
+        assertEquals("app:Page", underTest.getResourceType());
+        assertThat(underTest, ResourceMatchers.hasChildren("jcr:content"));
+    }
+
+    @Test
+    public void testJsonContent_Level1() {
+        Resource underTest = fsroot.getChild("folder2/content/jcr:content");
+        assertNotNull(underTest);
+        assertEquals("app:PageContent", ResourceUtil.getValueMap(underTest).get("jcr:primaryType", String.class));
+        assertEquals("sample/components/homepage", underTest.getResourceType());
+        assertEquals("sample/components/supertype", underTest.getResourceSuperType());
+        assertThat(underTest, ResourceMatchers.hasChildren("par", "header", "newslist", "lead", "image", "carousel", "rightpar"));
+    }
+
+    @Test
+    public void testJsonContent_Level5() {
+        Resource underTest = fsroot.getChild("folder2/content/jcr:content/par/image/file/jcr:content");
+        assertNotNull(underTest);
+        assertEquals("nt:resource", ResourceUtil.getValueMap(underTest).get("jcr:primaryType", String.class));
+        assertFalse(underTest.listChildren().hasNext());
+    }
+
+    @Test
+    public void testJsonContent_Datatypes() {
+        Resource underTest = fsroot.getChild("folder2/content/toolbar/profiles/jcr:content");
+        ValueMap props = ResourceUtil.getValueMap(underTest);
+        
+        assertEquals("Profiles", props.get("jcr:title", String.class));
+        assertEquals(true, props.get("booleanProp", false));
+        assertEquals((Long)1234567890123L, props.get("longProp", Long.class));
+        assertEquals((Double)1.2345d, props.get("decimalProp", Double.class), 0.00001d);
+        
+        assertArrayEquals(new String[] { "aa", "bb", "cc" }, props.get("stringPropMulti", String[].class));
+        assertArrayEquals(new Long[] { 1234567890123L, 55L }, props.get("longPropMulti", Long[].class));
+    }
+
+    @Test
+    public void testJsonContent_Datatypes_JCR() throws RepositoryException {
+        Resource underTest = fsroot.getChild("folder2/content/toolbar/profiles/jcr:content");
+        ValueMap props = ResourceUtil.getValueMap(underTest);
+        Node node = underTest.adaptTo(Node.class);
+        
+        assertEquals("/fs-test/folder2/content/toolbar/profiles/jcr:content", node.getPath());
+        assertEquals(6, node.getDepth());
+        
+        assertTrue(node.hasProperty("jcr:title"));
+        assertEquals(PropertyType.STRING, node.getProperty("jcr:title").getType());
+        assertFalse(node.getProperty("jcr:title").isMultiple());
+        assertEquals("jcr:title", node.getProperty("jcr:title").getDefinition().getName());
+        assertEquals("/fs-test/folder2/content/toolbar/profiles/jcr:content/jcr:title", node.getProperty("jcr:title").getPath());
+        assertEquals("Profiles", node.getProperty("jcr:title").getString());
+        assertEquals(PropertyType.BOOLEAN, node.getProperty("booleanProp").getType());
+        assertEquals(true, node.getProperty("booleanProp").getBoolean());
+        assertEquals(PropertyType.LONG, node.getProperty("longProp").getType());
+        assertEquals(1234567890123L, node.getProperty("longProp").getLong());
+        assertEquals(PropertyType.DOUBLE, node.getProperty("decimalProp").getType());
+        assertEquals(1.2345d, node.getProperty("decimalProp").getDouble(), 0.00001d);
+        
+        assertEquals(PropertyType.STRING, node.getProperty("stringPropMulti").getType());
+        assertTrue(node.getProperty("stringPropMulti").isMultiple());
+        Value[] stringPropMultiValues = node.getProperty("stringPropMulti").getValues();
+        assertEquals(3, stringPropMultiValues.length);
+        assertEquals("aa", stringPropMultiValues[0].getString());
+        assertEquals("bb", stringPropMultiValues[1].getString());
+        assertEquals("cc", stringPropMultiValues[2].getString());
+
+        assertEquals(PropertyType.LONG, node.getProperty("longPropMulti").getType());
+        assertTrue(node.getProperty("longPropMulti").isMultiple());
+        Value[] longPropMultiValues = node.getProperty("longPropMulti").getValues();
+        assertEquals(2, longPropMultiValues.length);
+        assertEquals(1234567890123L, longPropMultiValues[0].getLong());
+        assertEquals(55L, longPropMultiValues[1].getLong());
+        
+        // assert property iterator
+        Set<String> propertyNames = new HashSet<>();
+        PropertyIterator propertyIterator = node.getProperties();
+        while (propertyIterator.hasNext()) {
+            propertyNames.add(propertyIterator.nextProperty().getName());
+        }
+        assertTrue(props.keySet().containsAll(propertyNames));
+
+        // assert node iterator
+        Set<String> nodeNames = new HashSet<>();
+        NodeIterator nodeIterator = node.getNodes();
+        while (nodeIterator.hasNext()) {
+            nodeNames.add(nodeIterator.nextNode().getName());
+        }
+        assertEquals(ImmutableSet.of("par", "rightpar"), nodeNames);
+        
+        // node hierarchy
+        assertTrue(node.hasNode("rightpar"));
+        Node rightpar = node.getNode("rightpar");
+        assertEquals(7, rightpar.getDepth());
+        Node parent = rightpar.getParent();
+        assertTrue(node.isSame(parent));
+        Node ancestor = (Node)rightpar.getAncestor(5);
+        assertEquals(underTest.getParent().getPath(), ancestor.getPath());
+        Node root = (Node)rightpar.getAncestor(0);
+        assertEquals("/", root.getPath());
+        
+        // node types
+        assertTrue(node.isNodeType("app:PageContent"));
+        assertEquals("app:PageContent", node.getPrimaryNodeType().getName());
+        assertFalse(node.getPrimaryNodeType().isMixin());
+        NodeType[] mixinTypes = node.getMixinNodeTypes();
+        assertEquals(2, mixinTypes.length);
+        assertEquals("type1", mixinTypes[0].getName());
+        assertEquals("type2", mixinTypes[1].getName());
+        assertTrue(mixinTypes[0].isMixin());
+        assertTrue(mixinTypes[1].isMixin());
+    }
+
+    @Test
+    public void testFallbackNodeType() throws RepositoryException {
+        Resource underTest = fsroot.getChild("folder2/content/jcr:content/par/title_2");
+        assertEquals(NodeType.NT_UNSTRUCTURED, underTest.adaptTo(Node.class).getPrimaryNodeType().getName());
+    }
+    
+    @Test
+    public void testJsonContent_InvalidPath() {
+        Resource underTest = fsroot.getChild("folder2/content/jcr:content/xyz");
+        assertNull(underTest);
+    }
+
+    @Test
+    @Ignore  // jcr overlay is always active with the old sling resource provider API
+    public void testJcrMixedContent() throws RepositoryException {
+        // prepare mixed JCR content
+        Node node = root.adaptTo(Node.class);
+        Node fstest = node.addNode("fs-test", "nt:folder");
+        fstest.addNode("folder99", "nt:folder");
+
+        assertNull(fsroot.getChild("folder99"));
+    }
+
+    @Test
+    public void testFolder2ChildNodes() throws RepositoryException {
+        Resource folder2 = fsroot.getChild("folder2");
+        List<Resource> children = ImmutableList.copyOf(folder2.listChildren());
+        
+        assertEquals(2, children.size());
+        Resource child1 = children.get(0);
+        assertEquals("content", child1.getName());
+        assertEquals("app:Page", child1.getResourceType());
+        assertEquals("app:Page", ResourceUtil.getValueMap(child1).get("jcr:primaryType", String.class));
+
+        Resource child2 = children.get(1);
+        assertEquals("folder21", child2.getName());
+        assertEquals("nt:folder", ResourceUtil.getValueMap(child2).get("jcr:primaryType", String.class));
+    }
+
+}
diff --git a/src/test/java/org/apache/sling/fsprovider/internal/TestUtils.java b/src/test/java/org/apache/sling/fsprovider/internal/TestUtils.java
new file mode 100644
index 0000000..4d62076
--- /dev/null
+++ b/src/test/java/org/apache/sling/fsprovider/internal/TestUtils.java
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.fsprovider.internal;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang3.CharEncoding;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.sling.api.resource.Resource;
+import org.apache.sling.hamcrest.ResourceMatchers;
+import org.apache.sling.testing.mock.osgi.MapUtil;
+import org.apache.sling.testing.mock.osgi.context.AbstractContextPlugin;
+import org.apache.sling.testing.mock.sling.context.SlingContextImpl;
+
+class TestUtils {
+
+    public static class RegisterFsResourcePlugin extends AbstractContextPlugin<SlingContextImpl> {
+        private final Map<String,Object> props;
+        public RegisterFsResourcePlugin(Object... props) {
+            this.props = MapUtil.toMap(props); 
+        }
+        @Override
+        public void beforeSetUp(SlingContextImpl context) throws Exception {
+            Map<String,Object> config = new HashMap<>();
+            config.put("provider.file", "src/test/resources/fs-test");
+            config.put("provider.roots", "/fs-test");
+            config.put("provider.checkinterval", 0);
+            config.putAll(props);
+            context.registerInjectActivateService(new FsResourceProvider(), config);
+        }
+    };
+
+    public static void assertFolder(Resource resource, String path) {
+        Resource folder = resource.getChild(path);
+        assertNotNull(path, folder);
+        
+        assertThat(folder, ResourceMatchers.props("jcr:primaryType", "nt:folder"));
+        assertEquals("nt:folder", folder.getResourceType());
+        
+        assertNull(folder.getResourceSuperType());
+        assertEquals(folder.getName(), folder.adaptTo(File.class).getName());
+        assertTrue(StringUtils.contains(folder.adaptTo(URL.class).toString(), folder.getName()));
+    }
+
+    public static void assertFile(Resource resource, String path, String content) {
+        Resource file = resource.getChild(path);
+        assertNotNull(path, file);
+        
+        assertThat(file, ResourceMatchers.props("jcr:primaryType", "nt:file"));
+        assertEquals("nt:file", file.getResourceType());
+        
+        assertNull(file.getResourceSuperType());
+        assertEquals(file.getName(), file.adaptTo(File.class).getName());
+        assertTrue(StringUtils.contains(file.adaptTo(URL.class).toString(), file.getName()));
+        
+        if (content != null) {
+            try {
+                try (InputStream is = file.adaptTo(InputStream.class)) {
+                    String data = IOUtils.toString(is, CharEncoding.UTF_8);
+                    assertEquals(content, data);
+                }
+            }
+            catch (IOException ex) {
+                throw new RuntimeException(ex);
+            }
+        }
+    }    
+
+}
diff --git a/src/test/java/org/apache/sling/fsprovider/internal/mapper/ContentFileTest.java b/src/test/java/org/apache/sling/fsprovider/internal/mapper/ContentFileTest.java
new file mode 100644
index 0000000..4659991
--- /dev/null
+++ b/src/test/java/org/apache/sling/fsprovider/internal/mapper/ContentFileTest.java
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.fsprovider.internal.mapper;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.util.Map;
+
+import org.apache.sling.api.resource.ValueMap;
+import org.apache.sling.fsprovider.internal.parser.ContentFileCache;
+import org.junit.Test;
+
+public class ContentFileTest {
+    
+    private ContentFileCache contentFileCache = new ContentFileCache(0);
+
+    @SuppressWarnings("unchecked")
+    @Test
+    public void testRootContent() {
+        File file = new File("src/test/resources/fs-test/folder2/content.json");
+        
+        ContentFile underTest = new ContentFile(file, "/fs-test/folder2/content", null, contentFileCache);
+        assertEquals(file, underTest.getFile());
+        assertNull(underTest.getSubPath());
+        
+        assertTrue(underTest.hasContent());
+
+        Map<String,Object> content = (Map<String,Object>)underTest.getContent();
+        assertEquals("app:Page", content.get("jcr:primaryType"));
+        assertEquals("app:PageContent", ((Map<String,Object>)content.get("jcr:content")).get("jcr:primaryType"));
+
+        ValueMap props = underTest.getValueMap();
+        assertEquals("app:Page", props.get("jcr:primaryType"));
+        assertNull(props.get("jcr:content"));
+    }
+
+    @SuppressWarnings("unchecked")
+    @Test
+    public void testContentLevel1() {
+        File file = new File("src/test/resources/fs-test/folder2/content.json");
+        
+        ContentFile underTest = new ContentFile(file, "/fs-test/folder2/content", "jcr:content", contentFileCache);
+        assertEquals(file, underTest.getFile());
+        assertEquals("jcr:content", underTest.getSubPath());
+        
+        assertTrue(underTest.hasContent());
+
+        Map<String,Object> content = (Map<String,Object>)underTest.getContent();
+        assertEquals("app:PageContent", content.get("jcr:primaryType"));
+
+        ValueMap props = underTest.getValueMap();
+        assertEquals("app:PageContent", props.get("jcr:primaryType"));
+    }
+
+    @SuppressWarnings("unchecked")
+    @Test
+    public void testContentLevel5() {
+        File file = new File("src/test/resources/fs-test/folder2/content.json");
+        
+        ContentFile underTest = new ContentFile(file, "/fs-test/folder2/content", "jcr:content/par/image/file/jcr:content", contentFileCache);
+        assertEquals(file, underTest.getFile());
+        assertEquals("jcr:content/par/image/file/jcr:content", underTest.getSubPath());
+        
+        assertTrue(underTest.hasContent());
+
+        Map<String,Object> content = (Map<String,Object>)underTest.getContent();
+        assertEquals("nt:resource", content.get("jcr:primaryType"));
+
+        ValueMap props = underTest.getValueMap();
+        assertEquals("nt:resource", props.get("jcr:primaryType"));
+    }
+
+    @Test
+    public void testContentProperty() {
+        File file = new File("src/test/resources/fs-test/folder2/content.json");
+        
+        ContentFile underTest = new ContentFile(file, "/fs-test/folder2/content", "jcr:content/jcr:title", contentFileCache);
+        assertEquals(file, underTest.getFile());
+        assertEquals("jcr:content/jcr:title", underTest.getSubPath());
+        
+        assertTrue(underTest.hasContent());
+
+        assertEquals("English", underTest.getContent());
+
+        assertTrue(underTest.getValueMap().isEmpty());
+    }
+
+    @Test
+    public void testInvalidFile() {
+        File file = new File("src/test/resources/fs-test/folder1/file1a.txt");
+        ContentFile underTest = new ContentFile(file, "/fs-test/folder1/file1a", null, contentFileCache);
+        assertFalse(underTest.hasContent());
+    }
+
+}
diff --git a/src/test/java/org/apache/sling/fsprovider/internal/mapper/ValueMapUtilTest.java b/src/test/java/org/apache/sling/fsprovider/internal/mapper/ValueMapUtilTest.java
new file mode 100644
index 0000000..71d6a38
--- /dev/null
+++ b/src/test/java/org/apache/sling/fsprovider/internal/mapper/ValueMapUtilTest.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.fsprovider.internal.mapper;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.sling.api.resource.ValueMap;
+import org.junit.Test;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+
+public class ValueMapUtilTest {
+
+    @Test
+    public void testToValueMap() {
+        Map<String,Object> content = new HashMap<>();
+        content.put("stringProp", "abc");
+        content.put("intProp", 123);
+        content.put("childNode", ImmutableMap.<String,Object>of());
+        content.put("stringArray", new String[] { "a", "b", "c" });
+        content.put("stringList", ImmutableList.of("ab", "cd"));
+        content.put("intList", ImmutableList.of(12, 34));
+        
+        ValueMap props = ValueMapUtil.toValueMap(content);
+        assertEquals("abc", props.get("stringProp", String.class));
+        assertEquals((Integer)123, props.get("intProp", 0));
+        assertNull(props.get("childNode"));
+        assertArrayEquals(new String[] { "a", "b", "c" }, props.get("stringArray", String[].class));
+        assertArrayEquals(new String[] { "ab", "cd" }, props.get("stringList", String[].class));
+        assertArrayEquals(new Integer[] { 12, 34 }, props.get("intList", Integer[].class));
+    }
+
+}
diff --git a/src/test/java/org/apache/sling/fsprovider/internal/parser/ContentFileCacheTest.java b/src/test/java/org/apache/sling/fsprovider/internal/parser/ContentFileCacheTest.java
new file mode 100644
index 0000000..1eaf1e1
--- /dev/null
+++ b/src/test/java/org/apache/sling/fsprovider/internal/parser/ContentFileCacheTest.java
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.fsprovider.internal.parser;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+import java.io.File;
+import java.util.Map;
+
+import org.junit.experimental.theories.DataPoint;
+import org.junit.experimental.theories.Theories;
+import org.junit.experimental.theories.Theory;
+import org.junit.runner.RunWith;
+
+@RunWith(Theories.class)
+public class ContentFileCacheTest {
+    
+    @DataPoint
+    public static final int NO_CACHE = 0;
+    @DataPoint
+    public static final int SMALL_CACHE = 1;
+    @DataPoint
+    public static final int HUGE_CACHE = 1000;
+
+    @Theory
+    public void testCache(int cacheSize) {
+        ContentFileCache underTest = new ContentFileCache(cacheSize);
+        
+        Map<String,Object> content1 = underTest.get("/fs-test/folder2/content", new File("src/test/resources/fs-test/folder2/content.json"));
+        assertNotNull(content1);
+        
+        switch (cacheSize) {
+        case NO_CACHE:
+            assertEquals(0, underTest.size());
+            break;
+        case SMALL_CACHE:
+        case HUGE_CACHE:
+            assertEquals(1, underTest.size());
+            break;
+        }
+
+        Map<String,Object> content2 = underTest.get("/fs-test/folder1/file1a", new File("src/test/resources/fs-test/folder1/file1a.txt"));
+        assertNull(content2);
+
+        switch (cacheSize) {
+        case NO_CACHE:
+            assertEquals(0, underTest.size());
+            break;
+        case SMALL_CACHE:
+            assertEquals(1, underTest.size());
+            break;
+        case HUGE_CACHE:
+            assertEquals(2, underTest.size());
+            break;
+        }
+
+        underTest.remove("/fs-test/folder1/file1a");
+
+        switch (cacheSize) {
+        case NO_CACHE:
+        case SMALL_CACHE:
+            assertEquals(0, underTest.size());
+            break;
+        case HUGE_CACHE:
+            assertEquals(1, underTest.size());
+            break;
+        }
+        
+        underTest.clear();
+
+        assertEquals(0, underTest.size());        
+    }
+
+}
diff --git a/src/test/java/org/apache/sling/fsprovider/internal/parser/ContentFileParserTest.java b/src/test/java/org/apache/sling/fsprovider/internal/parser/ContentFileParserTest.java
new file mode 100644
index 0000000..290ea21
--- /dev/null
+++ b/src/test/java/org/apache/sling/fsprovider/internal/parser/ContentFileParserTest.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.fsprovider.internal.parser;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+import java.io.File;
+import java.util.Map;
+
+import org.junit.Test;
+
+public class ContentFileParserTest {
+
+    @SuppressWarnings("unchecked")
+    @Test
+    public void testParseJson() {
+        File file = new File("src/test/resources/fs-test/folder2/content.json");
+        Map<String,Object> content = ContentFileParser.parse(file);
+        assertNotNull(content);
+        assertEquals("app:Page", content.get("jcr:primaryType"));
+        assertEquals("app:PageContent", ((Map<String,Object>)content.get("jcr:content")).get("jcr:primaryType"));
+    }
+
+    @Test
+    public void testParseInvalidJson() {
+        File file = new File("src/test/resources/invalid-test/invalid.json");
+        Map<String,Object> content = ContentFileParser.parse(file);
+        assertNull(content);
+    }
+
+    @SuppressWarnings("unchecked")
+    @Test
+    public void testParseJcrXml() {
+        File file = new File("src/test/resources/fs-test/folder3/content.jcr.xml");
+        Map<String,Object> content = ContentFileParser.parse(file);
+        assertNotNull(content);
+        assertEquals("app:Page", content.get("jcr:primaryType"));
+        assertEquals("app:PageContent", ((Map<String,Object>)content.get("jcr:content")).get("jcr:primaryType"));
+    }
+
+    @Test
+    public void testParseInvalidJcrXml() {
+        File file = new File("src/test/resources/invalid-test/invalid.jcr.xml");
+        Map<String,Object> content = ContentFileParser.parse(file);
+        assertNull(content);
+    }
+
+}
diff --git a/src/test/java/org/apache/sling/fsprovider/internal/parser/JcrXmlFileParserTest.java b/src/test/java/org/apache/sling/fsprovider/internal/parser/JcrXmlFileParserTest.java
new file mode 100644
index 0000000..7cccbcf
--- /dev/null
+++ b/src/test/java/org/apache/sling/fsprovider/internal/parser/JcrXmlFileParserTest.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.fsprovider.internal.parser;
+
+import static org.junit.Assert.assertEquals;
+
+import org.apache.jackrabbit.util.ISO9075;
+import org.junit.Test;
+
+public class JcrXmlFileParserTest {
+
+    @Test
+    public void testDecodeName() {
+        assertEquals("jcr:title", JcrXmlFileParser.decodeName("jcr:" + ISO9075.encode("title")));
+        assertEquals("sling:123", JcrXmlFileParser.decodeName("sling:" + ISO9075.encode("123")));
+    }
+
+}
diff --git a/src/test/java/org/apache/sling/fsprovider/internal/parser/JcrXmlValueConverterTest.java b/src/test/java/org/apache/sling/fsprovider/internal/parser/JcrXmlValueConverterTest.java
new file mode 100644
index 0000000..15fe989
--- /dev/null
+++ b/src/test/java/org/apache/sling/fsprovider/internal/parser/JcrXmlValueConverterTest.java
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.fsprovider.internal.parser;
+
+import static org.apache.sling.fsprovider.internal.parser.JcrXmlValueConverter.parseValue;
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
+import java.util.Calendar;
+
+import org.junit.Test;
+
+public class JcrXmlValueConverterTest {
+
+    @Test
+    public void testNull() {
+        assertNull(parseValue(null));
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void testInvalid() {
+        parseValue("{InvalidType}xyz");
+    }
+
+    @Test
+    public void testString() {
+        assertEquals("myString", parseValue("myString"));
+        assertEquals("prop", "myString [ ] { } \\ ,", parseValue("myString [ ] { } \\\\ ,"));
+        assertEquals("{myString}", parseValue("\\{myString}"));
+        assertEquals("aaa{myString}", parseValue("aaa{myString}"));
+        assertEquals("[myString]", parseValue("\\[myString]"));
+        assertEquals("aaa[myString]", parseValue("aaa[myString]"));
+    }
+
+    @Test
+    public void testStringArray() {
+        assertArrayEquals(new Object[] { "myString1", "myString2" }, (Object[]) parseValue("[myString1,myString2]"));
+        assertArrayEquals(new Object[] { "myString1,[]\\äöü߀", "myString2", "myString3 [ ] { } \\ ,", "", "[myString5]", "{myString6}" },
+                (Object[]) parseValue("[myString1\\,[]\\\\äöü߀,myString2,myString3 [ ] { } \\\\ \\,,,[myString5],{myString6}]"));
+    }
+
+    @Test
+    public void testBoolean() {
+        assertEquals(true, parseValue("{Boolean}true"));
+        assertEquals(false, parseValue("{Boolean}false"));
+    }
+
+    @Test
+    public void testBooleanArray() {
+        assertArrayEquals(new Object[] { true, false }, (Object[]) parseValue("{Boolean}[true,false]"));
+    }
+
+    @Test
+    public void testLong() {
+        assertEquals(1L, parseValue("{Long}1"));
+        assertEquals(10000000000L, parseValue("{Long}10000000000"));
+    }
+
+    @Test
+    public void testLongArray() {
+        assertArrayEquals(new Object[] { 1L, 2L }, (Object[]) parseValue("{Long}[1,2]"));
+        assertArrayEquals(new Object[] { 10000000000L, 20000000000L }, (Object[]) parseValue("{Long}[10000000000,20000000000]"));
+    }
+
+    @Test
+    public void testDouble() {
+        assertEquals(1.234d, parseValue("{Decimal}1.234"));
+    }
+
+    @Test
+    public void testDoubleArray() {
+        assertArrayEquals(new Object[] { 1.234d, 2.345d }, (Object[]) parseValue("{Decimal}[1.234,2.345]"));
+    }
+
+    @Test
+    public void testCalendar() {
+        Calendar value = (Calendar)parseValue("{Date}2010-09-05T15:10:20.000Z");
+        assertEquals(2010, value.get(Calendar.YEAR));
+        assertEquals(8, value.get(Calendar.MONTH));
+        assertEquals(5, value.get(Calendar.DAY_OF_MONTH));
+    }
+
+    @Test
+    public void testStringArrayRepPrivileges() {
+        assertArrayEquals(new Object[] { "rep:write", "crx:replicate", "jcr:read" }, (Object[]) parseValue("{Name}[rep:write,crx:replicate,jcr:read]"));
+    }
+
+}
diff --git a/src/test/resources/fs-test/folder1/file1a.txt b/src/test/resources/fs-test/folder1/file1a.txt
new file mode 100644
index 0000000..9f0f26f
--- /dev/null
+++ b/src/test/resources/fs-test/folder1/file1a.txt
@@ -0,0 +1 @@
+file1a
\ No newline at end of file
diff --git a/src/test/resources/fs-test/folder1/file1b.txt b/src/test/resources/fs-test/folder1/file1b.txt
new file mode 100644
index 0000000..518f63d
--- /dev/null
+++ b/src/test/resources/fs-test/folder1/file1b.txt
@@ -0,0 +1 @@
+file1b
\ No newline at end of file
diff --git a/src/test/resources/fs-test/folder1/folder11/file11a.txt b/src/test/resources/fs-test/folder1/folder11/file11a.txt
new file mode 100644
index 0000000..4940b5d
--- /dev/null
+++ b/src/test/resources/fs-test/folder1/folder11/file11a.txt
@@ -0,0 +1 @@
+file11a
\ No newline at end of file
diff --git a/src/test/resources/fs-test/folder2/content.json b/src/test/resources/fs-test/folder2/content.json
new file mode 100644
index 0000000..b0fc78d
--- /dev/null
+++ b/src/test/resources/fs-test/folder2/content.json
@@ -0,0 +1,262 @@
+/* Comment example */
+{
+  "jcr:primaryType": "app:Page",
+  "jcr:createdBy": "admin",
+  "jcr:created": "Thu Aug 07 2014 16:32:59 GMT+0200",
+  /* Comment example */
+  "jcr:content": {
+    "jcr:primaryType": "app:PageContent",  /* Comment example */
+    "jcr:createdBy": "admin",
+    "jcr:title": "English",
+    "app:template": "sample/templates/homepage",
+    "jcr:created": "Thu Aug 07 2014 16:32:59 GMT+0200",
+    "app:lastModified": "Tue Apr 22 2014 15:11:24 GMT+0200",
+    "dateISO8601String": "2014-04-22T15:11:24.000+02:00",
+    "pageTitle": "Sample Homepage",
+    "sling:resourceType": "sample/components/homepage",
+    "sling:resourceSuperType": "sample/components/supertype",
+    "app:designPath": "/etc/designs/sample",
+    "app:lastModifiedBy": "admin",
+    "utf8Property": "äöü߀",
+    "par": {
+      "jcr:primaryType": "nt:unstructured",
+      "sling:resourceType": "foundation/components/parsys",
+      "colctrl": {
+        "jcr:primaryType": "nt:unstructured",
+        "jcr:createdBy": "admin",
+        "jcr:lastModifiedBy": "admin",
+        "layout": "2;colctrl-lt0",
+        "jcr:created": "Mon Aug 23 2010 22:02:24 GMT+0200",
+        "jcr:lastModified": "Mon Aug 23 2010 22:02:35 GMT+0200",
+        "sling:resourceType": "foundation/components/parsys/colctrl"
+      },
+      "image": {
+        "jcr:primaryType": "nt:unstructured",
+        "jcr:createdBy": "admin",
+        "fileReference": "/content/dam/sample/portraits/jane_doe.jpg",
+        "jcr:lastModifiedBy": "admin",
+        "jcr:created": "Mon Aug 23 2010 22:03:39 GMT+0200",
+        "width": "340",
+        "jcr:lastModified": "Sun Oct 31 2010 21:39:50 GMT+0100",
+        "sling:resourceType": "foundation/components/image",
+        "file": {
+          "jcr:primaryType": "nt:file",
+          "jcr:createdBy": "admin",
+          "jcr:created": "Thu Aug 07 2014 16:32:59 GMT+0200",
+          "jcr:content": {
+            "jcr:primaryType": "nt:resource",
+            "jcr:lastModifiedBy": "anonymous",
+            "jcr:mimeType": "image/jpeg",
+            "jcr:lastModified": "Thu Aug 07 2014 16:32:59 GMT+0200",
+            ":jcr:data": 24377,
+            "jcr:uuid": "eda76d00-b2cd-4b59-878f-c33f71ceaddc"
+          }
+        }
+      },
+      "title_1": {
+        "jcr:primaryType": "nt:unstructured",
+        "jcr:createdBy": "admin",
+        "jcr:title": "Strategic Consulting",
+        "jcr:lastModifiedBy": "admin",
+        "jcr:created": "Mon Aug 23 2010 22:12:08 GMT+0200",
+        "jcr:lastModified": "Wed Oct 27 2010 21:33:24 GMT+0200",
+        "sling:resourceType": "sample/components/title"
+      },
+      "text_1": {
+        "jcr:primaryType": "nt:unstructured",
+        "jcr:createdBy": "admin",
+        "jcr:lastModifiedBy": "admin",
+        "jcr:created": "Sun Oct 31 2010 21:48:04 GMT+0100",
+        "text": "<p><span class=\"Apple-style-span\" style=\"font-size: 12px;\">In&nbsp;today's competitive market, organizations can face several key geometric challenges:<\/span><\/p>\n<ul>\n<li><span class=\"Apple-style-span\" style=\"font-size: 12px;\">Polyhedral Sectioning<\/span><\/li>\n<li><span class=\"Apple-style-span\" style=\"font-size: 12px;\">Triangulation&nbsp;<\/span><\/li>\n<li><span class=\"Apple-style-span\" style=\"font-size: 12px;\">Trigonometric Calculation<\/span><\ [...]
+        "jcr:lastModified": "Sun Oct 31 2010 21:49:06 GMT+0100",
+        "sling:resourceType": "foundation/components/text",
+        "textIsRich": "true"
+      },
+      "col_break12825937554040": {
+        "jcr:primaryType": "nt:unstructured",
+        "controlType": "break",
+        "sling:resourceType": "foundation/components/parsys/colctrl"
+      },
+      "image_0": {
+        "jcr:primaryType": "nt:unstructured",
+        "jcr:createdBy": "admin",
+        "fileReference": "/content/dam/sample/offices/clean_room.jpg",
+        "height": "226",
+        "jcr:lastModifiedBy": "admin",
+        "jcr:created": "Mon Aug 23 2010 22:04:46 GMT+0200",
+        "jcr:lastModified": "Fri Nov 05 2010 10:38:15 GMT+0100",
+        "sling:resourceType": "foundation/components/image",
+        "imageRotate": "0",
+        "file": {
+          "jcr:primaryType": "nt:file",
+          "jcr:createdBy": "admin",
+          "jcr:created": "Thu Aug 07 2014 16:32:59 GMT+0200",
+          "jcr:content": {
+            "jcr:primaryType": "nt:resource",
+            "jcr:lastModifiedBy": "anonymous",
+            "jcr:mimeType": "image/jpeg",
+            "jcr:lastModified": "Thu Aug 07 2014 16:32:59 GMT+0200",
+            ":jcr:data": 21142,
+            "jcr:uuid": "6139077f-191f-4337-aaef-55456ebe6784"
+          }
+        }
+      },
+      "title_2": {
+        "jcr:createdBy": "admin",
+        "jcr:title": "Shape Technology",
+        "jcr:lastModifiedBy": "admin",
+        "jcr:created": "Mon Aug 23 2010 22:12:13 GMT+0200",
+        "jcr:lastModified": "Tue Oct 26 2010 21:16:29 GMT+0200",
+        "sling:resourceType": "sample/components/title"
+      },
+      "text_0": {
+        "jcr:primaryType": "nt:unstructured",
+        "jcr:createdBy": "admin",
+        "jcr:lastModifiedBy": "admin",
+        "jcr:created": "Mon Aug 23 2010 22:16:30 GMT+0200",
+        "text": "<p>The Sample investment in R&amp;D has done more than solidify our industry leadership role, we have now outpaced our competitors to such an extent that we are in an altogether new space.<\/p>\n<p>This is why our high quality polygons and polyhedra provide the only turnkey solutions across the whole range of euclidean geometry. And our mathematicians are working on the next generation of fractal curves to bring you shapes that are unthinkable today.<\/p>\n<p><\/p>\n<p>< [...]
+        "jcr:lastModified": "Mon Nov 08 2010 20:39:00 GMT+0100",
+        "sling:resourceType": "foundation/components/text",
+        "textIsRich": "true"
+      },
+      "col_end12825937444810": {
+        "jcr:primaryType": "nt:unstructured",
+        "controlType": "end",
+        "sling:resourceType": "foundation/components/parsys/colctrl"
+      }
+    },
+    "header": {
+      "jcr:primaryType": "nt:unstructured",
+      "jcr:title": "trust our experience\r\nto manage your business",
+      "imageReference": "/content/dam/sample/header.png",
+      "text": "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nunc eget neque. Nunc condimentum ipsum et orci. Aenean est. Cras eget diam. read more",
+      "sling:resourceType": "sample/components/header"
+    },
+    "newslist": {
+      "jcr:primaryType": "nt:unstructured",
+      "headline": "trust our experience\nto manage your business",
+      "text": "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nunc eget neque. Nunc condimentum ipsum et orci. Aenean est. Cras eget diam. read more",
+      "sling:resourceType": "sample/components/listchildren",
+      "listroot": "/content/sample/en/about/news"
+    },
+    "lead": {
+      "jcr:primaryType": "nt:unstructured",
+      "jcr:title": "World Leader in Applied Geometry ",
+      "jcr:lastModifiedBy": "admin",
+      "text": "Lead Text",
+      "title": "Lead Title",
+      "jcr:description": "Sample has been selling and servicing shapes for over 2000 years. From our beginnings as a small vendor of squares and rectangles we have grown our business into a leading global provider of platonic solids and fractals. Join us as we lead geometry into the future.",
+      "jcr:lastModified": "Wed Jan 19 2011 14:35:29 GMT+0100",
+      "sling:resourceType": "sample/components/lead",
+      "app:annotations": {"jcr:primaryType": "nt:unstructured"}
+    },
+    "image": {
+      "jcr:primaryType": "nt:unstructured",
+      "jcr:lastModifiedBy": "admin",
+      "jcr:lastModified": "Wed Oct 27 2010 21:30:59 GMT+0200",
+      "imageRotate": "0"
+    },
+    "carousel": {
+      "jcr:primaryType": "nt:unstructured",
+      "playSpeed": "6000",
+      "jcr:lastModifiedBy": "admin",
+      "pages": [
+        "/content/sample/en/events/techsummit",
+        "/content/sample/en/events/userconf",
+        "/content/sample/en/events/shapecon",
+        "/content/sample/en/events/dsc"
+      ],
+      "jcr:lastModified": "Tue Oct 05 2010 14:14:27 GMT+0200",
+      "transTime": "1000",
+      "sling:resourceType": "foundation/components/carousel",
+      "listFrom": "static"
+    },
+    "rightpar": {
+      "jcr:primaryType": "nt:unstructured",
+      "sling:resourceType": "foundation/components/parsys",
+      "teaser": {
+        "jcr:primaryType": "nt:unstructured",
+        "jcr:createdBy": "admin",
+        "jcr:lastModifiedBy": "admin",
+        "jcr:created": "Tue Jan 25 2011 11:30:09 GMT+0100",
+        "campaignpath": "/content/campaigns/sample",
+        "jcr:lastModified": "Wed Feb 02 2011 08:40:30 GMT+0100",
+        "sling:resourceType": "personalization/components/teaser"
+      }
+    }
+  },
+  "toolbar": {
+    "jcr:primaryType": "app:Page",
+    "jcr:createdBy": "admin",
+    "jcr:created": "Thu Aug 07 2014 16:33:00 GMT+0200",
+    "jcr:content": {
+      "jcr:primaryType": "app:PageContent",
+      "subtitle": "Contains the toolbar",
+      "jcr:createdBy": "admin",
+      "jcr:title": "Toolbar",
+      "app:template": "sample/templates/contentpage",
+      "jcr:created": "Thu Aug 07 2014 16:33:00 GMT+0200",
+      "app:lastModified": "Wed Aug 25 2010 22:51:02 GMT+0200",
+      "hideInNav": "true",
+      "sling:resourceType": "sample/components/contentpage",
+      "app:lastModifiedBy": "admin",
+      "par": {
+        "jcr:primaryType": "nt:unstructured",
+        "sling:resourceType": "foundation/components/parsys"
+      },
+      "rightpar": {
+        "jcr:primaryType": "nt:unstructured",
+        "sling:resourceType": "foundation/components/iparsys",
+        "iparsys_fake_par": {
+          "jcr:primaryType": "nt:unstructured",
+          "sling:resourceType": "foundation/components/iparsys/par"
+        }
+      }
+    },
+    "profiles": {
+      "jcr:primaryType": "app:Page",
+      "jcr:createdBy": "admin",
+      "jcr:created": "Thu Aug 07 2014 16:33:00 GMT+0200",
+      "jcr:content": {
+        "jcr:primaryType": "app:PageContent",
+        "jcr:mixinTypes": ["type1","type2"],
+        "jcr:createdBy": "admin",
+        "jcr:title": "Profiles",
+        "app:template": "sample/templates/contentpage",
+        "jcr:created": "Thu Aug 07 2014 16:33:00 GMT+0200",
+        "app:lastModified": "Thu Nov 05 2009 20:27:13 GMT+0100",
+        "hideInNav": true,
+        "sling:resourceType": "sample/components/contentpage",
+        "app:lastModifiedBy": "admin",
+        "longProp": 1234567890123,
+        "decimalProp": 1.2345,
+        "booleanProp": true,
+        "longPropMulti": [1234567890123,55],
+        "decimalPropMulti": [1.2345,1.1],
+        "booleanPropMulti": [true,false],
+        "stringPropMulti": ["aa","bb","cc"],
+        "par": {
+          "jcr:primaryType": "nt:unstructured",
+          "sling:resourceType": "foundation/components/parsys",
+          "textimage": {
+            "jcr:primaryType": "nt:unstructured",
+            "sling:resourceType": "foundation/components/textimage"
+          },
+          "mygadgets": {
+            "jcr:primaryType": "nt:unstructured",
+            "gadgets": "http://customer.meteogroup.de/meteogroup/gadgets/wetter24.xml\nhttp://germanweatherradar.googlecode.com/svn/trunk/german-weather-radar.xml\nhttp://www.digitalpowered.info/gadget/ski.pictures.xml\nhttp://www.canbuffi.de/gadgets/clock/clock.xml",
+            "sling:resourceType": "personalization/components/mygadgets"
+          }
+        },
+        "rightpar": {
+          "jcr:primaryType": "nt:unstructured",
+          "sling:resourceType": "foundation/components/iparsys",
+          "iparsys_fake_par": {
+            "jcr:primaryType": "nt:unstructured",
+            "sling:resourceType": "foundation/components/iparsys/par"
+          }
+        }
+      }
+    }
+  }
+}
diff --git a/src/test/resources/fs-test/folder2/content/content2.json b/src/test/resources/fs-test/folder2/content/content2.json
new file mode 100644
index 0000000..261509a
--- /dev/null
+++ b/src/test/resources/fs-test/folder2/content/content2.json
@@ -0,0 +1,4 @@
+{
+  "jcr:primaryType": "app:Page",
+  "jcr:createdBy": "admin"
+}
diff --git a/src/test/resources/fs-test/folder2/content/file2content.txt b/src/test/resources/fs-test/folder2/content/file2content.txt
new file mode 100644
index 0000000..667b547
--- /dev/null
+++ b/src/test/resources/fs-test/folder2/content/file2content.txt
@@ -0,0 +1 @@
+file2content
\ No newline at end of file
diff --git a/src/test/resources/fs-test/folder2/folder21/file21a.txt b/src/test/resources/fs-test/folder2/folder21/file21a.txt
new file mode 100644
index 0000000..3d5becc
--- /dev/null
+++ b/src/test/resources/fs-test/folder2/folder21/file21a.txt
@@ -0,0 +1 @@
+file21a
\ No newline at end of file
diff --git a/src/test/resources/fs-test/folder3/content.jcr.xml b/src/test/resources/fs-test/folder3/content.jcr.xml
new file mode 100644
index 0000000..da111ee
--- /dev/null
+++ b/src/test/resources/fs-test/folder3/content.jcr.xml
@@ -0,0 +1,192 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:app="http://sample.com/jcr/app/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
+    jcr:primaryType="app:Page">
+  <jcr:content
+      jcr:primaryType="app:PageContent"
+      jcr:title="en"
+      sling:resourceType="samples/sample-app/components/content/page/homepage"
+      includeAside="{Boolean}true"
+      includeAsideBar="{Boolean}true"
+      includeTeaserBar="{Boolean}true"
+      includeTeaserbar="{Boolean}true"
+      inheritAside="{Boolean}false"
+      inheritTeaserbar="{Boolean}false"
+      longProp="{Long}1234567890123"
+      decimalProp="{Decimal}1.2345"
+      longPropMulti="{Long}[1234567890123,55]"
+      stringPropMulti="[aa,bb,cc]"
+      navTitle="HOME"
+      pageTitle="Sample Site">
+    <teaserbar
+        jcr:primaryType="nt:unstructured"
+        sling:resourceType="samples/sample-app/components/content/teaserbar/teaserbarParsys">
+      <teaserbaritem
+          jcr:primaryType="nt:unstructured"
+          sling:resourceType="samples/sample-app/components/content/teaserbar/teaserbarItem"
+          linkContentRef="/content/samples/en/conference"
+          linkMediaDownload="{Boolean}false"
+          linkTitle="This should help you with your decision"
+          linkType="internal"
+          linkWindowFeatures="default"
+          linkWindowTarget="_self"
+          mediaRef="/content/dam/samples/content/user.png"
+          teaserContent="Still not convinced to attend? Need persuasion? Facts for your boss?"
+          title="Why to attend" />
+      <teaserbaritem_0
+          jcr:primaryType="nt:unstructured"
+          sling:resourceType="samples/sample-app/components/content/teaserbar/teaserbarItem"
+          linkContentRef="/content/samples/en/venue"
+          linkMediaDownload="{Boolean}false"
+          linkTitle="More information"
+          linkType="internal"
+          linkWindowFeatures="default"
+          linkWindowTarget="_self"
+          mediaRef="/content/dam/samples/content/location.png"
+          teaserContent="Take a look at the new venue for 2013. The Kulturbrauerei in the Prenzlauer Berg district."
+          title="Location" />
+      <teaserbaritem_1
+          jcr:primaryType="nt:unstructured"
+          sling:resourceType="samples/sample-app/components/content/teaserbar/teaserbarItem"
+          linkContentRef="/content/samples/en/conference/call-for-papers"
+          linkMediaDownload="{Boolean}false"
+          linkTitle="Submit your proposal here"
+          linkType="internal"
+          linkWindowFeatures="default"
+          linkWindowTarget="_self"
+          mediaRef="/content/dam/samples/content/talk.png"
+          teaserContent="If you have insight and experiences with Apache Sling and want to share them? We are actually asking for your participation!"
+          title="Want to share?" />
+      <teaserbaritem_2
+          jcr:primaryType="nt:unstructured"
+          sling:resourceType="samples/sample-app/components/content/teaserbar/teaserbarItem"
+          linkContentRef="/content/samples/en/archive"
+          linkMediaDownload="{Boolean}false"
+          linkTitle="Dive into the archive"
+          linkType="internal"
+          linkWindowFeatures="default"
+          linkWindowTarget="_self"
+          mediaRef="/content/dam/samples/content/archive.png"
+          teaserContent="adaptTo() is not a new event. Take a look at what was said and done previously."
+          title="Take a look back" />
+    </teaserbar>
+    <aside
+        jcr:primaryType="nt:unstructured"
+        sling:resourceType="samples/sample-app/components/content/aside/asideParsys">
+      <asidesponsorteaser
+          jcr:primaryType="nt:unstructured"
+          sling:resourceType="samples/sample-app/components/content/aside/asideSponsorTeaser"
+          title="Sponsors">
+        <images
+            jcr:primaryType="nt:unstructured"
+            sling:resourceType="samples/sample-app/components/content/aside/asideSponsorTeaserParsys">
+          <asidesponsorteaserit_0
+              jcr:primaryType="nt:unstructured"
+              sling:resourceType="samples/sample-app/components/content/aside/asideSponsorTeaserItem"
+              imageHeight="41"
+              imageWidth="200"
+              linkExternalRef="http://www.pro-vision.de"
+              linkType="external"
+              linkWindowFeatures="default"
+              linkWindowTarget="_blank"
+              mediaRef="/content/dam/samples/content/provision-logo.png" />
+        </images>
+      </asidesponsorteaser>
+      <asidesocialteaser
+          jcr:primaryType="nt:unstructured"
+          sling:resourceType="samples/sample-app/components/content/aside/asideSocialTeaser"
+          title="Follow us">
+        <images
+            jcr:primaryType="nt:unstructured"
+            sling:resourceType="samples/sample-app/components/content/aside/asideSponsorTeaserParsys">
+          <asidesocialteaserite
+              jcr:primaryType="nt:unstructured"
+              sling:resourceType="samples/sample-app/components/content/aside/asideSocialTeaserItem"
+              linkExternalRef="http://twitter.com/adaptto"
+              linkMediaDownload="{Boolean}false"
+              linkTitle="@adaptTo"
+              linkType="external"
+              linkWindowFeatures="default"
+              linkWindowTarget="_blank"
+              mediaRef="/content/dam/samples/content/twitter-icon.png"
+              title="on twitter" />
+        </images>
+      </asidesocialteaser>
+    </aside>
+    <content
+        jcr:primaryType="nt:unstructured"
+        sling:resourceType="sample/wcm/parsys/components/parsys">
+      <contentrichtext
+          jcr:primaryType="nt:unstructured"
+          sling:resourceType="samples/sample-app/components/content/common/contentRichText"
+          text="&lt;p&gt;adaptTo() is a meetup in Berlin focused on Apache Sling including Apache Jackrabbit and Apache Felix and is addressed to all using this stack or parts of it.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a data=&quot;{&amp;quot;linkType&amp;quot;:&amp;quot;internal&amp;quot;,&amp;quot;linkContentRef&amp;quot;:&amp;quot;/content/samples/handler/en/conference&amp;quot;,&amp;quot;linkWindowTarget&amp;quot;:&amp;quot;_self&amp;quot;,&amp;quot;linkWindowFeatures&amp;quot;:&amp;quot;defa [...]
+      <contentheadline
+          jcr:primaryType="nt:unstructured"
+          sling:resourceType="samples/sample-app/components/content/common/contentHeadline"
+          headline="Extended Call for Papers"
+          smaller="{Boolean}true" />
+      <contentrichtext_0
+          jcr:primaryType="nt:unstructured"
+          sling:resourceType="samples/sample-app/components/content/common/contentRichText"
+          text="&lt;p&gt;Although we got some great submissions for adaptTo() 2013, we still have some slots for further sessions. Therefore we extend the timeslot for submissions to the call for papers and for feedback by two weeks. This means you still can submit you submissions till 06.05.2013. We're looking forward to get more of your great talks.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a data=&quot;{&amp;quot;linkType&amp;quot;:&amp;quot;internal&amp;quot;,&amp;quot;linkContentRef&amp;quot;:&amp [...]
+    </content>
+    <stage
+        jcr:primaryType="nt:unstructured"
+        sling:resourceType="sample/wcm/parsys/components/parsys">
+      <stageheader
+          jcr:primaryType="nt:unstructured"
+          sling:resourceType="samples/sample-app/components/content/stage/stageheader"
+          linkMediaDownload="{Boolean}false"
+          linkType="internal"
+          linkWindowFeatures="default"
+          linkWindowTarget="_self"
+          mediaRef="/content/dam/samples/content/stageheader-outside2.jpg"
+          subtitle="23.–25. September 2013&#xA;Kulturbrauerei Berlin"
+          title="adaptTo() 2013">
+        <links
+            jcr:primaryType="nt:unstructured"
+            sling:resourceType="samples/sample-app/components/content/stage/stageheaderParsys">
+          <stageheaderlinkitem
+              jcr:primaryType="nt:unstructured"
+              sling:resourceType="samples/sample-app/components/content/stage/stageheaderLinkItem"
+              linkContentRef="/content/samples/en/tickets"
+              linkMediaDownload="{Boolean}false"
+              linkTitle="Get tickets now"
+              linkType="internal"
+              linkWindowFeatures="default"
+              linkWindowTarget="_self" />
+          <stageheaderlinkitem_0
+              jcr:primaryType="nt:unstructured"
+              sling:resourceType="samples/sample-app/components/content/stage/stageheaderLinkItem"
+              linkContentRef="/content/samples/en/conference/call-for-papers"
+              linkMediaDownload="{Boolean}false"
+              linkTitle="Submit paper"
+              linkType="internal"
+              linkWindowFeatures="default"
+              linkWindowTarget="_self" />
+        </links>
+      </stageheader>
+    </stage>
+    <image
+        jcr:primaryType="nt:unstructured" />
+  </jcr:content>
+  <tools />
+  <conference />
+</jcr:root>
diff --git a/src/test/resources/fs-test/folder3/content/content2.jcr.xml b/src/test/resources/fs-test/folder3/content/content2.jcr.xml
new file mode 100644
index 0000000..3964ca4
--- /dev/null
+++ b/src/test/resources/fs-test/folder3/content/content2.jcr.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:app="http://sample.com/jcr/app/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
+    jcr:primaryType="app:Page">
+  <jcr:content
+      app:template="samples/sample-app/templates/admin/structureElement"
+      jcr:primaryType="app:PageContent"
+      jcr:title="tools"
+      sling:resourceType="samples/sample-app/components/admin/page/structureElement"
+      hideInNav="{Boolean}true" />
+  <navigation />
+</jcr:root>
diff --git a/src/test/resources/fs-test/folder3/folder31/file31a.txt b/src/test/resources/fs-test/folder3/folder31/file31a.txt
new file mode 100644
index 0000000..3d5becc
--- /dev/null
+++ b/src/test/resources/fs-test/folder3/folder31/file31a.txt
@@ -0,0 +1 @@
+file21a
\ No newline at end of file
diff --git a/src/test/resources/invalid-test/invalid.jcr.xml b/src/test/resources/invalid-test/invalid.jcr.xml
new file mode 100644
index 0000000..7df8a70
--- /dev/null
+++ b/src/test/resources/invalid-test/invalid.jcr.xml
@@ -0,0 +1 @@
+This is invalid xml.
diff --git a/src/test/resources/invalid-test/invalid.json b/src/test/resources/invalid-test/invalid.json
new file mode 100644
index 0000000..59fc86c
--- /dev/null
+++ b/src/test/resources/invalid-test/invalid.json
@@ -0,0 +1 @@
+This is invalid json.
diff --git a/src/test/resources/simplelogger.properties b/src/test/resources/simplelogger.properties
new file mode 100644
index 0000000..e62c1ea
--- /dev/null
+++ b/src/test/resources/simplelogger.properties
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+org.slf4j.simpleLogger.defaultLogLevel=warn
+org.slf4j.simpleLogger.log.org.apache.sling.fsprovider.internal=warn
diff --git a/src/test/resources/vaultfs-test/META-INF/vault/filter.xml b/src/test/resources/vaultfs-test/META-INF/vault/filter.xml
new file mode 100644
index 0000000..20be2d8
--- /dev/null
+++ b/src/test/resources/vaultfs-test/META-INF/vault/filter.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<workspaceFilter version="1.0">
+    <filter root="/content/dam/talk.png" />
+    <filter root="/content/samples" />
+</workspaceFilter>
diff --git a/src/test/resources/vaultfs-test/META-INF/vault/settings.xml b/src/test/resources/vaultfs-test/META-INF/vault/settings.xml
new file mode 100644
index 0000000..3f8e13a
--- /dev/null
+++ b/src/test/resources/vaultfs-test/META-INF/vault/settings.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<vault version="1.0">
+  <ignore name=".svn"/>
+  <ignore name=".DS_Store"/>
+</vault>
diff --git a/src/test/resources/vaultfs-test/jcr_root/.content.xml b/src/test/resources/vaultfs-test/jcr_root/.content.xml
new file mode 100644
index 0000000..b264022
--- /dev/null
+++ b/src/test/resources/vaultfs-test/jcr_root/.content.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:rep="internal" xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
+    jcr:mixinTypes="[rep:AccessControllable,rep:RepoAccessControllable]"
+    jcr:primaryType="rep:root"
+    sling:resourceType="sling:redirect"
+    sling:target="/index.html" />
diff --git a/src/test/resources/vaultfs-test/jcr_root/content/.content.xml b/src/test/resources/vaultfs-test/jcr_root/content/.content.xml
new file mode 100644
index 0000000..115c72c
--- /dev/null
+++ b/src/test/resources/vaultfs-test/jcr_root/content/.content.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:rep="internal" xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
+    jcr:mixinTypes="[mix:lockable,rep:AccessControllable,sling:Redirect]"
+    jcr:primaryType="sling:OrderedFolder"
+    jcr:title="Content Root"
+    sling:resourceType="sling:redirect"
+    sling:target="/geohome">
+  <dam />
+  <samples />
+</jcr:root>
diff --git a/src/test/resources/vaultfs-test/jcr_root/content/dam/.content.xml b/src/test/resources/vaultfs-test/jcr_root/content/dam/.content.xml
new file mode 100644
index 0000000..64f25b1
--- /dev/null
+++ b/src/test/resources/vaultfs-test/jcr_root/content/dam/.content.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:rep="internal" xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
+    jcr:mixinTypes="[mix:lockable,rep:AccessControllable]"
+    jcr:primaryType="sling:OrderedFolder">
+  <talk.png />
+</jcr:root>
diff --git a/src/test/resources/vaultfs-test/jcr_root/content/dam/talk.png/.content.xml b/src/test/resources/vaultfs-test/jcr_root/content/dam/talk.png/.content.xml
new file mode 100644
index 0000000..4f8312a
--- /dev/null
+++ b/src/test/resources/vaultfs-test/jcr_root/content/dam/talk.png/.content.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:app="http://sample.com/app/1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
+    jcr:primaryType="app:Asset">
+  <jcr:content
+      jcr:primaryType="app:AssetContent">
+    <metadata
+        app:Bitsperpixel="{Long}4"
+        app:extracted="{Date}2015-09-19T14:33:36.078+02:00"
+        app:Fileformat="PNG"
+        app:MIMEtype="image/png"
+        app:Numberofimages="{Long}1"
+        app:Numberoftextualcomments="{Long}3"
+        app:Physicalheightindpi="{Long}72"
+        app:Physicalheightininches="{Decimal}3.750854253768921"
+        app:Physicalwidthindpi="{Long}72"
+        app:Physicalwidthininches="{Decimal}6.668185710906982"
+        app:Progressive="no"
+        app:sha1="29e02b493473c2beaf851002b67b6f1b700be978"
+        app:size="{Long}6652"
+        app:writebackEnable="False"
+        dc:format="image/png"
+        dc:modified="{Date}2014-09-19T21:20:26.812+02:00"
+        jcr:primaryType="nt:unstructured"
+        tiff:ImageLength="{Long}270"
+        tiff:ImageWidth="{Long}480"
+        writebackEnable="{Boolean}true" />
+  </jcr:content>
+</jcr:root>
diff --git a/src/test/resources/vaultfs-test/jcr_root/content/dam/talk.png/_jcr_content/renditions/original b/src/test/resources/vaultfs-test/jcr_root/content/dam/talk.png/_jcr_content/renditions/original
new file mode 100644
index 0000000..0d42760
Binary files /dev/null and b/src/test/resources/vaultfs-test/jcr_root/content/dam/talk.png/_jcr_content/renditions/original differ
diff --git a/src/test/resources/vaultfs-test/jcr_root/content/dam/talk.png/_jcr_content/renditions/original.dir/.content.xml b/src/test/resources/vaultfs-test/jcr_root/content/dam/talk.png/_jcr_content/renditions/original.dir/.content.xml
new file mode 100644
index 0000000..1813b25
--- /dev/null
+++ b/src/test/resources/vaultfs-test/jcr_root/content/dam/talk.png/_jcr_content/renditions/original.dir/.content.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
+    jcr:primaryType="nt:file">
+  <jcr:content
+      jcr:mimeType="image/png"
+      jcr:primaryType="nt:resource" />
+</jcr:root>
diff --git a/src/test/resources/vaultfs-test/jcr_root/content/dam/talk.png/_jcr_content/renditions/web.1280.1280.png b/src/test/resources/vaultfs-test/jcr_root/content/dam/talk.png/_jcr_content/renditions/web.1280.1280.png
new file mode 100644
index 0000000..27b0374
Binary files /dev/null and b/src/test/resources/vaultfs-test/jcr_root/content/dam/talk.png/_jcr_content/renditions/web.1280.1280.png differ
diff --git a/src/test/resources/vaultfs-test/jcr_root/content/samples/.content.xml b/src/test/resources/vaultfs-test/jcr_root/content/samples/.content.xml
new file mode 100644
index 0000000..c96141e
--- /dev/null
+++ b/src/test/resources/vaultfs-test/jcr_root/content/samples/.content.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
+    jcr:primaryType="sling:OrderedFolder">
+  <en />
+</jcr:root>
diff --git a/src/test/resources/vaultfs-test/jcr_root/content/samples/en/.content.xml b/src/test/resources/vaultfs-test/jcr_root/content/samples/en/.content.xml
new file mode 100644
index 0000000..83b8626
--- /dev/null
+++ b/src/test/resources/vaultfs-test/jcr_root/content/samples/en/.content.xml
@@ -0,0 +1,191 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:app="http://sample.com/jcr/app/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
+    jcr:primaryType="app:Page">
+  <jcr:content
+      app:cloudserviceconfigs="[[]]"
+      app:deviceGroups="[/etc/mobile/groups/responsive]"
+      app:template="samples/sample-app/templates/content/homepage"
+      jcr:primaryType="app:PageContent"
+      jcr:title="en"
+      sling:resourceType="samples/sample-app/components/content/page/homepage"
+      includeAside="{Boolean}true"
+      includeAsideBar="{Boolean}true"
+      includeTeaserBar="{Boolean}true"
+      includeTeaserbar="{Boolean}true"
+      inheritAside="{Boolean}false"
+      inheritTeaserbar="{Boolean}false"
+      navTitle="HOME"
+      pageTitle="Sample Site">
+    <teaserbar
+        jcr:primaryType="nt:unstructured"
+        sling:resourceType="samples/sample-app/components/content/teaserbar/teaserbarParsys">
+      <teaserbaritem
+          jcr:primaryType="nt:unstructured"
+          sling:resourceType="samples/sample-app/components/content/teaserbar/teaserbarItem"
+          linkContentRef="/content/samples/en/conference"
+          linkMediaDownload="{Boolean}false"
+          linkTitle="This should help you with your decision"
+          linkType="internal"
+          linkWindowFeatures="default"
+          linkWindowTarget="_self"
+          mediaRef="/content/dam/samples/content/user.png"
+          teaserContent="Still not convinced to attend? Need persuasion? Facts for your boss?"
+          title="Why to attend" />
+      <teaserbaritem_0
+          jcr:primaryType="nt:unstructured"
+          sling:resourceType="samples/sample-app/components/content/teaserbar/teaserbarItem"
+          linkContentRef="/content/samples/en/venue"
+          linkMediaDownload="{Boolean}false"
+          linkTitle="More information"
+          linkType="internal"
+          linkWindowFeatures="default"
+          linkWindowTarget="_self"
+          mediaRef="/content/dam/samples/content/location.png"
+          teaserContent="Take a look at the new venue for 2013. The Kulturbrauerei in the Prenzlauer Berg district."
+          title="Location" />
+      <teaserbaritem_1
+          jcr:primaryType="nt:unstructured"
+          sling:resourceType="samples/sample-app/components/content/teaserbar/teaserbarItem"
+          linkContentRef="/content/samples/en/conference/call-for-papers"
+          linkMediaDownload="{Boolean}false"
+          linkTitle="Submit your proposal here"
+          linkType="internal"
+          linkWindowFeatures="default"
+          linkWindowTarget="_self"
+          mediaRef="/content/dam/samples/content/talk.png"
+          teaserContent="If you have insight and experiences with Apache Sling and want to share them? We are actually asking for your participation!"
+          title="Want to share?" />
+      <teaserbaritem_2
+          jcr:primaryType="nt:unstructured"
+          sling:resourceType="samples/sample-app/components/content/teaserbar/teaserbarItem"
+          linkContentRef="/content/samples/en/archive"
+          linkMediaDownload="{Boolean}false"
+          linkTitle="Dive into the archive"
+          linkType="internal"
+          linkWindowFeatures="default"
+          linkWindowTarget="_self"
+          mediaRef="/content/dam/samples/content/archive.png"
+          teaserContent="adaptTo() is not a new event. Take a look at what was said and done previously."
+          title="Take a look back" />
+    </teaserbar>
+    <aside
+        jcr:primaryType="nt:unstructured"
+        sling:resourceType="samples/sample-app/components/content/aside/asideParsys">
+      <asidesponsorteaser
+          jcr:primaryType="nt:unstructured"
+          sling:resourceType="samples/sample-app/components/content/aside/asideSponsorTeaser"
+          title="Sponsors">
+        <images
+            jcr:primaryType="nt:unstructured"
+            sling:resourceType="samples/sample-app/components/content/aside/asideSponsorTeaserParsys">
+          <asidesponsorteaserit_0
+              jcr:primaryType="nt:unstructured"
+              sling:resourceType="samples/sample-app/components/content/aside/asideSponsorTeaserItem"
+              imageHeight="41"
+              imageWidth="200"
+              linkExternalRef="http://www.pro-vision.de"
+              linkType="external"
+              linkWindowFeatures="default"
+              linkWindowTarget="_blank"
+              mediaRef="/content/dam/samples/content/provision-logo.png" />
+        </images>
+      </asidesponsorteaser>
+      <asidesocialteaser
+          jcr:primaryType="nt:unstructured"
+          sling:resourceType="samples/sample-app/components/content/aside/asideSocialTeaser"
+          title="Follow us">
+        <images
+            jcr:primaryType="nt:unstructured"
+            sling:resourceType="samples/sample-app/components/content/aside/asideSponsorTeaserParsys">
+          <asidesocialteaserite
+              jcr:primaryType="nt:unstructured"
+              sling:resourceType="samples/sample-app/components/content/aside/asideSocialTeaserItem"
+              linkExternalRef="http://twitter.com/adaptto"
+              linkMediaDownload="{Boolean}false"
+              linkTitle="@adaptTo"
+              linkType="external"
+              linkWindowFeatures="default"
+              linkWindowTarget="_blank"
+              mediaRef="/content/dam/samples/content/twitter-icon.png"
+              title="on twitter" />
+        </images>
+      </asidesocialteaser>
+    </aside>
+    <content
+        jcr:primaryType="nt:unstructured"
+        sling:resourceType="sample/wcm/parsys/components/parsys">
+      <contentrichtext
+          jcr:primaryType="nt:unstructured"
+          sling:resourceType="samples/sample-app/components/content/common/contentRichText"
+          text="&lt;p&gt;adaptTo() is a meetup in Berlin focused on Apache Sling including Apache Jackrabbit and Apache Felix and is addressed to all using this stack or parts of it.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a data=&quot;{&amp;quot;linkType&amp;quot;:&amp;quot;internal&amp;quot;,&amp;quot;linkContentRef&amp;quot;:&amp;quot;/content/samples/handler/en/conference&amp;quot;,&amp;quot;linkWindowTarget&amp;quot;:&amp;quot;_self&amp;quot;,&amp;quot;linkWindowFeatures&amp;quot;:&amp;quot;defa [...]
+      <contentheadline
+          jcr:primaryType="nt:unstructured"
+          sling:resourceType="samples/sample-app/components/content/common/contentHeadline"
+          headline="Extended Call for Papers"
+          smaller="{Boolean}true" />
+      <contentrichtext_0
+          jcr:primaryType="nt:unstructured"
+          sling:resourceType="samples/sample-app/components/content/common/contentRichText"
+          text="&lt;p&gt;Although we got some great submissions for adaptTo() 2013, we still have some slots for further sessions. Therefore we extend the timeslot for submissions to the call for papers and for feedback by two weeks. This means you still can submit you submissions till 06.05.2013. We're looking forward to get more of your great talks.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a data=&quot;{&amp;quot;linkType&amp;quot;:&amp;quot;internal&amp;quot;,&amp;quot;linkContentRef&amp;quot;:&amp [...]
+    </content>
+    <stage
+        jcr:primaryType="nt:unstructured"
+        sling:resourceType="sample/wcm/parsys/components/parsys">
+      <stageheader
+          jcr:primaryType="nt:unstructured"
+          sling:resourceType="samples/sample-app/components/content/stage/stageheader"
+          linkMediaDownload="{Boolean}false"
+          linkType="internal"
+          linkWindowFeatures="default"
+          linkWindowTarget="_self"
+          mediaRef="/content/dam/samples/content/stageheader-outside2.jpg"
+          subtitle="23.–25. September 2013&#xA;Kulturbrauerei Berlin"
+          title="adaptTo() 2013">
+        <links
+            jcr:primaryType="nt:unstructured"
+            sling:resourceType="samples/sample-app/components/content/stage/stageheaderParsys">
+          <stageheaderlinkitem
+              jcr:primaryType="nt:unstructured"
+              sling:resourceType="samples/sample-app/components/content/stage/stageheaderLinkItem"
+              linkContentRef="/content/samples/en/tickets"
+              linkMediaDownload="{Boolean}false"
+              linkTitle="Get tickets now"
+              linkType="internal"
+              linkWindowFeatures="default"
+              linkWindowTarget="_self" />
+          <stageheaderlinkitem_0
+              jcr:primaryType="nt:unstructured"
+              sling:resourceType="samples/sample-app/components/content/stage/stageheaderLinkItem"
+              linkContentRef="/content/samples/en/conference/call-for-papers"
+              linkMediaDownload="{Boolean}false"
+              linkTitle="Submit paper"
+              linkType="internal"
+              linkWindowFeatures="default"
+              linkWindowTarget="_self" />
+        </links>
+      </stageheader>
+    </stage>
+    <image
+        jcr:primaryType="nt:unstructured" />
+  </jcr:content>
+  <tools />
+  <conference />
+</jcr:root>
diff --git a/src/test/resources/vaultfs-test/jcr_root/content/samples/en/conference/.content.xml b/src/test/resources/vaultfs-test/jcr_root/content/samples/en/conference/.content.xml
new file mode 100644
index 0000000..2c2ef86
--- /dev/null
+++ b/src/test/resources/vaultfs-test/jcr_root/content/samples/en/conference/.content.xml
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:app="http://sample.com/jcr/app/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
+    jcr:primaryType="app:Page">
+  <jcr:content
+      app:template="samples/sample-app/templates/content/content"
+      jcr:primaryType="app:PageContent"
+      jcr:title="Conference"
+      sling:resourceType="samples/sample-app/components/content/page/content"
+      includeAside="{Boolean}true"
+      includeAsideBar="{Boolean}true"
+      includeTeaserBar="{Boolean}true"
+      includeTeaserbar="{Boolean}false"
+      inheritAside="{Boolean}false"
+      inheritTeaserBar="{Boolean}true"
+      inheritTeaserbar="{Boolean}false"
+      navTitle="CONFERENCE">
+    <content
+        jcr:primaryType="nt:unstructured"
+        sling:resourceType="sample/wcm/parsys/components/parsys">
+      <contentheadline
+          jcr:primaryType="nt:unstructured"
+          sling:resourceType="samples/sample-app/components/content/common/contentHeadline"
+          headline="About adaptTo() 2013" />
+      <contentrichtext
+          jcr:primaryType="nt:unstructured"
+          sling:resourceType="samples/sample-app/components/content/common/contentRichText"
+          text="&lt;p&gt;adaptTo() is a technical meetup focused on the technical stack of &lt;a data=&quot;{&amp;quot;linkType&amp;quot;:&amp;quot;external&amp;quot;,&amp;quot;linkExternalRef&amp;quot;:&amp;quot;http://sling.apache.org/&amp;quot;,&amp;quot;linkWindowTarget&amp;quot;:&amp;quot;_blank&amp;quot;,&amp;quot;linkWindowFeatures&amp;quot;:&amp;quot;default&amp;quot;}&quot; href=&quot;#&quot;&gt;Apache Sling&lt;/a&gt; including &lt;a data=&quot;{&amp;quot;linkType&amp;quot;:&amp [...]
+    </content>
+    <aside
+        jcr:primaryType="nt:unstructured"
+        sling:resourceType="samples/sample-app/components/content/aside/asideParsys">
+      <asideteaser
+          jcr:primaryType="nt:unstructured"
+          sling:resourceType="samples/sample-app/components/content/aside/asideTeaser"
+          teaserContent="&lt;p&gt;Submit your paper to attend the conference as speaker&lt;/p&gt;&#xA;"
+          title="Call for Papers">
+        <links
+            jcr:primaryType="nt:unstructured"
+            sling:resourceType="samples/sample-app/components/framework/parsys/linkListParsys">
+          <linkItem
+              jcr:primaryType="nt:unstructured"
+              sling:resourceType="samples/sample-app/components/framework/item/linkItem"
+              linkContentRef="/content/samples/en/conference/call-for-papers"
+              linkMediaDownload="{Boolean}false"
+              linkTitle="Call for Papers"
+              linkType="internal"
+              linkWindowFeatures="default"
+              linkWindowTarget="_self" />
+        </links>
+      </asideteaser>
+      <asidesponsorteaser
+          jcr:primaryType="nt:unstructured"
+          sling:resourceType="samples/sample-app/components/content/aside/asideSponsorTeaser"
+          title="Sponsors">
+        <images
+            jcr:primaryType="nt:unstructured"
+            sling:resourceType="samples/sample-app/components/content/aside/asideSponsorTeaserParsys">
+          <asidesponsorteaserit_0
+              jcr:primaryType="nt:unstructured"
+              sling:resourceType="samples/sample-app/components/content/aside/asideSponsorTeaserItem"
+              linkExternalRef="http://www.pro-vision.de"
+              linkMediaDownload="{Boolean}false"
+              linkType="external"
+              linkWindowFeatures="default"
+              linkWindowTarget="_blank"
+              mediaRef="/content/dam/samples/content/provision-logo.png" />
+        </images>
+      </asidesponsorteaser>
+    </aside>
+  </jcr:content>
+</jcr:root>
diff --git a/src/test/resources/vaultfs-test/jcr_root/content/samples/en/tools/.content.xml b/src/test/resources/vaultfs-test/jcr_root/content/samples/en/tools/.content.xml
new file mode 100644
index 0000000..3964ca4
--- /dev/null
+++ b/src/test/resources/vaultfs-test/jcr_root/content/samples/en/tools/.content.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:app="http://sample.com/jcr/app/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
+    jcr:primaryType="app:Page">
+  <jcr:content
+      app:template="samples/sample-app/templates/admin/structureElement"
+      jcr:primaryType="app:PageContent"
+      jcr:title="tools"
+      sling:resourceType="samples/sample-app/components/admin/page/structureElement"
+      hideInNav="{Boolean}true" />
+  <navigation />
+</jcr:root>
diff --git a/src/test/resources/vaultfs-test/jcr_root/content/samples/en/tools/navigation/.content.xml b/src/test/resources/vaultfs-test/jcr_root/content/samples/en/tools/navigation/.content.xml
new file mode 100644
index 0000000..676d8b9
--- /dev/null
+++ b/src/test/resources/vaultfs-test/jcr_root/content/samples/en/tools/navigation/.content.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:app="http://sample.com/jcr/app/1.0" xmlns:mix="http://www.jcp.org/jcr/mix/1.0" xmlns:sling="http://sling.apache.org/jcr/sling/1.0"
+    jcr:primaryType="app:Page">
+  <jcr:content
+      app:template="samples/sample-app/templates/admin/structureElement"
+      jcr:primaryType="app:PageContent"
+      jcr:title="navigation"
+      sling:resourceType="samples/sample-app/components/admin/page/structureElement" />
+</jcr:root>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.