private ContentFile getContentFile()

in src/main/java/org/apache/sling/fsprovider/internal/mapper/FileVaultResourceMapper.java [256:280]


    private ContentFile getContentFile(String path, String subPath) {
        File file = new File(providerFile, "." + PlatformNameFormat.getPlatformPath(path) + DOT_CONTENT_XML_SUFFIX);
        if (fileStatCache.exists(file)) {
            ContentFile contentFile = new ContentFile(file, path, subPath, contentFileCache, ContentType.JCR_XML);
            if (contentFile.hasContent()) {
                return contentFile;
            }
        }

        file = new File(providerFile, "." + PlatformNameFormat.getPlatformPath(path) + XML_SUFFIX);
        if (fileStatCache.exists(file) && !hasDotDirFile(file)) {
            ContentFile contentFile = new ContentFile(file, path, subPath, contentFileCache, ContentType.JCR_XML);
            if (contentFile.hasContent()) {
                return contentFile;
            }
        }

        // 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 getContentFile(parentPath, nextSubPath);
    }