I'm wondering about writing an application in Java which can synchronize files across my devices automatically (desktop, notebook, smartphone). Similar to Dropbox, however without a 3rd party server because i own my own.

Searching through the net i haven't found any helpful topics talking about synchronization algorithms which are used in such programs. I guess it's not an easy subject considering the fact that this problem is similar to revision control. Because of that i thinking about relaxing it. Eg. i don't (yet) want to implement optimization in data transfer for in-file changes so it's okay for me to transfer the whole file if it changed. Also it's fine for me if the system ask me for resolving conflicts manually between different file versions.

My biggest problem is the network communication. How should a slave client ask/tell my central storage server about file changes? I guess it's not a good idea to periodically transfer the whole file list with metadata to the server. As far as i see Dropbox checks the whole shared folder on startup then somehow notices changes on the local filesystem (i know there's a way to listen to file system change events in the OS, eg. Java7 has the `WatchService` class for this) and also listen to network sync events. Should i maintain file revisions like version control systems doing it or is there other solutions?

Are there any books or online materials about this subject?