.getQueryManager()
.createQuery(
"select file from ["
- + (true ? "nt:file" : "nt:base")
- + "] as file", Query.JCR_SQL2);
+ + (true ? NodeType.NT_FILE
+ : NodeType.NT_BASE) + "] as file",
+ Query.JCR_SQL2);
+
QueryResult result = countQuery.execute();
Long expectedCount = result.getNodes().getSize();
return expectedCount;
if (log.isDebugEnabled())
log.debug("Synced " + sourceSession.getWorkspace().getName());
} catch (Exception e) {
+ e.printStackTrace();
throw new SlcException("Cannot sync "
+ sourceSession.getWorkspace().getName() + " to "
+ targetSession.getWorkspace().getName(), e);
copyProperties(sourceNode, targetNode);
// next level
- for (NodeIterator ni = sourceNode.getNodes(); ni.hasNext();) {
+ NodeIterator ni = sourceNode.getNodes();
+ while (ni != null && ni.hasNext()) {
Node sourceChild = ni.nextNode();
syncNode(sourceChild, targetSession);
}