Exemple #1
0
 @Override
 public DirectoryEntry copy() {
   DirectoryEntry result = copyEntry();
   for (Entry child : myChildren) {
     result.unsafeAddChild(child.copy());
   }
   return result;
 }
Exemple #2
0
  @Override
  public void collectDifferencesWith(Entry right, List<Difference> result) {
    DirectoryEntry e = (DirectoryEntry) right;

    if (!getPath().equals(e.getPath())) {
      result.add(new Difference(false, this, e));
    }

    addCreatedChildrenDifferences(e, result);
    addDeletedChildrenDifferences(e, result);
    addModifiedChildrenDifferences(e, result);
  }
Exemple #3
0
 private void addDeletedChildrenDifferences(DirectoryEntry e, List<Difference> result) {
   for (Entry child : myChildren) {
     if (e.findDirectChild(child.getId()) == null) {
       child.collectDeletedDifferences(result);
     }
   }
 }
Exemple #4
0
 private void addModifiedChildrenDifferences(DirectoryEntry e, List<Difference> result) {
   for (Entry myChild : myChildren) {
     Entry itsChild = e.findDirectChild(myChild.getId());
     if (itsChild != null) {
       myChild.collectDifferencesWith(itsChild, result);
     }
   }
 }