private Descriptor getParentNodeDescriptor()

in src/main/java/org/apache/sling/jcr/contentloader/internal/BundleContentLoader.java [794:816]


    private Descriptor getParentNodeDescriptor(final Bundle bundle, final String path,
            final DefaultContentCreator contentCreator) {

        for (Map.Entry<String, ContentReader> entry : contentCreator.getContentReaders().entrySet()) {
            if (entry.getValue() != null) {
                final StringBuilder filePath = new StringBuilder(path);
                if (!path.endsWith("/")) {
                    filePath.append("/");
                }
                filePath.append(PARENT_DESCRIPTOR);
                // add file extension, e.g. .jcr.xml, .xml, .zip (see BaseImportLoader)
                filePath.append(entry.getKey());
                URL url = bundle.getEntry(filePath.toString());
                if (url != null) {
                    final Descriptor descriptor = new Descriptor();
                    descriptor.setUrl(url);
                    descriptor.setContentReader(entry.getValue());
                    return descriptor;
                }
            }
        }
        return null;
    }