- Node parentNode = toNode(path.getParent());
- if (parentNode == null)
- throw new JcrFsException("No parent directory for " + path);
- if (!(parentNode.getPath().equals("/") || parentNode.isNodeType(NodeType.NT_FOLDER)))
- throw new JcrFsException("Parent of " + path + " is not a directory");
+ Node parent = toNode(path.getParent());
+ if (parent == null)
+ throw new IOException("No parent directory for " + path);
+ if (parent.getPrimaryNodeType().isNodeType(NodeType.NT_FILE)
+ || parent.getPrimaryNodeType().isNodeType(NodeType.NT_LINKED_FILE))
+ throw new IOException(path + " parent is a file");