in src/main/java/org/apache/sling/fsprovider/internal/parser/ContentElementHandler.java [37:61]
public void resource(String path, Map<String, Object> properties) {
if (StringUtils.equals(path, "/")) {
root = new ContentElementImpl(null, properties);
} else {
if (root == null) {
throw new RuntimeException("Root resource not set.");
}
Matcher matcher = PATH_PATTERN.matcher(path);
if (!matcher.matches()) {
throw new RuntimeException("Unexpected path:" + path);
}
String relativeParentPath = StringUtils.stripStart(matcher.group(1), "/");
String name = matcher.group(4);
ContentElement parent;
if (StringUtils.isEmpty(relativeParentPath)) {
parent = root;
} else {
parent = root.getChild(relativeParentPath);
}
if (parent == null) {
throw new RuntimeException("Parent '" + relativeParentPath + "' does not exist.");
}
parent.getChildren().put(name, new ContentElementImpl(name, properties));
}
}