@Override public Document resolvePath(String path) throws NoSuchDocumentException { if (path.endsWith("/") && path.length() > 1) { path = path.substring(0, path.length() - 1); } Node node = session.getNodeByPath(path, session.getRootNode()); Document doc = newDocument(node); if (doc == null) { throw new NoSuchDocumentException(path); } return doc; }