You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 09:47:57 UTC
[sling-org-apache-sling-jcr-contentloader] 17/28: SLING-1582 added
better information at debug level.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag org.apache.sling.jcr.contentloader-2.1.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-contentloader.git
commit 649f3d41bfddcd1a84df811dc3f9df008b9177dd
Author: Ian Boston <ie...@apache.org>
AuthorDate: Fri Jul 2 22:24:24 2010 +0000
SLING-1582 added better information at debug level.
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/contentloader@960126 13f79535-47bb-0310-9956-ffa450edef68
---
.../sling/jcr/contentloader/internal/Loader.java | 91 ++++++++++++----------
1 file changed, 50 insertions(+), 41 deletions(-)
diff --git a/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java b/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java
index d00bb9e..53e9b86 100644
--- a/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java
+++ b/src/main/java/org/apache/sling/jcr/contentloader/internal/Loader.java
@@ -440,51 +440,60 @@ public class Loader extends BaseImportLoader {
throws RepositoryException {
final URL file = bundle.getEntry(entry);
final String name = getName(entry);
-
- if (processedEntries.containsKey(file)) {
- // this is a consumed node descriptor
- return;
- }
-
- // check for node descriptor
- URL nodeDescriptor = null;
- for (String ext : this.contentCreator.getImportProviders().keySet()) {
- nodeDescriptor = bundle.getEntry(entry + ext);
- if (nodeDescriptor != null) {
- break;
+ try {
+ if (processedEntries.containsKey(file)) {
+ // this is a consumed node descriptor
+ return;
}
- }
-
- // install if it is a descriptor
- boolean foundProvider = this.contentCreator.getImportProvider(entry) != null;
-
- Node node = null;
- if (foundProvider) {
- if ((node = createNode(parent, name, file, configuration)) != null) {
- processedEntries.put(file, node);
+
+ // check for node descriptor
+ URL nodeDescriptor = null;
+ for (String ext : this.contentCreator.getImportProviders().keySet()) {
+ nodeDescriptor = bundle.getEntry(entry + ext);
+ if (nodeDescriptor != null) {
+ break;
+ }
}
- }
-
- // otherwise just place as file
- if ( node == null ) {
- try {
- createFile(configuration, parent, file, createdNodes);
- node = parent.getNode(name);
- } catch (IOException ioe) {
- log.warn("Cannot create file node for {}", file, ioe);
+
+ // install if it is a descriptor
+ boolean foundProvider = this.contentCreator.getImportProvider(entry) != null;
+
+ Node node = null;
+ if (foundProvider) {
+ if ((node = createNode(parent, name, file, configuration)) != null) {
+ log.debug("Created Node as {} {} ",node.getPath(),name);
+ processedEntries.put(file, node);
+ } else {
+ log.warn("No Node created for file {} {} ",file,name);
+ }
+ } else {
+ log.debug("Cant find provider for Entry {} at {} ",entry,name);
}
- }
- // if we have a descriptor, which has not been processed yet,
- // process it
- if (nodeDescriptor != null && processedEntries.get(nodeDescriptor) == null ) {
- try {
- this.contentCreator.setIgnoreOverwriteFlag(true);
- node = createNode(parent, name, nodeDescriptor,
- configuration);
- processedEntries.put(nodeDescriptor, node);
- } finally {
- this.contentCreator.setIgnoreOverwriteFlag(false);
+
+ // otherwise just place as file
+ if ( node == null ) {
+ try {
+ createFile(configuration, parent, file, createdNodes);
+ node = parent.getNode(name);
+ } catch (IOException ioe) {
+ log.warn("Cannot create file node for {}", file, ioe);
+ }
+ }
+ // if we have a descriptor, which has not been processed yet,
+ // process it
+ if (nodeDescriptor != null && processedEntries.get(nodeDescriptor) == null ) {
+ try {
+ this.contentCreator.setIgnoreOverwriteFlag(true);
+ node = createNode(parent, name, nodeDescriptor,
+ configuration);
+ processedEntries.put(nodeDescriptor, node);
+ } finally {
+ this.contentCreator.setIgnoreOverwriteFlag(false);
+ }
}
+ } catch ( RepositoryException e ) {
+ log.error("Failed to process process file {} from {}", file, name);
+ throw e;
}
}
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.