Fixing CB-2171, 0 byte file in filesystem on 404 from server. Patches are welcome.

This commit is contained in:
Joe Bowser 2013-01-08 13:54:38 -08:00
parent 72e0b49e0b
commit 7ace1d652d

View File

@ -676,10 +676,11 @@ public class FileTransfer extends CordovaPlugin {
progress.setTotal(connection.getContentLength());
}
FileOutputStream outputStream = new FileOutputStream(file);
FileOutputStream outputStream = null;
InputStream inputStream = null;
try {
outputStream = new FileOutputStream(file);
inputStream = getInputStream(connection);
synchronized (context) {
if (context.aborted) {