title: Phonegap filetransfer timeout
body: <p>Is there a way of defining the timeout for a download file transfer in phonegap. On an android device I get the following after 8 minutes if I attempt to download an unresponsive URL:</p>
  
  <pre><code>02-05 11:50:38.234 W/FileTransfer(12658): Error getting HTTP status code from connection.
  02-05 11:50:38.234 W/FileTransfer(12658): java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer)
  02-05 11:50:38.234 W/FileTransfer(12658):   at libcore.io.IoBridge.maybeThrowAfterRecvfrom(IoBridge.java:552)
  02-05 11:50:38.234 W/FileTransfer(12658):   at libcore.io.IoBridge.recvfrom(IoBridge.java:516)
  02-05 11:50:38.234 W/FileTransfer(12658):   at java.net.PlainSocketImpl.read(PlainSocketImpl.java:488)
  02-05 11:50:38.234 W/FileTransfer(12658):   at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:46)
  02-05 11:50:38.234 W/FileTransfer(12658):   at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:240)
  02-05 11:50:38.234 W/FileTransfer(12658):   at java.io.InputStream.read(InputStream.java:163)
  02-05 11:50:38.234 W/FileTransfer(12658):   at java.io.BufferedInputStream.fillbuf(BufferedInputStream.java:142)
  02-05 11:50:38.234 W/FileTransfer(12658):   at java.io.BufferedInputStream.read(BufferedInputStream.java:227)
  02-05 11:50:38.234 W/FileTransfer(12658):   at libcore.io.Streams.readAsciiLine(Streams.java:201)
  02-05 11:50:38.234 W/FileTransfer(12658):   at libcore.net.http.HttpEngine.readResponseHeaders(HttpEngine.java:560)
  02-05 11:50:38.234 W/FileTransfer(12658):   at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:813)
  02-05 11:50:38.234 W/FileTransfer(12658):   at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:274)
  02-05 11:50:38.234 W/FileTransfer(12658):   at libcore.net.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:168)
  02-05 11:50:38.234 W/FileTransfer(12658):   at org.apache.cordova.FileTransfer.download(FileTransfer.java:495)
  02-05 11:50:38.234 W/FileTransfer(12658):   at org.apache.cordova.FileTransfer.execute(FileTransfer.java:88)
  02-05 11:50:38.234 W/FileTransfer(12658):   at org.apache.cordova.api.PluginManager$1.run(PluginManager.java:231)
  02-05 11:50:38.234 W/FileTransfer(12658):   at java.lang.Thread.run(Thread.java:856)
  02-05 11:50:38.234 W/FileTransfer(12658): Caused by: libcore.io.ErrnoException: recvfrom failed: ECONNRESET (Connection reset by peer)
  02-05 11:50:38.234 W/FileTransfer(12658):   at libcore.io.Posix.recvfromBytes(Native Method)
  02-05 11:50:38.234 W/FileTransfer(12658):   at libcore.io.Posix.recvfrom(Posix.java:131)
  02-05 11:50:38.234 W/FileTransfer(12658):   at libcore.io.BlockGuardOs.recvfrom(BlockGuardOs.java:164)
  02-05 11:50:38.234 W/FileTransfer(12658):   at libcore.io.IoBridge.recvfrom(IoBridge.java:513)
  02-05 11:50:38.234 W/FileTransfer(12658):   ... 15 more
  02-05 11:50:38.234 E/FileTransfer(12658): {"target":"\/storage\/sdcard0\/Android\/data\/uk.ac.edina.mobile\/cache\/edina\/cache\/open_3_21_37.jpg","source":"http:\/\/fieldtripgb.edina.ac.uk\/mapcache\/tms1.0.0\/fieldtripgb@BNG\/3\/21\/37.jpg?version=1.1.1&amp;id=22362b279a637a91&amp;app=free&amp;cache=true","code":3}
  02-05 11:50:38.234 E/FileTransfer(12658): java.net.SocketException: recvfrom failed: ECONNRESET (Connection reset by peer)
  02-05 11:50:38.234 E/FileTransfer(12658):   at libcore.io.IoBridge.maybeThrowAfterRecvfrom(IoBridge.java:552)
  02-05 11:50:38.234 E/FileTransfer(12658):   at libcore.io.IoBridge.recvfrom(IoBridge.java:516)
  02-05 11:50:38.234 E/FileTransfer(12658):   at java.net.PlainSocketImpl.read(PlainSocketImpl.java:488)
  02-05 11:50:38.234 E/FileTransfer(12658):   at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:46)
  02-05 11:50:38.234 E/FileTransfer(12658):   at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:240)
  02-05 11:50:38.234 E/FileTransfer(12658):   at java.io.InputStream.read(InputStream.java:163)
  02-05 11:50:38.234 E/FileTransfer(12658):   at java.io.BufferedInputStream.fillbuf(BufferedInputStream.java:142)
  02-05 11:50:38.234 E/FileTransfer(12658):   at java.io.BufferedInputStream.read(BufferedInputStream.java:227)
  02-05 11:50:38.234 E/FileTransfer(12658):   at libcore.io.Streams.readAsciiLine(Streams.java:201)
  02-05 11:50:38.234 E/FileTransfer(12658):   at libcore.net.http.HttpEngine.readResponseHeaders(HttpEngine.java:560)
  02-05 11:50:38.234 E/FileTransfer(12658):   at libcore.net.http.HttpEngine.readResponse(HttpEngine.java:813)
  02-05 11:50:38.234 E/FileTransfer(12658):   at libcore.net.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:274)
  02-05 11:50:38.234 E/FileTransfer(12658):   at libcore.net.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:168)
  02-05 11:50:38.234 E/FileTransfer(12658):   at org.apache.cordova.FileTransfer.download(FileTransfer.java:495)
  02-05 11:50:38.234 E/FileTransfer(12658):   at org.apache.cordova.FileTransfer.execute(FileTransfer.java:88)
  02-05 11:50:38.234 E/FileTransfer(12658):   at org.apache.cordova.api.PluginManager$1.run(PluginManager.java:231)
  02-05 11:50:38.234 E/FileTransfer(12658):   at java.lang.Thread.run(Thread.java:856)
  02-05 11:50:38.234 E/FileTransfer(12658): Caused by: libcore.io.ErrnoException: recvfrom failed: ECONNRESET (Connection reset by peer)
  02-05 11:50:38.234 E/FileTransfer(12658):   at libcore.io.Posix.recvfromBytes(Native Method)
  02-05 11:50:38.234 E/FileTransfer(12658):   at libcore.io.Posix.recvfrom(Posix.java:131)
  02-05 11:50:38.234 E/FileTransfer(12658):   at libcore.io.BlockGuardOs.recvfrom(BlockGuardOs.java:164)
  02-05 11:50:38.234 E/FileTransfer(12658):   at libcore.io.IoBridge.recvfrom(IoBridge.java:513)
  02-05 11:50:38.234 E/FileTransfer(12658):   ... 15 more
  </code></pre>