in src/main/java/org/apache/sling/fsprovider/internal/mapper/ContentFileResourceMapper.java [126:144]
private ContentFile getFile(String path, String subPath) {
if (!StringUtils.startsWith(path, providerRootPrefix)) {
return null;
}
String relPath = Escape.resourceToFileName(path.substring(providerRootPrefix.length()));
for (String filenameSuffix : contentFileExtensions.getSuffixes()) {
File file = new File(providerFile, relPath + filenameSuffix);
if (fileStatCache.exists(file)) {
return new ContentFile(file, path, subPath, contentFileCache);
}
}
// try to find in parent path which contains content fragment
String parentPath = ResourceUtil.getParent(path);
if (parentPath == null) {
return null;
}
String nextSubPath = path.substring(parentPath.length() + 1) + (subPath != null ? "/" + subPath : "");
return getFile(parentPath, nextSubPath);
}