There have been a few reports about stuck downloads with Folder Downloader for Dropbox, so I added some logic to better handle network read timeouts. The main problem is with Java’s FilterInputStream.read()
method, which is blocking and has no timeout setting. I ended up using Eclipse’s TimeoutInputStream
(see update below).
That said, such timeouts were very sporadic, although I experienced a couple myself. As you can see from these screenshots, FDfD is reliable both for both large and small files.
I tested these downloads on my Galaxy Nexus over a slowish DSL connection. The problem is that there’s no obvious way to test this kind of errors. The latest update (1.2.5), at any rate, should handle timeouts gracefully without hanging the entire background service.
Update 2012/10/19: it seems that TimeoutInputStream
corrupts data. I don’t know the reason or the circumstances but for now I removed it. I decided to opt for Java’s built-in Future<T>
and ExecutorService
(mandatory example on Stack Overflow). Making it work is very tricky, but it looks much more stable.