in src/main/java/org/apache/sling/fsprovider/internal/mapper/FileVaultResourceMapper.java [129:149]
private Resource findResource(final ResourceResolver resolver, final String resourcePath) {
// direct file
File file = resolveFile(resourcePath);
if (file != null && fileStatCache.isFile(file)) {
return new FileResource(resolver, resourcePath, file, fileStatCache);
}
// content file
ContentFile contentFile = getContentFile(resourcePath, null);
if (contentFile != null) {
return new ContentFileResource(resolver, contentFile);
}
// fallback to directory resource if folder was found but nothing else
if (file != null && fileStatCache.isDirectory(file)) {
return new FileResource(resolver, resourcePath, file, fileStatCache);
}
return null;
}