Пример #1
0
 public String getPath() {
   String path = getName();
   CommitTreeNode node = getParent();
   while (node != null) {
     path = node.getName() + "/" + path;
     node = node.getParent();
   }
   return "".equals(path) ? "/" : path;
 }
Пример #2
0
 public CommitTreeNode copy(CommitTree copyTree, CommitTreeNode copyParent) {
   CommitTreeNode copy = new CommitTreeNode(copyTree, copyParent, myName);
   copy.myId = myId;
   copy.myContentChecksum = myContentChecksum;
   copy.myContent = myContent;
   if (myProperties != null) {
     copy.myProperties = new HashMap<String, byte[]>(myProperties);
   }
   if (myChildren != null) {
     copy.myChildren = new HashMap<String, CommitTreeNode>();
     for (CommitTreeNode child : myChildren.values()) {
       copy.myChildren.put(child.getName(), child.copy(copyTree, copy));
     }
   }
   return copy;
 }