You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by bo...@apache.org on 2013/01/08 22:54:56 UTC

[1/2] android commit: Fixing CB-2171, 0 byte file in filesystem on 404 from server. Patches are welcome.

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


Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/7ace1d65
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/7ace1d65
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/7ace1d65

Branch: refs/heads/master
Commit: 7ace1d652d665c850941531c18cdc55b9c7981b3
Parents: 72e0b49
Author: Joe Bowser <bo...@apache.org>
Authored: Tue Jan 8 13:54:38 2013 -0800
Committer: Joe Bowser <bo...@apache.org>
Committed: Tue Jan 8 13:54:38 2013 -0800

----------------------------------------------------------------------
 framework/src/org/apache/cordova/FileTransfer.java |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/7ace1d65/framework/src/org/apache/cordova/FileTransfer.java
----------------------------------------------------------------------
diff --git a/framework/src/org/apache/cordova/FileTransfer.java b/framework/src/org/apache/cordova/FileTransfer.java
index fdc9c75..9bec20c 100644
--- a/framework/src/org/apache/cordova/FileTransfer.java
+++ b/framework/src/org/apache/cordova/FileTransfer.java
@@ -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) {