Ejemplo n.º 1
0
  // UpdateBinaryFile - UpdateBinaryFile
  public TranspResult transp(UpdateBinaryFile c1, UpdateBinaryFile c2) {
    if (c1.getPath().equals(c2.getPath())) {
      return new TranspResult(c2, new EmptyOp(c1), true);
    }

    return new TranspResult(c2, c1, true);
  }
Ejemplo n.º 2
0
  // AddFile - Update
  public TranspResult transp(AddBinaryFile c1, UpdateBinaryFile c2) throws Exception {
    if (c1.getPath().equals(c2.getPath())) {
      c1.setAttachement(c2.getAttachement());

      return new TranspResult(c1, new EmptyOp(c2), false);
    }

    return new TranspResult(c2, c1, true);
  }
Ejemplo n.º 3
0
  // UpdateBinaryFile - Rename
  public TranspResult transp(UpdateBinaryFile c1, Rename c2) {
    if (c1.getPath().equals(c2.getPath())) {
      // Rename the UpdateBinaryFile and propagate the Rename
      c1.setPath(c2.getNewPath());

      return new TranspResult(c2, c1, true);
    }

    if (childOf(c1, c2)) {
      // rename the parent path concerned by the rename
      c1.setPath(replacePath(c1.getPath(), c2.getNewPath()));

      return new TranspResult(c2, c1, true);
    }

    return new TranspResult(c2, c1, true);
  }
Ejemplo n.º 4
0
  // UpdateBinaryFile - Remove
  public TranspResult transp(UpdateBinaryFile c1, Remove c2) {
    if (c1.getPath().equals(c2.getPath())) {
      // No need to create the dir and to keep the remove
      return new TranspResult(c2, new EmptyOp(c1), true);
    }

    if (childOf(c1, c2)) {
      // Remove a parent dir
      return new TranspResult(c2, new EmptyOp(c1), true);
    }

    return new TranspResult(c2, c1, true);
  }