// 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); }
// 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); }
// 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); }
// 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); }