private static final Action ignore = new Action(Nothing, None, BufferUpdate.None, "Ignore");
@Override
public Task getTask(final File src, final File dst, final StateDecider sd, final BufferStateDecider bsd) throws DataParseException, IOException {
Vector<Action> actions = new Vector<Action>(3);
State state = sd.getState(src, dst);
switch (state.getType()) {
case State.Orphan:
if (state.getLocation() == Source) {
if (!bsd.getState(dst).equals(State.Orphan, Source)) {
actions.add(addDestination);
}
else {
actions.add(overwriteDestination);
}
}
else if (state.getLocation() == Destination) {
actions.add(ignoreDestinationOrphan);
actions.add(deleteDestinationOrphan);
}
break;
case State.DirHereFileThere:
State buff = bsd.getState(dst);
if (buff.equals(State.Orphan, Buffer)) {
actions.add(new Action(Add, Destination, BufferUpdate.Destination,
"There was a node in buff, but its orphan, so add"));
}
else if (buff.equals(State.DirHereFileThere, state.getLocation())) {
if (state.getLocation() == Source) {
actions.add(new Action(Nothing, None, BufferUpdate.Destination,
"dirherefilethere, but there is a dir instead of file, so its in sync"));
}
else {