String oakPath = sessionContext.getOakPathKeepIndex(absPath);
if (oakPath == null) {
throw new RepositoryException("Invalid name or path: " + absPath);
}
SessionDelegate sd = sessionContext.getSessionDelegate();
if (isWorkspaceImport && sd.hasPendingChanges()) {
throw new RepositoryException("Pending changes on session. Cannot run workspace import.");
}
this.uuidBehavior = uuidBehavior;
userID = sd.getAuthInfo().getUserID();
importTargetTree = root.getTree(absPath);
if (!importTargetTree.exists()) {
throw new PathNotFoundException(absPath);
}
WorkspaceImpl wsp = sessionContext.getWorkspace();
VersionManager vMgr = wsp.getVersionManager();
if (!vMgr.isCheckedOut(absPath)) {
throw new VersionException("Target node is checked in.");
}
if (importTargetTree.getStatus() != Tree.Status.NEW && wsp.getLockManager().isLocked(absPath)) {
throw new LockException("Target node is locked.");
}
effectiveNodeTypeProvider = wsp.getNodeTypeManager();
definitionProvider = wsp.getNodeTypeManager();
ntTypesRoot = root.getTree(NODE_TYPES_PATH);
accessManager = sessionContext.getAccessManager();
currentStateIdManager = new IdentifierManager(root);
baseStateIdManager = new IdentifierManager(sd.getContentSession().getLatestRoot());
refTracker = new ReferenceChangeTracker();
parents = new Stack<Tree>();
parents.push(importTargetTree);