Skip to content

Commit

Permalink
JCR: backup jcr repositories with corrupted segments.
Browse files Browse the repository at this point in the history
  • Loading branch information
kreinhard committed Dec 30, 2024
1 parent 2232899 commit 06a456e
Show file tree
Hide file tree
Showing 6 changed files with 781 additions and 694 deletions.
38 changes: 23 additions & 15 deletions projectforge-jcr/src/main/kotlin/org/projectforge/jcr/NodeInfo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,35 @@ class NodeInfo() {
node.parent.path
}
if (recursive) {
node.nodes?.let {
val nodes = mutableListOf<NodeInfo>()
while (it.hasNext()) {
val child = it.nextNode()
if (PFJcrUtils.matchAnyPath(child, listOfIgnoredNodePaths)) {
log.info { "Ignore path=${child.path} as configured." }
continue
try {
node.nodes?.let {
val nodes = mutableListOf<NodeInfo>()
while (it.hasNext()) {
val child = it.nextNode()
if (PFJcrUtils.matchAnyPath(child, listOfIgnoredNodePaths)) {
log.info { "Ignore path=${child.path} as configured." }
continue
}
nodes.add(NodeInfo(child))
}
nodes.add(NodeInfo(child))
children = nodes
}
children = nodes
} catch(e: Exception) {
log.error { "Error while reading children of node '${node.path}': ${e.message}" }
}
}
if (node.properties?.hasNext() == true) {
val props = mutableListOf<PropertyInfo>()
properties = props
node.properties.let {
while (it.hasNext()) {
props.add(PropertyInfo(it.nextProperty()))
try {
if (node.properties?.hasNext() == true) {
val props = mutableListOf<PropertyInfo>()
properties = props
node.properties.let {
while (it.hasNext()) {
props.add(PropertyInfo(it.nextProperty()))
}
}
}
} catch (e: Exception) {
log.error { "Error while reading properties of node '${node.path}': ${e.message}" }
}
}

Expand Down
Loading

0 comments on commit 06a456e

Please sign in to comment.