public JCRNodeWrapper getNode(String path, boolean checkVersion)
     throws PathNotFoundException, RepositoryException {
   JCRItemWrapper item = getItem(path, checkVersion);
   if (item.isNode()) {
     return (JCRNodeWrapper) item;
   } else {
     throw new PathNotFoundException();
   }
 }
 public void removeItem(String absPath)
     throws VersionException, LockException, ConstraintViolationException, AccessDeniedException,
         RepositoryException {
   JCRItemWrapper item = getItem(absPath);
   boolean flushNeeded = false;
   if (item.isNode()) {
     JCRNodeWrapper node = (JCRNodeWrapper) item;
     unregisterNewNode(node);
     if (node.hasNodes()) {
       flushNeeded = true;
     }
   }
   item.remove();
   if (flushNeeded) {
     flushCaches();
   } else {
     removeFromCache(item);
   }
 }
 void removeFromCache(JCRItemWrapper item) throws RepositoryException {
   sessionCacheByPath.remove(item.getPath());
   if (item instanceof JCRNodeWrapper) {
     sessionCacheByIdentifier.remove(((JCRNodeWrapper) item).getIdentifier());
   }
 }