if (!buffered.isBuffered()) {
return new State(State.NodeInSync, buffered.exists() ? Location.Both : Location.None);
}
File source = buffered.getUnbuffered();
BufferedFile destination = (BufferedFile) buffered;
if (!source.exists()) {
if (!destination.exists()) {
return new State(State.NodeInSync, Location.None);
}
else {
return new State(State.Orphan, Location.Destination);
}
}
else if (!destination.exists()) {
return new State(State.Orphan, Location.Source);
}
if (source.isDirectory()) {
if (destination.isDirectory()) {
return new State(State.NodeInSync, Location.Both);
}
else {
return new State(State.DirHereFileThere, Location.Source);
}
}
else if (destination.isDirectory()) {
return new State(State.DirHereFileThere, Location.Destination);
}
return comparer.compareFiles(source, destination);
}