Esempio n. 1
0
  @Override
  public NodeLink getNodeLink() {
    if (group == null || tree == null) {
      return null;
    }

    if (path.startsWith(Tree.ROOT)) {
      return tree.findNodeLink(path);
    }
    return tree.findNodeLink(TreeImpl.canonicalizePath(TreeUtils.getPath(tree, group) + path));
  }
Esempio n. 2
0
 /**
  * Construct a symbolic link with given object ID, from URI to tree, group and node path
  *
  * @param oid object ID
  * @param uri
  * @param groupWithNode (can be null if path is absolute)
  * @param pathToNode (ends in separator if group, otherwise a dataset)
  */
 public SymbolicNodeImpl(
     final long oid, final URI uri, final GroupNode groupWithNode, final String pathToNode) {
   super(oid);
   this.uri = uri;
   group = groupWithNode;
   path = TreeImpl.canonicalizePath(pathToNode);
   if (!path.startsWith(Tree.ROOT) && group == null) {
     throw new IllegalArgumentException(
         "A group node must be given when creating a symbolic node with a relative path");
   }
 }