예제 #1
0
  // AddFile - Rename
  public TranspResult transp(AddFile c1, Rename c2) {
    if (c1.getPath().equals(c2.getPath())) {
      // Rename the AddFile and Delete the Rename
      c1.setPath(c2.getNewPath());

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

    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);
  }
예제 #2
0
  // AddFile - Remove
  public TranspResult transp(AddFile c1, Remove c2) {
    if (c1.getPath().equals(c2.getPath())) {
      // No need to create the file and to keep the remove
      return new TranspResult(new EmptyOp(c1), new EmptyOp(c2), false);
    }

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

    return new TranspResult(c2, c1, true);
  }
예제 #3
0
 public void toXML(OutputStreamWriter osw) throws IOException {
   super.toXML(osw);
   osw.write("<contrib>");
   osw.write(Long.toString(getSize()));
   osw.write("</contrib>");
 }