CB-6521: Remove development branch
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index 7a4a3ea..0000000
--- a/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
\ No newline at end of file
diff --git a/NOTICE b/NOTICE
deleted file mode 100644
index 46fed23..0000000
--- a/NOTICE
+++ /dev/null
@@ -1,8 +0,0 @@
-Apache Cordova
-Copyright 2012 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
-This product includes a copy of OkHttp from:
-https://github.com/square/okhttp
diff --git a/README.md b/README.md
index 9d5c69d..30e8773 100644
--- a/README.md
+++ b/README.md
@@ -20,3 +20,5 @@
 # org.apache.cordova.file-transfer
 
 Plugin documentation: [doc/index.md](doc/index.md)
+
+This is `dev` - the deprecated development branch of this plugin; development of this plugin has moved to the `master` branch
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
deleted file mode 100644
index e982549..0000000
--- a/RELEASENOTES.md
+++ /dev/null
@@ -1,83 +0,0 @@
-<!--
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-# 
-# http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
--->
-# Release Notes
-
-### 0.3.2 (Sept 25, 2013)
-* CB-4889 bumping&resetting version
-* [windows8] commandProxy was moved
-* CB-4889 updating core references
-* CB-4889 renaming org.apache.cordova.core.file-transfer to org.apache.cordova.file-transfer and updating dependency
-* Rename CHANGELOG.md -> RELEASENOTES.md
-
-### 0.3.3 (Oct 9, 2013)
-* removed un-needed undef check
-* Fix missing headers in Windows 8 upload proxy
-* Fix missing headers in Windows 8 Proxy
-* Fix Windows 8 HTMLAnchorElement return host:80 which force Basic Auth Header to replace options Auth Header
-* [CB-4915] Incremented plugin version on dev branch.
-
- ### 0.3.4 (Oct 28, 2013)
-* CB-5128: added repo + issue tag to plugin.xml for file transfer plugin
-* [CB-5010] Incremented plugin version on dev branch.
-
-### 0.4.0 (Dec 4, 2013)
-* CB-5466: Partial revert; we're not ready yet for FS urls
-* add ubuntu platform
-* CB-5466: Minor version bump
-* CB-5466: Update FileTransfer plugin to accept filesystem urls
-* Added amazon-fireos platform. Change to use amazon-fireos as the platform if the user agen string contains 'cordova-amazon-fireos'
-
-### 0.4.1 (Feb 05, 2014)
-* CB-5365 Remove unused exception var to prevent warnings?
-* CB-2421 explicitly write the bytesSent,responseCode,result to the FileUploadResult pending release of cordova-plugin-file dependency, added some sanity checks for callbacks
-* iOS: Update for new file plugin api
-* CB-5631 Removed SimpleTrackingInputStream.read(byte[] buffer)
-* CB-5762 android: Fix lengthComputable set wrong for gzip downloads
-* CB-4899 [BlackBerry10] Improve binary file transfer download
-* Delete stale test/ directory
-* CB-5722 [BlackBerry10] Update upload function to use native file object
-* CB-5658 Delete stale snapshot of plugin docs
-* Remove @1 designation from file plugin dependency until pushed to npm
-* CB-5466: Update to work with filesystem URLs
-
-### 0.4.2 (Feb 28, 2014)
-* CB-6106 Ensure that nativeURL is used by file transfer download
-* iOS: Fix default value for trustAllHosts on iOS (YES->NO)
-* CB-6059 iOS: Stop FileTransfer.download doing IO on the UI thread.
-* CB-5588 iOS: Add response headers to upload result
-* CB-2190 iOS: Make backgroundTaskId apply to downloads as well. Move backgroundTaskId to the delegate.
-* CB-6050 Android: Use instance method on actual file plugin object to get FileEntry to return on download
-* CB-6000 Android: Nginx rejects Content-Type without a space before "boundary".
-* CB-4907 Android: Close stream when we're finished with it
-* CB-6022 Add backwards-compatibility notes to doc
-
-### 0.4.3 (Apr 17, 2014)
-* CB-6422 [windows8] use cordova/exec/proxy
-* iOS: Fix error where files were not removed on abort
-* CB-5175: [ios] CDVFileTransfer asynchronous download (Fixes #24)
-* [ios] Cast id references to NSURL to avoid compiler warnings (Fixes: apache/cordova-plugin-file-transfer#18)
-* CB-6212: [iOS] fix warnings compiled under arm64 64-bit
-* CB-5762: [FireOS] android: Fix lengthComputable set wrong for gzip downloads
-* CB-5631: [FireOS] Removed SimpleTrackingInputStream.read(byte[] buffer)
-* CB-4907: [FireOS] Close stream when we're finished with it
-* CB-6000: [FireOS] Nginx rejects Content-Type without a space before "boundary".
-* CB-6050: [FireOS] Use instance method on actual file plugin object to get FileEntry to return on download
-* CB-6460: Update license headers
diff --git a/doc/index.md b/doc/index.md
deleted file mode 100644
index eb4db58..0000000
--- a/doc/index.md
+++ /dev/null
@@ -1,277 +0,0 @@
-<!---
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
--->
-
-# org.apache.cordova.file-transfer
-
-This plugin allows you to upload and download files.
-
-## Installation
-
-    cordova plugin add org.apache.cordova.file-transfer
-
-## Supported Platforms
-
-- Amazon Fire OS
-- Android
-- BlackBerry 10*
-- iOS
-- Windows Phone 7 and 8*
-- Windows 8*
-
-\* _Do not support `onprogress` nor `abort()`_
-
-# FileTransfer
-
-The `FileTransfer` object provides a way to upload files using an HTTP
-multi-part POST request, and to download files as well.
-
-## Properties
-
-- __onprogress__: Called with a `ProgressEvent` whenever a new chunk of data is transferred. _(Function)_
-
-## Methods
-
-- __upload__: sends a file to a server.
-
-- __download__: downloads a file from server.
-
-- __abort__: Aborts an in-progress transfer.
-
-
-## upload
-
-__Parameters__:
-
-- __fileURL__: Filesystem URL representing the file on the device. For backwards compatibility, this can also be the full path of the file on the device. (See [Backwards Compatibility Notes] below)
-
-- __server__: URL of the server to receive the file, as encoded by `encodeURI()`.
-
-- __successCallback__: A callback that is passed a `Metadata` object. _(Function)_
-
-- __errorCallback__: A callback that executes if an error occurs retrieving the `Metadata`. Invoked with a `FileTransferError` object. _(Function)_
-
-- __trustAllHosts__: Optional parameter, defaults to `false`. If set to `true`, it accepts all security certificates. This is useful since Android rejects self-signed security certificates. Not recommended for production use. Supported on Android and iOS. _(boolean)_
-
-- __options__: Optional parameters _(Object)_. Valid keys:
-  - __fileKey__: The name of the form element.  Defaults to `file`. (DOMString)
-  - __fileName__: The file name to use when saving the file on the server.  Defaults to `image.jpg`. (DOMString)
-  - __mimeType__: The mime type of the data to upload.  Defaults to `image/jpeg`. (DOMString)
-  - __params__: A set of optional key/value pairs to pass in the HTTP request. (Object)
-  - __chunkedMode__: Whether to upload the data in chunked streaming mode. Defaults to `true`. (Boolean)
-  - __headers__: A map of header name/header values. Use an array to specify more than one value. (Object)
-
-### Example
-
-    // !! Assumes variable fileURL contains a valid URL to a text file on the device,
-    //    for example, cdvfile://localhost/persistent/path/to/file.txt
-
-    var win = function (r) {
-        console.log("Code = " + r.responseCode);
-        console.log("Response = " + r.response);
-        console.log("Sent = " + r.bytesSent);
-    }
-
-    var fail = function (error) {
-        alert("An error has occurred: Code = " + error.code);
-        console.log("upload error source " + error.source);
-        console.log("upload error target " + error.target);
-    }
-
-    var options = new FileUploadOptions();
-    options.fileKey = "file";
-    options.fileName = fileURL.substr(fileURL.lastIndexOf('/') + 1);
-    options.mimeType = "text/plain";
-
-    var params = {};
-    params.value1 = "test";
-    params.value2 = "param";
-
-    options.params = params;
-
-    var ft = new FileTransfer();
-    ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
-
-### Example with Upload Headers and Progress Events (Android and iOS only)
-
-    function win(r) {
-        console.log("Code = " + r.responseCode);
-        console.log("Response = " + r.response);
-        console.log("Sent = " + r.bytesSent);
-    }
-
-    function fail(error) {
-        alert("An error has occurred: Code = " + error.code);
-        console.log("upload error source " + error.source);
-        console.log("upload error target " + error.target);
-    }
-
-    var uri = encodeURI("http://some.server.com/upload.php");
-
-    var options = new FileUploadOptions();
-    options.fileKey="file";
-    options.fileName=fileURL.substr(fileURL.lastIndexOf('/')+1);
-    options.mimeType="text/plain";
-
-    var headers={'headerParam':'headerValue'};
-
-    options.headers = headers;
-
-    var ft = new FileTransfer();
-    ft.onprogress = function(progressEvent) {
-        if (progressEvent.lengthComputable) {
-          loadingStatus.setPercentage(progressEvent.loaded / progressEvent.total);
-        } else {
-          loadingStatus.increment();
-        }
-    };
-    ft.upload(fileURL, uri, win, fail, options);
-
-## FileUploadResult
-
-A `FileUploadResult` object is passed to the success callback of the
-`FileTransfer` object's `upload()` method.
-
-### Properties
-
-- __bytesSent__: The number of bytes sent to the server as part of the upload. (long)
-
-- __responseCode__: The HTTP response code returned by the server. (long)
-
-- __response__: The HTTP response returned by the server. (DOMString)
-
-- __headers__: The HTTP response headers by the server. (Object)
-  - Currently supported on iOS only.
-
-### iOS Quirks
-
-- Does not support `responseCode` or `bytesSent`.
-
-
-## download
-
-__Parameters__:
-
-- __source__: URL of the server to download the file, as encoded by `encodeURI()`.
-
-- __target__: Filesystem url representing the file on the device. For backwards compatibility, this can also be the full path of the file on the device. (See [Backwards Compatibility Notes] below)
-
-- __successCallback__: A callback that is passed  a `FileEntry` object. _(Function)_
-
-- __errorCallback__: A callback that executes if an error occurs when retrieving the `Metadata`. Invoked with a `FileTransferError` object. _(Function)_
-
-- __trustAllHosts__: Optional parameter, defaults to `false`. If set to `true`, it accepts all security certificates. This is useful because Android rejects self-signed security certificates. Not recommended for production use. Supported on Android and iOS. _(boolean)_
-
-- __options__: Optional parameters, currently only supports headers (such as Authorization (Basic Authentication), etc).
-
-### Example
-
-    // !! Assumes variable fileURL contains a valid URL to a path on the device,
-    //    for example, cdvfile://localhost/persistent/path/to/downloads/
-
-    var fileTransfer = new FileTransfer();
-    var uri = encodeURI("http://some.server.com/download.php");
-
-    fileTransfer.download(
-        uri,
-        fileURL,
-        function(entry) {
-            console.log("download complete: " + entry.fullPath);
-        },
-        function(error) {
-            console.log("download error source " + error.source);
-            console.log("download error target " + error.target);
-            console.log("upload error code" + error.code);
-        },
-        false,
-        {
-            headers: {
-                "Authorization": "Basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA=="
-            }
-        }
-    );
-
-## abort
-
-Aborts an in-progress transfer. The onerror callback is passed a FileTransferError object which has an error code of FileTransferError.ABORT_ERR.
-
-### Example
-
-    // !! Assumes variable fileURL contains a valid URL to a text file on the device,
-    //    for example, cdvfile://localhost/persistent/path/to/file.txt
-
-    var win = function(r) {
-        console.log("Should not be called.");
-    }
-
-    var fail = function(error) {
-        // error.code == FileTransferError.ABORT_ERR
-        alert("An error has occurred: Code = " + error.code);
-        console.log("upload error source " + error.source);
-        console.log("upload error target " + error.target);
-    }
-
-    var options = new FileUploadOptions();
-    options.fileKey="file";
-    options.fileName="myphoto.jpg";
-    options.mimeType="image/jpeg";
-
-    var ft = new FileTransfer();
-    ft.upload(fileURL, encodeURI("http://some.server.com/upload.php"), win, fail, options);
-    ft.abort();
-
-
-## FileTransferError
-
-A `FileTransferError` object is passed to an error callback when an error occurs.
-
-### Properties
-
-- __code__: One of the predefined error codes listed below. (Number)
-
-- __source__: URL to the source. (String)
-
-- __target__: URL to the target. (String)
-
-- __http_status__: HTTP status code.  This attribute is only available when a response code is received from the HTTP connection. (Number)
-
-### Constants
-
-- `FileTransferError.FILE_NOT_FOUND_ERR`
-- `FileTransferError.INVALID_URL_ERR`
-- `FileTransferError.CONNECTION_ERR`
-- `FileTransferError.ABORT_ERR`
-
-## Backwards Compatibility Notes
-
-Previous versions of this plugin would only accept device-absolute-file-paths as the source for uploads, or as the target for downloads. These paths would typically be of the form
-
-    /var/mobile/Applications/<application UUID>/Documents/path/to/file  (iOS)
-    /storage/emulated/0/path/to/file                                    (Android)
-
-For backwards compatibility, these paths are still accepted, and if your application has recorded paths like these in persistent storage, then they can continue to be used.
-
-These paths were previously exposed in the `fullPath` property of `FileEntry` and `DirectoryEntry` objects returned by the File plugin. New versions of the File plugin, however, no longer expose these paths to JavaScript.
-
-If you are upgrading to a new (1.0.0 or newer) version of File, and you have previously been using `entry.fullPath` as arguments to `download()` or `upload()`, then you will need to change your code to use filesystem URLs instead.
-
-`FileEntry.toURL()` and `DirectoryEntry.toURL()` return a filesystem URL of the form
-
-    cdvfile://localhost/persistent/path/to/file
-
-which can be used in place of the absolute file path in both `download()` and `upload()` methods.
diff --git a/plugin.xml b/plugin.xml
deleted file mode 100644
index 333123b..0000000
--- a/plugin.xml
+++ /dev/null
@@ -1,141 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-
-<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    id="org.apache.cordova.file-transfer"
-    version="0.4.4-dev">
-    <name>File Transfer</name>
-    <description>Cordova File Transfer Plugin</description>
-    <license>Apache 2.0</license>
-    <keywords>cordova,file,transfer</keywords>
-    <repo>https://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer.git</repo>
-    <issue>https://issues.apache.org/jira/browse/CB/component/12320650</issue>
-
-    <!-- dependency id="org.apache.cordova.file@1" /-->
-    <dependency id="org.apache.cordova.file" version="1.0.1" />
-
-    <js-module src="www/FileTransferError.js" name="FileTransferError">
-        <clobbers target="window.FileTransferError" />
-    </js-module>
-
-    <js-module src="www/FileTransfer.js" name="FileTransfer">
-        <clobbers target="window.FileTransfer" />
-    </js-module>
-
-    <!-- android -->
-    <platform name="android">
-        <config-file target="res/xml/config.xml" parent="/*">
-            <feature name="FileTransfer" >
-                <param name="android-package" value="org.apache.cordova.filetransfer.FileTransfer"/>
-            </feature>
-        </config-file>
-
-        <config-file target="AndroidManifest.xml" parent="/*">
-            <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
-        </config-file>
-
-        <source-file src="src/android/FileTransfer.java" target-dir="src/org/apache/cordova/filetransfer" />
-        <source-file src="src/android/FileProgressResult.java" target-dir="src/org/apache/cordova/filetransfer" />
-        <source-file src="src/android/FileUploadResult.java" target-dir="src/org/apache/cordova/filetransfer" />
-    </platform>
-
-    <!-- amamzon-fireos -->
-    <platform name="amazon-fireos">
-        <config-file target="res/xml/config.xml" parent="/*">
-            <feature name="FileTransfer" >
-                <param name="android-package" value="org.apache.cordova.filetransfer.FileTransfer"/>
-            </feature>
-        </config-file>
-
-        <config-file target="AndroidManifest.xml" parent="/*">
-            <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
-        </config-file>
-
-        <source-file src="src/amazon/FileTransfer.java" target-dir="src/org/apache/cordova/filetransfer" />
-        <source-file src="src/android/FileProgressResult.java" target-dir="src/org/apache/cordova/filetransfer" />
-        <source-file src="src/android/FileUploadResult.java" target-dir="src/org/apache/cordova/filetransfer" />
-    </platform>
-    
-    <!-- ubuntu -->
-    <platform name="ubuntu">
-        <header-file src="src/ubuntu/file-transfer.h" />
-        <source-file src="src/ubuntu/file-transfer.cpp" />
-    </platform>
-
-    <platform name="blackberry10">
-        <config-file target="www/config.xml" parent="/widget">
-            <feature name="FileTransfer" value="FileTransfer"></feature>
-        </config-file>
-        <js-module src="www/blackberry10/FileTransfer.js" name="BB10FileTransfer">
-            <clobbers target="window.FileTransfer"></clobbers>
-        </js-module>
-        <js-module src="www/blackberry10/XHRImplementation.js" name="BB10XHRImplementation"></js-module>
-    </platform>
-
-    <!-- ios -->
-    <platform name="ios">
-        <config-file target="config.xml" parent="/*">
-            <feature name="FileTransfer">
-                <param name="ios-package" value="CDVFileTransfer" />
-            </feature>
-        </config-file>
-        <header-file src="src/ios/CDVFileTransfer.h" />
-        <source-file src="src/ios/CDVFileTransfer.m" />
-
-        <framework src="AssetsLibrary.framework" />
-    </platform>
-
-    <!-- wp7 -->
-    <platform name="wp7">
-        <config-file target="config.xml" parent="/*">
-            <feature name="FileTransfer">
-                <param name="wp-package" value="FileTransfer"/>
-            </feature>
-        </config-file>
-
-        <source-file src="src/wp/FileTransfer.cs" />
-
-        <js-module src="www/wp7/base64.js" name="base64">
-            <clobbers target="window.FileTransferBase64" />
-        </js-module>
-
-    </platform>
-
-    <!-- wp8 -->
-    <platform name="wp8">
-        <config-file target="config.xml" parent="/*">
-            <feature name="FileTransfer">
-                <param name="wp-package" value="FileTransfer"/>
-            </feature>
-        </config-file>
-
-        <source-file src="src/wp/FileTransfer.cs" />
-
-    </platform>
-
-    <!-- windows8 -->
-    <platform name="windows8">
-        <js-module src="www/windows8/FileTransferProxy.js" name="FileTransferProxy">
-            <clobbers target="" />
-        </js-module>
-    </platform>
-
-</plugin>
diff --git a/src/amazon/FileTransfer.java b/src/amazon/FileTransfer.java
deleted file mode 100644
index 513400e..0000000
--- a/src/amazon/FileTransfer.java
+++ /dev/null
@@ -1,888 +0,0 @@
-/*
-       Licensed to the Apache Software Foundation (ASF) under one
-       or more contributor license agreements.  See the NOTICE file
-       distributed with this work for additional information
-       regarding copyright ownership.  The ASF licenses this file
-       to you under the Apache License, Version 2.0 (the
-       "License"); you may not use this file except in compliance
-       with the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-       Unless required by applicable law or agreed to in writing,
-       software distributed under the License is distributed on an
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-       KIND, either express or implied.  See the License for the
-       specific language governing permissions and limitations
-       under the License.
-*/
-package org.apache.cordova.filetransfer;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayOutputStream;
-import java.io.Closeable;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FilterInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import java.net.HttpURLConnection;
-import java.net.URLConnection;
-import java.net.URLDecoder;
-import java.security.cert.CertificateException;
-import java.security.cert.X509Certificate;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.zip.GZIPInputStream;
-import java.util.zip.Inflater;
-
-import javax.net.ssl.HostnameVerifier;
-import javax.net.ssl.HttpsURLConnection;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSession;
-import javax.net.ssl.SSLSocketFactory;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.X509TrustManager;
-
-import org.apache.cordova.Config;
-import org.apache.cordova.CallbackContext;
-import org.apache.cordova.CordovaPlugin;
-import org.apache.cordova.CordovaResourceApi;
-import org.apache.cordova.CordovaResourceApi.OpenForReadResult;
-import org.apache.cordova.PluginResult;
-import org.apache.cordova.file.FileUtils;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import android.net.Uri;
-import android.os.Build;
-import android.util.Log;
-import com.amazon.android.webkit.AmazonCookieManager;
-
-public class FileTransfer extends CordovaPlugin {
-
-    private static final String LOG_TAG = "FileTransfer";
-    private static final String LINE_START = "--";
-    private static final String LINE_END = "\r\n";
-    private static final String BOUNDARY =  "+++++";
-
-    public static int FILE_NOT_FOUND_ERR = 1;
-    public static int INVALID_URL_ERR = 2;
-    public static int CONNECTION_ERR = 3;
-    public static int ABORTED_ERR = 4;
-
-    private static HashMap<String, RequestContext> activeRequests = new HashMap<String, RequestContext>();
-    private static final int MAX_BUFFER_SIZE = 16 * 1024;
-
-    private static final class RequestContext {
-        String source;
-        String target;
-        File targetFile;
-        CallbackContext callbackContext;
-        InputStream currentInputStream;
-        OutputStream currentOutputStream;
-        boolean aborted;
-        RequestContext(String source, String target, CallbackContext callbackContext) {
-            this.source = source;
-            this.target = target;
-            this.callbackContext = callbackContext;
-        }
-        void sendPluginResult(PluginResult pluginResult) {
-            synchronized (this) {
-                if (!aborted) {
-                    callbackContext.sendPluginResult(pluginResult);
-                }
-            }
-        }
-    }
-
-    /**
-     * Adds an interface method to an InputStream to return the number of bytes
-     * read from the raw stream. This is used to track total progress against
-     * the HTTP Content-Length header value from the server.
-     */
-    private static abstract class TrackingInputStream extends FilterInputStream {
-      public TrackingInputStream(final InputStream in) {
-        super(in);
-      }
-        public abstract long getTotalRawBytesRead();
-  }
-
-    private static class ExposedGZIPInputStream extends GZIPInputStream {
-      public ExposedGZIPInputStream(final InputStream in) throws IOException {
-        super(in);
-      }
-      public Inflater getInflater() {
-        return inf;
-      }
-  }
-
-    /**
-     * Provides raw bytes-read tracking for a GZIP input stream. Reports the
-     * total number of compressed bytes read from the input, rather than the
-     * number of uncompressed bytes.
-     */
-    private static class TrackingGZIPInputStream extends TrackingInputStream {
-      private ExposedGZIPInputStream gzin;
-      public TrackingGZIPInputStream(final ExposedGZIPInputStream gzin) throws IOException {
-        super(gzin);
-        this.gzin = gzin;
-      }
-      public long getTotalRawBytesRead() {
-        return gzin.getInflater().getBytesRead();
-      }
-  }
-
-    /**
-     * Provides simple total-bytes-read tracking for an existing InputStream
-     */
-    private static class SimpleTrackingInputStream extends TrackingInputStream {
-        private long bytesRead = 0;
-        public SimpleTrackingInputStream(InputStream stream) {
-            super(stream);
-        }
-
-        private int updateBytesRead(int newBytesRead) {
-          if (newBytesRead != -1) {
-            bytesRead += newBytesRead;
-          }
-          return newBytesRead;
-        }
-
-        @Override
-        public int read() throws IOException {
-            return updateBytesRead(super.read());
-        }
-
-        // Note: FilterInputStream delegates read(byte[] bytes) to the below method,
-        // so we don't override it or else double count (CB-5631).
-        @Override
-        public int read(byte[] bytes, int offset, int count) throws IOException {
-            return updateBytesRead(super.read(bytes, offset, count));
-        }
-
-        public long getTotalRawBytesRead() {
-          return bytesRead;
-        }
-    }
-
-    @Override
-    public boolean execute(String action, JSONArray args, final CallbackContext callbackContext) throws JSONException {
-        if (action.equals("upload") || action.equals("download")) {
-            String source = args.getString(0);
-            String target = args.getString(1);
-
-            if (action.equals("upload")) {
-                try {
-                    source = URLDecoder.decode(source, "UTF-8");
-                    upload(source, target, args, callbackContext);
-                } catch (UnsupportedEncodingException e) {
-                    callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.MALFORMED_URL_EXCEPTION, "UTF-8 error."));
-                }
-            } else {
-                download(source, target, args, callbackContext);
-            }
-            return true;
-        } else if (action.equals("abort")) {
-            String objectId = args.getString(0);
-            abort(objectId);
-            callbackContext.success();
-            return true;
-        }
-        return false;
-    }
-
-    private static void addHeadersToRequest(URLConnection connection, JSONObject headers) {
-        try {
-            for (Iterator<?> iter = headers.keys(); iter.hasNext(); ) {
-                String headerKey = iter.next().toString();
-                JSONArray headerValues = headers.optJSONArray(headerKey);
-                if (headerValues == null) {
-                    headerValues = new JSONArray();
-                    headerValues.put(headers.getString(headerKey));
-                }
-                connection.setRequestProperty(headerKey, headerValues.getString(0));
-                for (int i = 1; i < headerValues.length(); ++i) {
-                    connection.addRequestProperty(headerKey, headerValues.getString(i));
-                }
-            }
-        } catch (JSONException e1) {
-          // No headers to be manipulated!
-        }
-    }
-
-    /**
-     * Uploads the specified file to the server URL provided using an HTTP multipart request.
-     * @param source        Full path of the file on the file system
-     * @param target        URL of the server to receive the file
-     * @param args          JSON Array of args
-     * @param callbackContext    callback id for optional progress reports
-     *
-     * args[2] fileKey       Name of file request parameter
-     * args[3] fileName      File name to be used on server
-     * args[4] mimeType      Describes file content type
-     * args[5] params        key:value pairs of user-defined parameters
-     * @return FileUploadResult containing result of upload request
-     */
-    private void upload(final String source, final String target, JSONArray args, CallbackContext callbackContext) throws JSONException {
-        Log.d(LOG_TAG, "upload " + source + " to " +  target);
-
-        // Setup the options
-        final String fileKey = getArgument(args, 2, "file");
-        final String fileName = getArgument(args, 3, "image.jpg");
-        final String mimeType = getArgument(args, 4, "image/jpeg");
-        final JSONObject params = args.optJSONObject(5) == null ? new JSONObject() : args.optJSONObject(5);
-        final boolean trustEveryone = args.optBoolean(6);
-        // Always use chunked mode unless set to false as per API
-        final boolean chunkedMode = args.optBoolean(7) || args.isNull(7);
-        // Look for headers on the params map for backwards compatibility with older Cordova versions.
-        final JSONObject headers = args.optJSONObject(8) == null ? params.optJSONObject("headers") : args.optJSONObject(8);
-        final String objectId = args.getString(9);
-        final String httpMethod = getArgument(args, 10, "POST");
-        
-        final CordovaResourceApi resourceApi = webView.getResourceApi();
-
-        Log.d(LOG_TAG, "fileKey: " + fileKey);
-        Log.d(LOG_TAG, "fileName: " + fileName);
-        Log.d(LOG_TAG, "mimeType: " + mimeType);
-        Log.d(LOG_TAG, "params: " + params);
-        Log.d(LOG_TAG, "trustEveryone: " + trustEveryone);
-        Log.d(LOG_TAG, "chunkedMode: " + chunkedMode);
-        Log.d(LOG_TAG, "headers: " + headers);
-        Log.d(LOG_TAG, "objectId: " + objectId);
-        Log.d(LOG_TAG, "httpMethod: " + httpMethod);
-        
-        final Uri targetUri = resourceApi.remapUri(Uri.parse(target));
-        // Accept a path or a URI for the source.
-        Uri tmpSrc = Uri.parse(source);
-        final Uri sourceUri = resourceApi.remapUri(
-            tmpSrc.getScheme() != null ? tmpSrc : Uri.fromFile(new File(source)));
-
-        int uriType = CordovaResourceApi.getUriType(targetUri);
-        final boolean useHttps = uriType == CordovaResourceApi.URI_TYPE_HTTPS;
-        if (uriType != CordovaResourceApi.URI_TYPE_HTTP && !useHttps) {
-            JSONObject error = createFileTransferError(INVALID_URL_ERR, source, target, null, 0);
-            Log.e(LOG_TAG, "Unsupported URI: " + targetUri);
-            callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, error));
-            return;
-        }
-
-        final RequestContext context = new RequestContext(source, target, callbackContext);
-        synchronized (activeRequests) {
-            activeRequests.put(objectId, context);
-        }
-        
-        cordova.getThreadPool().execute(new Runnable() {
-            public void run() {
-                if (context.aborted) {
-                    return;
-                }
-                HttpURLConnection conn = null;
-                HostnameVerifier oldHostnameVerifier = null;
-                SSLSocketFactory oldSocketFactory = null;
-                int totalBytes = 0;
-                int fixedLength = -1;
-                try {
-                    // Create return object
-                    FileUploadResult result = new FileUploadResult();
-                    FileProgressResult progress = new FileProgressResult();
-
-                    //------------------ CLIENT REQUEST
-                    // Open a HTTP connection to the URL based on protocol
-                    conn = resourceApi.createHttpConnection(targetUri);
-                    if (useHttps && trustEveryone) {
-                        // Setup the HTTPS connection class to trust everyone
-                        HttpsURLConnection https = (HttpsURLConnection)conn;
-                        oldSocketFactory  = trustAllHosts(https);
-                        // Save the current hostnameVerifier
-                        oldHostnameVerifier = https.getHostnameVerifier();
-                        // Setup the connection not to verify hostnames
-                        https.setHostnameVerifier(DO_NOT_VERIFY);
-                    }
-
-                    // Allow Inputs
-                    conn.setDoInput(true);
-
-                    // Allow Outputs
-                    conn.setDoOutput(true);
-
-                    // Don't use a cached copy.
-                    conn.setUseCaches(false);
-
-                    // Use a post method.
-                    conn.setRequestMethod(httpMethod);
-                    conn.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + BOUNDARY);
-
-                    // Set the cookies on the response
-                    String cookie = AmazonCookieManager.getInstance().getCookie(target);
-                    if (cookie != null) {
-                        conn.setRequestProperty("Cookie", cookie);
-                    }
-
-                    // Handle the other headers
-                    if (headers != null) {
-                        addHeadersToRequest(conn, headers);
-                    }
-
-                    /*
-                        * Store the non-file portions of the multipart data as a string, so that we can add it
-                        * to the contentSize, since it is part of the body of the HTTP request.
-                        */
-                    StringBuilder beforeData = new StringBuilder();
-                    try {
-                        for (Iterator<?> iter = params.keys(); iter.hasNext();) {
-                            Object key = iter.next();
-                            if(!String.valueOf(key).equals("headers"))
-                            {
-                              beforeData.append(LINE_START).append(BOUNDARY).append(LINE_END);
-                              beforeData.append("Content-Disposition: form-data; name=\"").append(key.toString()).append('"');
-                              beforeData.append(LINE_END).append(LINE_END);
-                              beforeData.append(params.getString(key.toString()));
-                              beforeData.append(LINE_END);
-                            }
-                        }
-                    } catch (JSONException e) {
-                        Log.e(LOG_TAG, e.getMessage(), e);
-                    }
-
-                    beforeData.append(LINE_START).append(BOUNDARY).append(LINE_END);
-                    beforeData.append("Content-Disposition: form-data; name=\"").append(fileKey).append("\";");
-                    beforeData.append(" filename=\"").append(fileName).append('"').append(LINE_END);
-                    beforeData.append("Content-Type: ").append(mimeType).append(LINE_END).append(LINE_END);
-                    byte[] beforeDataBytes = beforeData.toString().getBytes("UTF-8");
-                    byte[] tailParamsBytes = (LINE_END + LINE_START + BOUNDARY + LINE_START + LINE_END).getBytes("UTF-8");
-
-                    
-                    // Get a input stream of the file on the phone
-                    OpenForReadResult readResult = resourceApi.openForRead(sourceUri);
-                    
-                    int stringLength = beforeDataBytes.length + tailParamsBytes.length;
-                    if (readResult.length >= 0) {
-                        fixedLength = (int)readResult.length + stringLength;
-                        progress.setLengthComputable(true);
-                        progress.setTotal(fixedLength);
-                    }
-                    Log.d(LOG_TAG, "Content Length: " + fixedLength);
-                    // setFixedLengthStreamingMode causes and OutOfMemoryException on pre-Froyo devices.
-                    // http://code.google.com/p/android/issues/detail?id=3164
-                    // It also causes OOM if HTTPS is used, even on newer devices.
-                    boolean useChunkedMode = chunkedMode && (Build.VERSION.SDK_INT < Build.VERSION_CODES.FROYO || useHttps);
-                    useChunkedMode = useChunkedMode || (fixedLength == -1);
-
-                    if (useChunkedMode) {
-                        conn.setChunkedStreamingMode(MAX_BUFFER_SIZE);
-                        // Although setChunkedStreamingMode sets this header, setting it explicitly here works
-                        // around an OutOfMemoryException when using https.
-                        conn.setRequestProperty("Transfer-Encoding", "chunked");
-                    } else {
-                        conn.setFixedLengthStreamingMode(fixedLength);
-                    }
-
-                    conn.connect();
-                    
-                    OutputStream sendStream = null;
-                    try {
-                        sendStream = conn.getOutputStream();
-                        synchronized (context) {
-                            if (context.aborted) {
-                                return;
-                            }
-                            context.currentOutputStream = sendStream;
-                        }
-                        //We don't want to change encoding, we just want this to write for all Unicode.
-                        sendStream.write(beforeDataBytes);
-                        totalBytes += beforeDataBytes.length;
-    
-                        // create a buffer of maximum size
-                        int bytesAvailable = readResult.inputStream.available();
-                        int bufferSize = Math.min(bytesAvailable, MAX_BUFFER_SIZE);
-                        byte[] buffer = new byte[bufferSize];
-    
-                        // read file and write it into form...
-                        int bytesRead = readResult.inputStream.read(buffer, 0, bufferSize);
-    
-                        long prevBytesRead = 0;
-                        while (bytesRead > 0) {
-                            result.setBytesSent(totalBytes);
-                            sendStream.write(buffer, 0, bytesRead);
-                            totalBytes += bytesRead;
-                            if (totalBytes > prevBytesRead + 102400) {
-                                prevBytesRead = totalBytes;
-                                Log.d(LOG_TAG, "Uploaded " + totalBytes + " of " + fixedLength + " bytes");
-                            }
-                            bytesAvailable = readResult.inputStream.available();
-                            bufferSize = Math.min(bytesAvailable, MAX_BUFFER_SIZE);
-                            bytesRead = readResult.inputStream.read(buffer, 0, bufferSize);
-
-                            // Send a progress event.
-                            progress.setLoaded(totalBytes);
-                            PluginResult progressResult = new PluginResult(PluginResult.Status.OK, progress.toJSONObject());
-                            progressResult.setKeepCallback(true);
-                            context.sendPluginResult(progressResult);
-                        }
-    
-                        // send multipart form data necessary after file data...
-                        sendStream.write(tailParamsBytes);
-                        totalBytes += tailParamsBytes.length;
-                        sendStream.flush();
-                    } finally {
-                        safeClose(readResult.inputStream);
-                        safeClose(sendStream);
-                    }
-                    context.currentOutputStream = null;
-                    Log.d(LOG_TAG, "Sent " + totalBytes + " of " + fixedLength);
-
-                    //------------------ read the SERVER RESPONSE
-                    String responseString;
-                    int responseCode = conn.getResponseCode();
-                    Log.d(LOG_TAG, "response code: " + responseCode);
-                    Log.d(LOG_TAG, "response headers: " + conn.getHeaderFields());
-                    TrackingInputStream inStream = null;
-                    try {
-                        inStream = getInputStream(conn);
-                        synchronized (context) {
-                            if (context.aborted) {
-                                return;
-                            }
-                            context.currentInputStream = inStream;
-                        }
-                        
-                        ByteArrayOutputStream out = new ByteArrayOutputStream(Math.max(1024, conn.getContentLength()));
-                        byte[] buffer = new byte[1024];
-                        int bytesRead = 0;
-                        // write bytes to file
-                        while ((bytesRead = inStream.read(buffer)) > 0) {
-                            out.write(buffer, 0, bytesRead);
-                        }
-                        responseString = out.toString("UTF-8");
-                    } finally {
-                        context.currentInputStream = null;
-                        safeClose(inStream);
-                    }
-                    
-                    Log.d(LOG_TAG, "got response from server");
-                    Log.d(LOG_TAG, responseString.substring(0, Math.min(256, responseString.length())));
-                    
-                    // send request and retrieve response
-                    result.setResponseCode(responseCode);
-                    result.setResponse(responseString);
-
-                    context.sendPluginResult(new PluginResult(PluginResult.Status.OK, result.toJSONObject()));
-                } catch (FileNotFoundException e) {
-                    JSONObject error = createFileTransferError(FILE_NOT_FOUND_ERR, source, target, conn);
-                    Log.e(LOG_TAG, error.toString(), e);
-                    context.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, error));
-                } catch (IOException e) {
-                    JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, conn);
-                    Log.e(LOG_TAG, error.toString(), e);
-                    Log.e(LOG_TAG, "Failed after uploading " + totalBytes + " of " + fixedLength + " bytes.");
-                    context.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, error));
-                } catch (JSONException e) {
-                    Log.e(LOG_TAG, e.getMessage(), e);
-                    context.sendPluginResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION));
-                } catch (Throwable t) {
-                    // Shouldn't happen, but will
-                    JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, conn);
-                    Log.e(LOG_TAG, error.toString(), t);
-                    context.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, error));
-                } finally {
-                    synchronized (activeRequests) {
-                        activeRequests.remove(objectId);
-                    }
-
-                    if (conn != null) {
-                        // Revert back to the proper verifier and socket factories
-                        // Revert back to the proper verifier and socket factories
-                        if (trustEveryone && useHttps) {
-                            HttpsURLConnection https = (HttpsURLConnection) conn;
-                            https.setHostnameVerifier(oldHostnameVerifier);
-                            https.setSSLSocketFactory(oldSocketFactory);
-                        }
-                    }
-                }                
-            }
-        });
-    }
-
-    private static void safeClose(Closeable stream) {
-        if (stream != null) {
-            try {
-                stream.close();
-            } catch (IOException e) {
-            }
-        }
-    }
-
-    private static TrackingInputStream getInputStream(URLConnection conn) throws IOException {
-        String encoding = conn.getContentEncoding();
-        if (encoding != null && encoding.equalsIgnoreCase("gzip")) {
-          return new TrackingGZIPInputStream(new ExposedGZIPInputStream(conn.getInputStream()));
-        }
-        return new SimpleTrackingInputStream(conn.getInputStream());
-    }
-
-    // always verify the host - don't check for certificate
-    private static final HostnameVerifier DO_NOT_VERIFY = new HostnameVerifier() {
-        public boolean verify(String hostname, SSLSession session) {
-            return true;
-        }
-    };
-    // Create a trust manager that does not validate certificate chains
-    private static final TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {
-        public java.security.cert.X509Certificate[] getAcceptedIssuers() {
-            return new java.security.cert.X509Certificate[] {};
-        }
-        
-        public void checkClientTrusted(X509Certificate[] chain,
-                String authType) throws CertificateException {
-        }
-        
-        public void checkServerTrusted(X509Certificate[] chain,
-                String authType) throws CertificateException {
-        }
-    } };
-
-    /**
-     * This function will install a trust manager that will blindly trust all SSL
-     * certificates.  The reason this code is being added is to enable developers
-     * to do development using self signed SSL certificates on their web server.
-     *
-     * The standard HttpsURLConnection class will throw an exception on self
-     * signed certificates if this code is not run.
-     */
-    private static SSLSocketFactory trustAllHosts(HttpsURLConnection connection) {
-        // Install the all-trusting trust manager
-        SSLSocketFactory oldFactory = connection.getSSLSocketFactory();
-        try {
-            // Install our all trusting manager
-            SSLContext sc = SSLContext.getInstance("TLS");
-            sc.init(null, trustAllCerts, new java.security.SecureRandom());
-            SSLSocketFactory newFactory = sc.getSocketFactory();
-            connection.setSSLSocketFactory(newFactory);
-        } catch (Exception e) {
-            Log.e(LOG_TAG, e.getMessage(), e);
-        }
-        return oldFactory;
-    }
-
-    private static JSONObject createFileTransferError(int errorCode, String source, String target, URLConnection connection) {
-
-        int httpStatus = 0;
-        StringBuilder bodyBuilder = new StringBuilder();
-        String body = null;
-        if (connection != null) {
-            try {
-                if (connection instanceof HttpURLConnection) {
-                    httpStatus = ((HttpURLConnection)connection).getResponseCode();
-                    InputStream err = ((HttpURLConnection) connection).getErrorStream();
-                    if(err != null)
-                    {
-                        BufferedReader reader = new BufferedReader(new InputStreamReader(err, "UTF-8"));
-                        try {
-                            String line = reader.readLine();
-                            while(line != null) {
-                                bodyBuilder.append(line);
-                                line = reader.readLine();
-                                if(line != null) {
-                                    bodyBuilder.append('\n');
-                                }
-                            }
-                            body = bodyBuilder.toString();
-                        } finally {
-                            reader.close();
-                        }
-                    }
-                }
-            // IOException can leave connection object in a bad state, so catch all exceptions.
-            } catch (Throwable e) {
-                Log.w(LOG_TAG, "Error getting HTTP status code from connection.", e);
-            }
-        }
-
-        return createFileTransferError(errorCode, source, target, body, httpStatus);
-    }
-
-        /**
-        * Create an error object based on the passed in errorCode
-        * @param errorCode      the error
-        * @return JSONObject containing the error
-        */
-    private static JSONObject createFileTransferError(int errorCode, String source, String target, String body, Integer httpStatus) {
-        JSONObject error = null;
-        try {
-            error = new JSONObject();
-            error.put("code", errorCode);
-            error.put("source", source);
-            error.put("target", target);
-            if(body != null)
-            {
-                error.put("body", body);
-            }   
-            if (httpStatus != null) {
-                error.put("http_status", httpStatus);
-            }
-        } catch (JSONException e) {
-            Log.e(LOG_TAG, e.getMessage(), e);
-        }
-        return error;
-    }
-
-    /**
-     * Convenience method to read a parameter from the list of JSON args.
-     * @param args                      the args passed to the Plugin
-     * @param position          the position to retrieve the arg from
-     * @param defaultString the default to be used if the arg does not exist
-     * @return String with the retrieved value
-     */
-    private static String getArgument(JSONArray args, int position, String defaultString) {
-        String arg = defaultString;
-        if (args.length() > position) {
-            arg = args.optString(position);
-            if (arg == null || "null".equals(arg)) {
-                arg = defaultString;
-            }
-        }
-        return arg;
-    }
-
-    /**
-     * Downloads a file form a given URL and saves it to the specified directory.
-     *
-     * @param source        URL of the server to receive the file
-     * @param target            Full path of the file on the file system
-     */
-    private void download(final String source, final String target, JSONArray args, CallbackContext callbackContext) throws JSONException {
-        Log.d(LOG_TAG, "download " + source + " to " +  target);
-
-        final CordovaResourceApi resourceApi = webView.getResourceApi();
-
-        final boolean trustEveryone = args.optBoolean(2);
-        final String objectId = args.getString(3);
-        final JSONObject headers = args.optJSONObject(4);
-        
-        final Uri sourceUri = resourceApi.remapUri(Uri.parse(source));
-        // Accept a path or a URI for the source.
-        Uri tmpTarget = Uri.parse(target);
-        final Uri targetUri = resourceApi.remapUri(
-            tmpTarget.getScheme() != null ? tmpTarget : Uri.fromFile(new File(target)));
-
-        int uriType = CordovaResourceApi.getUriType(sourceUri);
-        final boolean useHttps = uriType == CordovaResourceApi.URI_TYPE_HTTPS;
-        final boolean isLocalTransfer = !useHttps && uriType != CordovaResourceApi.URI_TYPE_HTTP;
-        if (uriType == CordovaResourceApi.URI_TYPE_UNKNOWN) {
-            JSONObject error = createFileTransferError(INVALID_URL_ERR, source, target, null, 0);
-            Log.e(LOG_TAG, "Unsupported URI: " + targetUri);
-            callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, error));
-            return;
-        }
-        
-        // TODO: refactor to also allow resources & content:
-        if (!isLocalTransfer && !Config.isUrlWhiteListed(source)) {
-            Log.w(LOG_TAG, "Source URL is not in white list: '" + source + "'");
-            JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, null, 401);
-            callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, error));
-            return;
-        }
-
-        
-        final RequestContext context = new RequestContext(source, target, callbackContext);
-        synchronized (activeRequests) {
-            activeRequests.put(objectId, context);
-        }
-        
-        cordova.getThreadPool().execute(new Runnable() {
-            public void run() {
-                if (context.aborted) {
-                    return;
-                }
-                HttpURLConnection connection = null;
-                HostnameVerifier oldHostnameVerifier = null;
-                SSLSocketFactory oldSocketFactory = null;
-                File file = null;
-                PluginResult result = null;
-                TrackingInputStream inputStream = null;
-
-                OutputStream outputStream = null;
-                try {
-                    OpenForReadResult readResult = null;
-                    outputStream = resourceApi.openOutputStream(targetUri);
-
-                    file = resourceApi.mapUriToFile(targetUri);
-                    context.targetFile = file;
-                    
-                    Log.d(LOG_TAG, "Download file:" + sourceUri);
-
-                    FileProgressResult progress = new FileProgressResult();
-
-                    if (isLocalTransfer) {
-                        readResult = resourceApi.openForRead(sourceUri);
-                        if (readResult.length != -1) {
-                            progress.setLengthComputable(true);
-                            progress.setTotal(readResult.length);
-                        }
-                        inputStream = new SimpleTrackingInputStream(readResult.inputStream);
-                    } else {
-                        // connect to server
-                        // Open a HTTP connection to the URL based on protocol
-                        connection = resourceApi.createHttpConnection(sourceUri);
-                        if (useHttps && trustEveryone) {
-                            // Setup the HTTPS connection class to trust everyone
-                            HttpsURLConnection https = (HttpsURLConnection)connection;
-                            oldSocketFactory = trustAllHosts(https);
-                            // Save the current hostnameVerifier
-                            oldHostnameVerifier = https.getHostnameVerifier();
-                            // Setup the connection not to verify hostnames
-                            https.setHostnameVerifier(DO_NOT_VERIFY);
-                        }
-        
-                        connection.setRequestMethod("GET");
-        
-                        // TODO: Make OkHttp use this AmazonCookieManager by default.
-                        String cookie = AmazonCookieManager.getInstance().getCookie(sourceUri.toString());
-                        if(cookie != null)
-                        {
-                            connection.setRequestProperty("cookie", cookie);
-                        }
-                        
-                        // This must be explicitly set for gzip progress tracking to work.
-                        connection.setRequestProperty("Accept-Encoding", "gzip");
-    
-                        // Handle the other headers
-                        if (headers != null) {
-                            addHeadersToRequest(connection, headers);
-                        }
-        
-                        connection.connect();
-    
-                        if (connection.getContentEncoding() == null || connection.getContentEncoding().equalsIgnoreCase("gzip")) {
-                            // Only trust content-length header if we understand
-                            // the encoding -- identity or gzip
-                            if (connection.getContentLength() != -1) {
-                                progress.setLengthComputable(true);
-                                progress.setTotal(connection.getContentLength());
-                            }
-                        }
-                        inputStream = getInputStream(connection);
-                    }
-                    
-                    try {
-                        synchronized (context) {
-                            if (context.aborted) {
-                                return;
-                            }
-                            context.currentInputStream = inputStream;
-                        }
-                        
-                        // write bytes to file
-                        byte[] buffer = new byte[MAX_BUFFER_SIZE];
-                        int bytesRead = 0;
-                        while ((bytesRead = inputStream.read(buffer)) > 0) {
-                            outputStream.write(buffer, 0, bytesRead);
-                            // Send a progress event.
-                            progress.setLoaded(inputStream.getTotalRawBytesRead());
-                            PluginResult progressResult = new PluginResult(PluginResult.Status.OK, progress.toJSONObject());
-                            progressResult.setKeepCallback(true);
-                            context.sendPluginResult(progressResult);
-                        }
-                    } finally {
-                        context.currentInputStream = null;
-                        safeClose(inputStream);
-                        safeClose(outputStream);
-                    }
-    
-                    Log.d(LOG_TAG, "Saved file: " + target);
-    
-                    // create FileEntry object
-                    FileUtils filePlugin = (FileUtils)webView.pluginManager.getPlugin("File");
-                    if (filePlugin != null) {
-                        JSONObject fileEntry = filePlugin.getEntryForFile(file);
-                        if (fileEntry != null) {
-                            result = new PluginResult(PluginResult.Status.OK, fileEntry);
-                        } else {
-                            JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, connection);
-                            Log.e(LOG_TAG, "File plugin cannot represent download path");
-                            result = new PluginResult(PluginResult.Status.IO_EXCEPTION, error);
-                        }
-                    } else {
-                        Log.e(LOG_TAG, "File plugin not found; cannot save downloaded file");
-                        result = new PluginResult(PluginResult.Status.ERROR, "File plugin not found; cannot save downloaded file");
-                    }
-
-                } catch (FileNotFoundException e) {
-                    JSONObject error = createFileTransferError(FILE_NOT_FOUND_ERR, source, target, connection);
-                    Log.e(LOG_TAG, error.toString(), e);
-                    result = new PluginResult(PluginResult.Status.IO_EXCEPTION, error);
-                } catch (IOException e) {
-                    JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, connection);
-                    Log.e(LOG_TAG, error.toString(), e);
-                    result = new PluginResult(PluginResult.Status.IO_EXCEPTION, error);
-                } catch (JSONException e) {
-                    Log.e(LOG_TAG, e.getMessage(), e);
-                    result = new PluginResult(PluginResult.Status.JSON_EXCEPTION);
-                } catch (Throwable e) {
-                    JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, connection);
-                    Log.e(LOG_TAG, error.toString(), e);
-                    result = new PluginResult(PluginResult.Status.IO_EXCEPTION, error);
-                } finally {
-                    safeClose(outputStream);
-                    synchronized (activeRequests) {
-                        activeRequests.remove(objectId);
-                    }
-
-                    if (connection != null) {
-                        // Revert back to the proper verifier and socket factories
-                        if (trustEveryone && useHttps) {
-                            HttpsURLConnection https = (HttpsURLConnection) connection;
-                            https.setHostnameVerifier(oldHostnameVerifier);
-                            https.setSSLSocketFactory(oldSocketFactory);
-                        }
-                    }
-
-                    if (result == null) {
-                        result = new PluginResult(PluginResult.Status.ERROR, createFileTransferError(CONNECTION_ERR, source, target, connection));
-                    }
-                    // Remove incomplete download.
-                    if (result.getStatus() != PluginResult.Status.OK.ordinal() && file != null) {
-                        file.delete();
-                    }
-                    context.sendPluginResult(result);
-                }
-            }
-        });
-    }
-
-    /**
-     * Abort an ongoing upload or download.
-     */
-    private void abort(String objectId) {
-        final RequestContext context;
-        synchronized (activeRequests) {
-            context = activeRequests.remove(objectId);
-        }
-        if (context != null) {
-            File file = context.targetFile;
-            if (file != null) {
-                file.delete();
-            }
-            // Trigger the abort callback immediately to minimize latency between it and abort() being called.
-            JSONObject error = createFileTransferError(ABORTED_ERR, context.source, context.target, null, -1);
-            synchronized (context) {
-                context.sendPluginResult(new PluginResult(PluginResult.Status.ERROR, error));
-                context.aborted = true;
-            }
-            // Closing the streams can block, so execute on a background thread.
-            cordova.getThreadPool().execute(new Runnable() {
-                public void run() {
-                    synchronized (context) {
-                        safeClose(context.currentInputStream);
-                        safeClose(context.currentOutputStream);
-                    }
-                }
-            });
-        }
-    }
-}
diff --git a/src/android/FileProgressResult.java b/src/android/FileProgressResult.java
deleted file mode 100644
index 76a7b13..0000000
--- a/src/android/FileProgressResult.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
-       Licensed to the Apache Software Foundation (ASF) under one
-       or more contributor license agreements.  See the NOTICE file
-       distributed with this work for additional information
-       regarding copyright ownership.  The ASF licenses this file
-       to you under the Apache License, Version 2.0 (the
-       "License"); you may not use this file except in compliance
-       with the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-       Unless required by applicable law or agreed to in writing,
-       software distributed under the License is distributed on an
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-       KIND, either express or implied.  See the License for the
-       specific language governing permissions and limitations
-       under the License.
-*/
-package org.apache.cordova.filetransfer;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-/**
- * Encapsulates in-progress status of uploading or downloading a file to a remote server.
- */
-public class FileProgressResult {
-
-    private boolean lengthComputable = false; // declares whether total is known
-    private long loaded = 0;                  // bytes sent so far
-    private long total = 0;                   // bytes total, if known
-
-    public boolean getLengthComputable() {
-        return lengthComputable;
-    }
-
-    public void setLengthComputable(boolean computable) {
-        this.lengthComputable = computable;
-    }
-
-    public long getLoaded() {
-        return loaded;
-    }
-
-    public void setLoaded(long bytes) {
-        this.loaded = bytes;
-    }
-
-    public long getTotal() {
-        return total;
-    }
-
-    public void setTotal(long bytes) {
-        this.total = bytes;
-    }
-
-    public JSONObject toJSONObject() throws JSONException {
-        return new JSONObject(
-                "{loaded:" + loaded +
-                ",total:" + total +
-                ",lengthComputable:" + (lengthComputable ? "true" : "false") + "}");
-    }
-}
diff --git a/src/android/FileTransfer.java b/src/android/FileTransfer.java
deleted file mode 100644
index eeed2f6..0000000
--- a/src/android/FileTransfer.java
+++ /dev/null
@@ -1,881 +0,0 @@
-/*
-       Licensed to the Apache Software Foundation (ASF) under one
-       or more contributor license agreements.  See the NOTICE file
-       distributed with this work for additional information
-       regarding copyright ownership.  The ASF licenses this file
-       to you under the Apache License, Version 2.0 (the
-       "License"); you may not use this file except in compliance
-       with the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-       Unless required by applicable law or agreed to in writing,
-       software distributed under the License is distributed on an
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-       KIND, either express or implied.  See the License for the
-       specific language governing permissions and limitations
-       under the License.
-*/
-package org.apache.cordova.filetransfer;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayOutputStream;
-import java.io.Closeable;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FilterInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.net.HttpURLConnection;
-import java.net.URLConnection;
-import java.security.cert.CertificateException;
-import java.security.cert.X509Certificate;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.zip.GZIPInputStream;
-import java.util.zip.Inflater;
-
-import javax.net.ssl.HostnameVerifier;
-import javax.net.ssl.HttpsURLConnection;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSession;
-import javax.net.ssl.SSLSocketFactory;
-import javax.net.ssl.TrustManager;
-import javax.net.ssl.X509TrustManager;
-
-import org.apache.cordova.Config;
-import org.apache.cordova.CallbackContext;
-import org.apache.cordova.CordovaPlugin;
-import org.apache.cordova.CordovaResourceApi;
-import org.apache.cordova.CordovaResourceApi.OpenForReadResult;
-import org.apache.cordova.PluginResult;
-import org.apache.cordova.file.FileUtils;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import android.net.Uri;
-import android.os.Build;
-import android.util.Log;
-import android.webkit.CookieManager;
-
-public class FileTransfer extends CordovaPlugin {
-
-    private static final String LOG_TAG = "FileTransfer";
-    private static final String LINE_START = "--";
-    private static final String LINE_END = "\r\n";
-    private static final String BOUNDARY =  "+++++";
-
-    public static int FILE_NOT_FOUND_ERR = 1;
-    public static int INVALID_URL_ERR = 2;
-    public static int CONNECTION_ERR = 3;
-    public static int ABORTED_ERR = 4;
-
-    private static HashMap<String, RequestContext> activeRequests = new HashMap<String, RequestContext>();
-    private static final int MAX_BUFFER_SIZE = 16 * 1024;
-
-    private static final class RequestContext {
-        String source;
-        String target;
-        File targetFile;
-        CallbackContext callbackContext;
-        InputStream currentInputStream;
-        OutputStream currentOutputStream;
-        boolean aborted;
-        RequestContext(String source, String target, CallbackContext callbackContext) {
-            this.source = source;
-            this.target = target;
-            this.callbackContext = callbackContext;
-        }
-        void sendPluginResult(PluginResult pluginResult) {
-            synchronized (this) {
-                if (!aborted) {
-                    callbackContext.sendPluginResult(pluginResult);
-                }
-            }
-        }
-    }
-
-    /**
-     * Adds an interface method to an InputStream to return the number of bytes
-     * read from the raw stream. This is used to track total progress against
-     * the HTTP Content-Length header value from the server.
-     */
-    private static abstract class TrackingInputStream extends FilterInputStream {
-      public TrackingInputStream(final InputStream in) {
-        super(in);
-      }
-        public abstract long getTotalRawBytesRead();
-  }
-
-    private static class ExposedGZIPInputStream extends GZIPInputStream {
-      public ExposedGZIPInputStream(final InputStream in) throws IOException {
-        super(in);
-      }
-      public Inflater getInflater() {
-        return inf;
-      }
-  }
-
-    /**
-     * Provides raw bytes-read tracking for a GZIP input stream. Reports the
-     * total number of compressed bytes read from the input, rather than the
-     * number of uncompressed bytes.
-     */
-    private static class TrackingGZIPInputStream extends TrackingInputStream {
-      private ExposedGZIPInputStream gzin;
-      public TrackingGZIPInputStream(final ExposedGZIPInputStream gzin) throws IOException {
-        super(gzin);
-        this.gzin = gzin;
-      }
-      public long getTotalRawBytesRead() {
-        return gzin.getInflater().getBytesRead();
-      }
-  }
-
-    /**
-     * Provides simple total-bytes-read tracking for an existing InputStream
-     */
-    private static class SimpleTrackingInputStream extends TrackingInputStream {
-        private long bytesRead = 0;
-        public SimpleTrackingInputStream(InputStream stream) {
-            super(stream);
-        }
-
-        private int updateBytesRead(int newBytesRead) {
-          if (newBytesRead != -1) {
-            bytesRead += newBytesRead;
-          }
-          return newBytesRead;
-        }
-
-        @Override
-        public int read() throws IOException {
-            return updateBytesRead(super.read());
-        }
-
-        // Note: FilterInputStream delegates read(byte[] bytes) to the below method,
-        // so we don't override it or else double count (CB-5631).
-        @Override
-        public int read(byte[] bytes, int offset, int count) throws IOException {
-            return updateBytesRead(super.read(bytes, offset, count));
-        }
-
-        public long getTotalRawBytesRead() {
-          return bytesRead;
-        }
-    }
-
-    @Override
-    public boolean execute(String action, JSONArray args, final CallbackContext callbackContext) throws JSONException {
-        if (action.equals("upload") || action.equals("download")) {
-            String source = args.getString(0);
-            String target = args.getString(1);
-
-            if (action.equals("upload")) {
-                upload(source, target, args, callbackContext);
-            } else {
-                download(source, target, args, callbackContext);
-            }
-            return true;
-        } else if (action.equals("abort")) {
-            String objectId = args.getString(0);
-            abort(objectId);
-            callbackContext.success();
-            return true;
-        }
-        return false;
-    }
-
-    private static void addHeadersToRequest(URLConnection connection, JSONObject headers) {
-        try {
-            for (Iterator<?> iter = headers.keys(); iter.hasNext(); ) {
-                String headerKey = iter.next().toString();
-                JSONArray headerValues = headers.optJSONArray(headerKey);
-                if (headerValues == null) {
-                    headerValues = new JSONArray();
-                    headerValues.put(headers.getString(headerKey));
-                }
-                connection.setRequestProperty(headerKey, headerValues.getString(0));
-                for (int i = 1; i < headerValues.length(); ++i) {
-                    connection.addRequestProperty(headerKey, headerValues.getString(i));
-                }
-            }
-        } catch (JSONException e1) {
-          // No headers to be manipulated!
-        }
-    }
-
-    /**
-     * Uploads the specified file to the server URL provided using an HTTP multipart request.
-     * @param source        Full path of the file on the file system
-     * @param target        URL of the server to receive the file
-     * @param args          JSON Array of args
-     * @param callbackContext    callback id for optional progress reports
-     *
-     * args[2] fileKey       Name of file request parameter
-     * args[3] fileName      File name to be used on server
-     * args[4] mimeType      Describes file content type
-     * args[5] params        key:value pairs of user-defined parameters
-     * @return FileUploadResult containing result of upload request
-     */
-    private void upload(final String source, final String target, JSONArray args, CallbackContext callbackContext) throws JSONException {
-        Log.d(LOG_TAG, "upload " + source + " to " +  target);
-
-        // Setup the options
-        final String fileKey = getArgument(args, 2, "file");
-        final String fileName = getArgument(args, 3, "image.jpg");
-        final String mimeType = getArgument(args, 4, "image/jpeg");
-        final JSONObject params = args.optJSONObject(5) == null ? new JSONObject() : args.optJSONObject(5);
-        final boolean trustEveryone = args.optBoolean(6);
-        // Always use chunked mode unless set to false as per API
-        final boolean chunkedMode = args.optBoolean(7) || args.isNull(7);
-        // Look for headers on the params map for backwards compatibility with older Cordova versions.
-        final JSONObject headers = args.optJSONObject(8) == null ? params.optJSONObject("headers") : args.optJSONObject(8);
-        final String objectId = args.getString(9);
-        final String httpMethod = getArgument(args, 10, "POST");
-        
-        final CordovaResourceApi resourceApi = webView.getResourceApi();
-
-        Log.d(LOG_TAG, "fileKey: " + fileKey);
-        Log.d(LOG_TAG, "fileName: " + fileName);
-        Log.d(LOG_TAG, "mimeType: " + mimeType);
-        Log.d(LOG_TAG, "params: " + params);
-        Log.d(LOG_TAG, "trustEveryone: " + trustEveryone);
-        Log.d(LOG_TAG, "chunkedMode: " + chunkedMode);
-        Log.d(LOG_TAG, "headers: " + headers);
-        Log.d(LOG_TAG, "objectId: " + objectId);
-        Log.d(LOG_TAG, "httpMethod: " + httpMethod);
-        
-        final Uri targetUri = resourceApi.remapUri(Uri.parse(target));
-        // Accept a path or a URI for the source.
-        Uri tmpSrc = Uri.parse(source);
-        final Uri sourceUri = resourceApi.remapUri(
-            tmpSrc.getScheme() != null ? tmpSrc : Uri.fromFile(new File(source)));
-
-        int uriType = CordovaResourceApi.getUriType(targetUri);
-        final boolean useHttps = uriType == CordovaResourceApi.URI_TYPE_HTTPS;
-        if (uriType != CordovaResourceApi.URI_TYPE_HTTP && !useHttps) {
-            JSONObject error = createFileTransferError(INVALID_URL_ERR, source, target, null, 0);
-            Log.e(LOG_TAG, "Unsupported URI: " + targetUri);
-            callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, error));
-            return;
-        }
-
-        final RequestContext context = new RequestContext(source, target, callbackContext);
-        synchronized (activeRequests) {
-            activeRequests.put(objectId, context);
-        }
-        
-        cordova.getThreadPool().execute(new Runnable() {
-            public void run() {
-                if (context.aborted) {
-                    return;
-                }
-                HttpURLConnection conn = null;
-                HostnameVerifier oldHostnameVerifier = null;
-                SSLSocketFactory oldSocketFactory = null;
-                int totalBytes = 0;
-                int fixedLength = -1;
-                try {
-                    // Create return object
-                    FileUploadResult result = new FileUploadResult();
-                    FileProgressResult progress = new FileProgressResult();
-
-                    //------------------ CLIENT REQUEST
-                    // Open a HTTP connection to the URL based on protocol
-                    conn = resourceApi.createHttpConnection(targetUri);
-                    if (useHttps && trustEveryone) {
-                        // Setup the HTTPS connection class to trust everyone
-                        HttpsURLConnection https = (HttpsURLConnection)conn;
-                        oldSocketFactory  = trustAllHosts(https);
-                        // Save the current hostnameVerifier
-                        oldHostnameVerifier = https.getHostnameVerifier();
-                        // Setup the connection not to verify hostnames
-                        https.setHostnameVerifier(DO_NOT_VERIFY);
-                    }
-
-                    // Allow Inputs
-                    conn.setDoInput(true);
-
-                    // Allow Outputs
-                    conn.setDoOutput(true);
-
-                    // Don't use a cached copy.
-                    conn.setUseCaches(false);
-
-                    // Use a post method.
-                    conn.setRequestMethod(httpMethod);
-                    conn.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + BOUNDARY);
-
-                    // Set the cookies on the response
-                    String cookie = CookieManager.getInstance().getCookie(target);
-                    if (cookie != null) {
-                        conn.setRequestProperty("Cookie", cookie);
-                    }
-
-                    // Handle the other headers
-                    if (headers != null) {
-                        addHeadersToRequest(conn, headers);
-                    }
-
-                    /*
-                        * Store the non-file portions of the multipart data as a string, so that we can add it
-                        * to the contentSize, since it is part of the body of the HTTP request.
-                        */
-                    StringBuilder beforeData = new StringBuilder();
-                    try {
-                        for (Iterator<?> iter = params.keys(); iter.hasNext();) {
-                            Object key = iter.next();
-                            if(!String.valueOf(key).equals("headers"))
-                            {
-                              beforeData.append(LINE_START).append(BOUNDARY).append(LINE_END);
-                              beforeData.append("Content-Disposition: form-data; name=\"").append(key.toString()).append('"');
-                              beforeData.append(LINE_END).append(LINE_END);
-                              beforeData.append(params.getString(key.toString()));
-                              beforeData.append(LINE_END);
-                            }
-                        }
-                    } catch (JSONException e) {
-                        Log.e(LOG_TAG, e.getMessage(), e);
-                    }
-
-                    beforeData.append(LINE_START).append(BOUNDARY).append(LINE_END);
-                    beforeData.append("Content-Disposition: form-data; name=\"").append(fileKey).append("\";");
-                    beforeData.append(" filename=\"").append(fileName).append('"').append(LINE_END);
-                    beforeData.append("Content-Type: ").append(mimeType).append(LINE_END).append(LINE_END);
-                    byte[] beforeDataBytes = beforeData.toString().getBytes("UTF-8");
-                    byte[] tailParamsBytes = (LINE_END + LINE_START + BOUNDARY + LINE_START + LINE_END).getBytes("UTF-8");
-
-                    
-                    // Get a input stream of the file on the phone
-                    OpenForReadResult readResult = resourceApi.openForRead(sourceUri);
-                    
-                    int stringLength = beforeDataBytes.length + tailParamsBytes.length;
-                    if (readResult.length >= 0) {
-                        fixedLength = (int)readResult.length + stringLength;
-                        progress.setLengthComputable(true);
-                        progress.setTotal(fixedLength);
-                    }
-                    Log.d(LOG_TAG, "Content Length: " + fixedLength);
-                    // setFixedLengthStreamingMode causes and OutOfMemoryException on pre-Froyo devices.
-                    // http://code.google.com/p/android/issues/detail?id=3164
-                    // It also causes OOM if HTTPS is used, even on newer devices.
-                    boolean useChunkedMode = chunkedMode && (Build.VERSION.SDK_INT < Build.VERSION_CODES.FROYO || useHttps);
-                    useChunkedMode = useChunkedMode || (fixedLength == -1);
-
-                    if (useChunkedMode) {
-                        conn.setChunkedStreamingMode(MAX_BUFFER_SIZE);
-                        // Although setChunkedStreamingMode sets this header, setting it explicitly here works
-                        // around an OutOfMemoryException when using https.
-                        conn.setRequestProperty("Transfer-Encoding", "chunked");
-                    } else {
-                        conn.setFixedLengthStreamingMode(fixedLength);
-                    }
-
-                    conn.connect();
-                    
-                    OutputStream sendStream = null;
-                    try {
-                        sendStream = conn.getOutputStream();
-                        synchronized (context) {
-                            if (context.aborted) {
-                                return;
-                            }
-                            context.currentOutputStream = sendStream;
-                        }
-                        //We don't want to change encoding, we just want this to write for all Unicode.
-                        sendStream.write(beforeDataBytes);
-                        totalBytes += beforeDataBytes.length;
-    
-                        // create a buffer of maximum size
-                        int bytesAvailable = readResult.inputStream.available();
-                        int bufferSize = Math.min(bytesAvailable, MAX_BUFFER_SIZE);
-                        byte[] buffer = new byte[bufferSize];
-    
-                        // read file and write it into form...
-                        int bytesRead = readResult.inputStream.read(buffer, 0, bufferSize);
-    
-                        long prevBytesRead = 0;
-                        while (bytesRead > 0) {
-                            result.setBytesSent(totalBytes);
-                            sendStream.write(buffer, 0, bytesRead);
-                            totalBytes += bytesRead;
-                            if (totalBytes > prevBytesRead + 102400) {
-                                prevBytesRead = totalBytes;
-                                Log.d(LOG_TAG, "Uploaded " + totalBytes + " of " + fixedLength + " bytes");
-                            }
-                            bytesAvailable = readResult.inputStream.available();
-                            bufferSize = Math.min(bytesAvailable, MAX_BUFFER_SIZE);
-                            bytesRead = readResult.inputStream.read(buffer, 0, bufferSize);
-
-                            // Send a progress event.
-                            progress.setLoaded(totalBytes);
-                            PluginResult progressResult = new PluginResult(PluginResult.Status.OK, progress.toJSONObject());
-                            progressResult.setKeepCallback(true);
-                            context.sendPluginResult(progressResult);
-                        }
-    
-                        // send multipart form data necessary after file data...
-                        sendStream.write(tailParamsBytes);
-                        totalBytes += tailParamsBytes.length;
-                        sendStream.flush();
-                    } finally {
-                        safeClose(readResult.inputStream);
-                        safeClose(sendStream);
-                    }
-                    context.currentOutputStream = null;
-                    Log.d(LOG_TAG, "Sent " + totalBytes + " of " + fixedLength);
-
-                    //------------------ read the SERVER RESPONSE
-                    String responseString;
-                    int responseCode = conn.getResponseCode();
-                    Log.d(LOG_TAG, "response code: " + responseCode);
-                    Log.d(LOG_TAG, "response headers: " + conn.getHeaderFields());
-                    TrackingInputStream inStream = null;
-                    try {
-                        inStream = getInputStream(conn);
-                        synchronized (context) {
-                            if (context.aborted) {
-                                return;
-                            }
-                            context.currentInputStream = inStream;
-                        }
-                        
-                        ByteArrayOutputStream out = new ByteArrayOutputStream(Math.max(1024, conn.getContentLength()));
-                        byte[] buffer = new byte[1024];
-                        int bytesRead = 0;
-                        // write bytes to file
-                        while ((bytesRead = inStream.read(buffer)) > 0) {
-                            out.write(buffer, 0, bytesRead);
-                        }
-                        responseString = out.toString("UTF-8");
-                    } finally {
-                        context.currentInputStream = null;
-                        safeClose(inStream);
-                    }
-                    
-                    Log.d(LOG_TAG, "got response from server");
-                    Log.d(LOG_TAG, responseString.substring(0, Math.min(256, responseString.length())));
-                    
-                    // send request and retrieve response
-                    result.setResponseCode(responseCode);
-                    result.setResponse(responseString);
-
-                    context.sendPluginResult(new PluginResult(PluginResult.Status.OK, result.toJSONObject()));
-                } catch (FileNotFoundException e) {
-                    JSONObject error = createFileTransferError(FILE_NOT_FOUND_ERR, source, target, conn);
-                    Log.e(LOG_TAG, error.toString(), e);
-                    context.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, error));
-                } catch (IOException e) {
-                    JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, conn);
-                    Log.e(LOG_TAG, error.toString(), e);
-                    Log.e(LOG_TAG, "Failed after uploading " + totalBytes + " of " + fixedLength + " bytes.");
-                    context.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, error));
-                } catch (JSONException e) {
-                    Log.e(LOG_TAG, e.getMessage(), e);
-                    context.sendPluginResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION));
-                } catch (Throwable t) {
-                    // Shouldn't happen, but will
-                    JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, conn);
-                    Log.e(LOG_TAG, error.toString(), t);
-                    context.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, error));
-                } finally {
-                    synchronized (activeRequests) {
-                        activeRequests.remove(objectId);
-                    }
-
-                    if (conn != null) {
-                        // Revert back to the proper verifier and socket factories
-                        // Revert back to the proper verifier and socket factories
-                        if (trustEveryone && useHttps) {
-                            HttpsURLConnection https = (HttpsURLConnection) conn;
-                            https.setHostnameVerifier(oldHostnameVerifier);
-                            https.setSSLSocketFactory(oldSocketFactory);
-                        }
-                    }
-                }                
-            }
-        });
-    }
-
-    private static void safeClose(Closeable stream) {
-        if (stream != null) {
-            try {
-                stream.close();
-            } catch (IOException e) {
-            }
-        }
-    }
-
-    private static TrackingInputStream getInputStream(URLConnection conn) throws IOException {
-        String encoding = conn.getContentEncoding();
-        if (encoding != null && encoding.equalsIgnoreCase("gzip")) {
-          return new TrackingGZIPInputStream(new ExposedGZIPInputStream(conn.getInputStream()));
-        }
-        return new SimpleTrackingInputStream(conn.getInputStream());
-    }
-
-    // always verify the host - don't check for certificate
-    private static final HostnameVerifier DO_NOT_VERIFY = new HostnameVerifier() {
-        public boolean verify(String hostname, SSLSession session) {
-            return true;
-        }
-    };
-    // Create a trust manager that does not validate certificate chains
-    private static final TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {
-        public java.security.cert.X509Certificate[] getAcceptedIssuers() {
-            return new java.security.cert.X509Certificate[] {};
-        }
-        
-        public void checkClientTrusted(X509Certificate[] chain,
-                String authType) throws CertificateException {
-        }
-        
-        public void checkServerTrusted(X509Certificate[] chain,
-                String authType) throws CertificateException {
-        }
-    } };
-
-    /**
-     * This function will install a trust manager that will blindly trust all SSL
-     * certificates.  The reason this code is being added is to enable developers
-     * to do development using self signed SSL certificates on their web server.
-     *
-     * The standard HttpsURLConnection class will throw an exception on self
-     * signed certificates if this code is not run.
-     */
-    private static SSLSocketFactory trustAllHosts(HttpsURLConnection connection) {
-        // Install the all-trusting trust manager
-        SSLSocketFactory oldFactory = connection.getSSLSocketFactory();
-        try {
-            // Install our all trusting manager
-            SSLContext sc = SSLContext.getInstance("TLS");
-            sc.init(null, trustAllCerts, new java.security.SecureRandom());
-            SSLSocketFactory newFactory = sc.getSocketFactory();
-            connection.setSSLSocketFactory(newFactory);
-        } catch (Exception e) {
-            Log.e(LOG_TAG, e.getMessage(), e);
-        }
-        return oldFactory;
-    }
-
-    private static JSONObject createFileTransferError(int errorCode, String source, String target, URLConnection connection) {
-
-        int httpStatus = 0;
-        StringBuilder bodyBuilder = new StringBuilder();
-        String body = null;
-        if (connection != null) {
-            try {
-                if (connection instanceof HttpURLConnection) {
-                    httpStatus = ((HttpURLConnection)connection).getResponseCode();
-                    InputStream err = ((HttpURLConnection) connection).getErrorStream();
-                    if(err != null)
-                    {
-                        BufferedReader reader = new BufferedReader(new InputStreamReader(err, "UTF-8"));
-                        try {
-                            String line = reader.readLine();
-                            while(line != null) {
-                                bodyBuilder.append(line);
-                                line = reader.readLine();
-                                if(line != null) {
-                                    bodyBuilder.append('\n');
-                                }
-                            }
-                            body = bodyBuilder.toString();
-                        } finally {
-                            reader.close();
-                        }
-                    }
-                }
-            // IOException can leave connection object in a bad state, so catch all exceptions.
-            } catch (Throwable e) {
-                Log.w(LOG_TAG, "Error getting HTTP status code from connection.", e);
-            }
-        }
-
-        return createFileTransferError(errorCode, source, target, body, httpStatus);
-    }
-
-        /**
-        * Create an error object based on the passed in errorCode
-        * @param errorCode      the error
-        * @return JSONObject containing the error
-        */
-    private static JSONObject createFileTransferError(int errorCode, String source, String target, String body, Integer httpStatus) {
-        JSONObject error = null;
-        try {
-            error = new JSONObject();
-            error.put("code", errorCode);
-            error.put("source", source);
-            error.put("target", target);
-            if(body != null)
-            {
-                error.put("body", body);
-            }   
-            if (httpStatus != null) {
-                error.put("http_status", httpStatus);
-            }
-        } catch (JSONException e) {
-            Log.e(LOG_TAG, e.getMessage(), e);
-        }
-        return error;
-    }
-
-    /**
-     * Convenience method to read a parameter from the list of JSON args.
-     * @param args                      the args passed to the Plugin
-     * @param position          the position to retrieve the arg from
-     * @param defaultString the default to be used if the arg does not exist
-     * @return String with the retrieved value
-     */
-    private static String getArgument(JSONArray args, int position, String defaultString) {
-        String arg = defaultString;
-        if (args.length() > position) {
-            arg = args.optString(position);
-            if (arg == null || "null".equals(arg)) {
-                arg = defaultString;
-            }
-        }
-        return arg;
-    }
-
-    /**
-     * Downloads a file form a given URL and saves it to the specified directory.
-     *
-     * @param source        URL of the server to receive the file
-     * @param target            Full path of the file on the file system
-     */
-    private void download(final String source, final String target, JSONArray args, CallbackContext callbackContext) throws JSONException {
-        Log.d(LOG_TAG, "download " + source + " to " +  target);
-
-        final CordovaResourceApi resourceApi = webView.getResourceApi();
-
-        final boolean trustEveryone = args.optBoolean(2);
-        final String objectId = args.getString(3);
-        final JSONObject headers = args.optJSONObject(4);
-        
-        final Uri sourceUri = resourceApi.remapUri(Uri.parse(source));
-        // Accept a path or a URI for the source.
-        Uri tmpTarget = Uri.parse(target);
-        final Uri targetUri = resourceApi.remapUri(
-            tmpTarget.getScheme() != null ? tmpTarget : Uri.fromFile(new File(target)));
-
-        int uriType = CordovaResourceApi.getUriType(sourceUri);
-        final boolean useHttps = uriType == CordovaResourceApi.URI_TYPE_HTTPS;
-        final boolean isLocalTransfer = !useHttps && uriType != CordovaResourceApi.URI_TYPE_HTTP;
-        if (uriType == CordovaResourceApi.URI_TYPE_UNKNOWN) {
-            JSONObject error = createFileTransferError(INVALID_URL_ERR, source, target, null, 0);
-            Log.e(LOG_TAG, "Unsupported URI: " + targetUri);
-            callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, error));
-            return;
-        }
-        
-        // TODO: refactor to also allow resources & content:
-        if (!isLocalTransfer && !Config.isUrlWhiteListed(source)) {
-            Log.w(LOG_TAG, "Source URL is not in white list: '" + source + "'");
-            JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, null, 401);
-            callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, error));
-            return;
-        }
-
-        
-        final RequestContext context = new RequestContext(source, target, callbackContext);
-        synchronized (activeRequests) {
-            activeRequests.put(objectId, context);
-        }
-        
-        cordova.getThreadPool().execute(new Runnable() {
-            public void run() {
-                if (context.aborted) {
-                    return;
-                }
-                HttpURLConnection connection = null;
-                HostnameVerifier oldHostnameVerifier = null;
-                SSLSocketFactory oldSocketFactory = null;
-                File file = null;
-                PluginResult result = null;
-                TrackingInputStream inputStream = null;
-
-                OutputStream outputStream = null;
-                try {
-                    OpenForReadResult readResult = null;
-                    outputStream = resourceApi.openOutputStream(targetUri);
-
-                    file = resourceApi.mapUriToFile(targetUri);
-                    context.targetFile = file;
-                    
-                    Log.d(LOG_TAG, "Download file:" + sourceUri);
-
-                    FileProgressResult progress = new FileProgressResult();
-
-                    if (isLocalTransfer) {
-                        readResult = resourceApi.openForRead(sourceUri);
-                        if (readResult.length != -1) {
-                            progress.setLengthComputable(true);
-                            progress.setTotal(readResult.length);
-                        }
-                        inputStream = new SimpleTrackingInputStream(readResult.inputStream);
-                    } else {
-                        // connect to server
-                        // Open a HTTP connection to the URL based on protocol
-                        connection = resourceApi.createHttpConnection(sourceUri);
-                        if (useHttps && trustEveryone) {
-                            // Setup the HTTPS connection class to trust everyone
-                            HttpsURLConnection https = (HttpsURLConnection)connection;
-                            oldSocketFactory = trustAllHosts(https);
-                            // Save the current hostnameVerifier
-                            oldHostnameVerifier = https.getHostnameVerifier();
-                            // Setup the connection not to verify hostnames
-                            https.setHostnameVerifier(DO_NOT_VERIFY);
-                        }
-        
-                        connection.setRequestMethod("GET");
-        
-                        // TODO: Make OkHttp use this CookieManager by default.
-                        String cookie = CookieManager.getInstance().getCookie(sourceUri.toString());
-                        if(cookie != null)
-                        {
-                            connection.setRequestProperty("cookie", cookie);
-                        }
-                        
-                        // This must be explicitly set for gzip progress tracking to work.
-                        connection.setRequestProperty("Accept-Encoding", "gzip");
-    
-                        // Handle the other headers
-                        if (headers != null) {
-                            addHeadersToRequest(connection, headers);
-                        }
-        
-                        connection.connect();
-    
-                        if (connection.getContentEncoding() == null || connection.getContentEncoding().equalsIgnoreCase("gzip")) {
-                            // Only trust content-length header if we understand
-                            // the encoding -- identity or gzip
-                            if (connection.getContentLength() != -1) {
-                                progress.setLengthComputable(true);
-                                progress.setTotal(connection.getContentLength());
-                            }
-                        }
-                        inputStream = getInputStream(connection);
-                    }
-                    
-                    try {
-                        synchronized (context) {
-                            if (context.aborted) {
-                                return;
-                            }
-                            context.currentInputStream = inputStream;
-                        }
-                        
-                        // write bytes to file
-                        byte[] buffer = new byte[MAX_BUFFER_SIZE];
-                        int bytesRead = 0;
-                        while ((bytesRead = inputStream.read(buffer)) > 0) {
-                            outputStream.write(buffer, 0, bytesRead);
-                            // Send a progress event.
-                            progress.setLoaded(inputStream.getTotalRawBytesRead());
-                            PluginResult progressResult = new PluginResult(PluginResult.Status.OK, progress.toJSONObject());
-                            progressResult.setKeepCallback(true);
-                            context.sendPluginResult(progressResult);
-                        }
-                    } finally {
-                        context.currentInputStream = null;
-                        safeClose(inputStream);
-                        safeClose(outputStream);
-                    }
-    
-                    Log.d(LOG_TAG, "Saved file: " + target);
-    
-                    // create FileEntry object
-                    FileUtils filePlugin = (FileUtils)webView.pluginManager.getPlugin("File");
-                    if (filePlugin != null) {
-                        JSONObject fileEntry = filePlugin.getEntryForFile(file);
-                        if (fileEntry != null) {
-                            result = new PluginResult(PluginResult.Status.OK, fileEntry);
-                        } else {
-                            JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, connection);
-                            Log.e(LOG_TAG, "File plugin cannot represent download path");
-                            result = new PluginResult(PluginResult.Status.IO_EXCEPTION, error);
-                        }
-                    } else {
-                        Log.e(LOG_TAG, "File plugin not found; cannot save downloaded file");
-                        result = new PluginResult(PluginResult.Status.ERROR, "File plugin not found; cannot save downloaded file");
-                    }
-                    
-                } catch (FileNotFoundException e) {
-                    JSONObject error = createFileTransferError(FILE_NOT_FOUND_ERR, source, target, connection);
-                    Log.e(LOG_TAG, error.toString(), e);
-                    result = new PluginResult(PluginResult.Status.IO_EXCEPTION, error);
-                } catch (IOException e) {
-                    JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, connection);
-                    Log.e(LOG_TAG, error.toString(), e);
-                    result = new PluginResult(PluginResult.Status.IO_EXCEPTION, error);
-                } catch (JSONException e) {
-                    Log.e(LOG_TAG, e.getMessage(), e);
-                    result = new PluginResult(PluginResult.Status.JSON_EXCEPTION);
-                } catch (Throwable e) {
-                    JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, connection);
-                    Log.e(LOG_TAG, error.toString(), e);
-                    result = new PluginResult(PluginResult.Status.IO_EXCEPTION, error);
-                } finally {
-                    safeClose(outputStream);
-                    synchronized (activeRequests) {
-                        activeRequests.remove(objectId);
-                    }
-
-                    if (connection != null) {
-                        // Revert back to the proper verifier and socket factories
-                        if (trustEveryone && useHttps) {
-                            HttpsURLConnection https = (HttpsURLConnection) connection;
-                            https.setHostnameVerifier(oldHostnameVerifier);
-                            https.setSSLSocketFactory(oldSocketFactory);
-                        }
-                    }
-
-                    if (result == null) {
-                        result = new PluginResult(PluginResult.Status.ERROR, createFileTransferError(CONNECTION_ERR, source, target, connection));
-                    }
-                    // Remove incomplete download.
-                    if (result.getStatus() != PluginResult.Status.OK.ordinal() && file != null) {
-                        file.delete();
-                    }
-                    context.sendPluginResult(result);
-                }
-            }
-        });
-    }
-
-    /**
-     * Abort an ongoing upload or download.
-     */
-    private void abort(String objectId) {
-        final RequestContext context;
-        synchronized (activeRequests) {
-            context = activeRequests.remove(objectId);
-        }
-        if (context != null) {
-            File file = context.targetFile;
-            if (file != null) {
-                file.delete();
-            }
-            // Trigger the abort callback immediately to minimize latency between it and abort() being called.
-            JSONObject error = createFileTransferError(ABORTED_ERR, context.source, context.target, null, -1);
-            synchronized (context) {
-                context.sendPluginResult(new PluginResult(PluginResult.Status.ERROR, error));
-                context.aborted = true;
-            }
-            // Closing the streams can block, so execute on a background thread.
-            cordova.getThreadPool().execute(new Runnable() {
-                public void run() {
-                    synchronized (context) {
-                        safeClose(context.currentInputStream);
-                        safeClose(context.currentOutputStream);
-                    }
-                }
-            });
-        }
-    }
-}
diff --git a/src/android/FileUploadResult.java b/src/android/FileUploadResult.java
deleted file mode 100644
index c24ea78..0000000
--- a/src/android/FileUploadResult.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
-       Licensed to the Apache Software Foundation (ASF) under one
-       or more contributor license agreements.  See the NOTICE file
-       distributed with this work for additional information
-       regarding copyright ownership.  The ASF licenses this file
-       to you under the Apache License, Version 2.0 (the
-       "License"); you may not use this file except in compliance
-       with the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-       Unless required by applicable law or agreed to in writing,
-       software distributed under the License is distributed on an
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-       KIND, either express or implied.  See the License for the
-       specific language governing permissions and limitations
-       under the License.
-*/
-package org.apache.cordova.filetransfer;
-
-import org.json.JSONException;
-import org.json.JSONObject;
-
-/**
- * Encapsulates the result and/or status of uploading a file to a remote server.
- */
-public class FileUploadResult {
-
-    private long bytesSent = 0;         // bytes sent
-    private int responseCode = -1;      // HTTP response code
-    private String response = null;     // HTTP response
-    private String objectId = null;     // FileTransfer object id
-
-    public long getBytesSent() {
-        return bytesSent;
-    }
-
-    public void setBytesSent(long bytes) {
-        this.bytesSent = bytes;
-    }
-
-    public int getResponseCode() {
-        return responseCode;
-    }
-
-    public void setResponseCode(int responseCode) {
-        this.responseCode = responseCode;
-    }
-
-    public String getResponse() {
-        return response;
-    }
-
-    public void setResponse(String response) {
-        this.response = response;
-    }
-
-    public String getObjectId() {
-        return objectId;
-    }
-
-    public void setObjectId(String objectId) {
-        this.objectId = objectId;
-    }
-
-    public JSONObject toJSONObject() throws JSONException {
-        return new JSONObject(
-                "{bytesSent:" + bytesSent +
-                ",responseCode:" + responseCode +
-                ",response:" + JSONObject.quote(response) +
-                ",objectId:" + JSONObject.quote(objectId) + "}");
-    }
-}
diff --git a/src/ios/CDVFileTransfer.h b/src/ios/CDVFileTransfer.h
deleted file mode 100644
index 9c4bcf1..0000000
--- a/src/ios/CDVFileTransfer.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Foundation/Foundation.h>
-#import <Cordova/CDVPlugin.h>
-#import "CDVFile.h"
-
-enum CDVFileTransferError {
-    FILE_NOT_FOUND_ERR = 1,
-    INVALID_URL_ERR = 2,
-    CONNECTION_ERR = 3,
-    CONNECTION_ABORTED = 4
-};
-typedef int CDVFileTransferError;
-
-enum CDVFileTransferDirection {
-    CDV_TRANSFER_UPLOAD = 1,
-    CDV_TRANSFER_DOWNLOAD = 2,
-};
-typedef int CDVFileTransferDirection;
-
-// Magic value within the options dict used to set a cookie.
-extern NSString* const kOptionsKeyCookie;
-
-@interface CDVFileTransfer : CDVPlugin {}
-
-- (void)upload:(CDVInvokedUrlCommand*)command;
-- (void)download:(CDVInvokedUrlCommand*)command;
-- (NSString*)escapePathComponentForUrlString:(NSString*)urlString;
-
-// Visible for testing.
-- (NSURLRequest*)requestForUploadCommand:(CDVInvokedUrlCommand*)command fileData:(NSData*)fileData;
-- (NSMutableDictionary*)createFileTransferError:(int)code AndSource:(NSString*)source AndTarget:(NSString*)target;
-
-- (NSMutableDictionary*)createFileTransferError:(int)code
-                                      AndSource:(NSString*)source
-                                      AndTarget:(NSString*)target
-                                  AndHttpStatus:(int)httpStatus
-                                        AndBody:(NSString*)body;
-@property (nonatomic, strong) NSOperationQueue* queue;
-@property (readonly) NSMutableDictionary* activeTransfers;
-@end
-
-@class CDVFileTransferEntityLengthRequest;
-
-@interface CDVFileTransferDelegate : NSObject {}
-
-- (void)updateBytesExpected:(long long)newBytesExpected;
-- (void)cancelTransfer:(NSURLConnection*)connection;
-
-@property (strong) NSMutableData* responseData; // atomic
-@property (nonatomic, strong) NSDictionary* responseHeaders;
-@property (nonatomic, assign) UIBackgroundTaskIdentifier backgroundTaskID;
-@property (nonatomic, strong) CDVFileTransfer* command;
-@property (nonatomic, assign) CDVFileTransferDirection direction;
-@property (nonatomic, strong) NSURLConnection* connection;
-@property (nonatomic, copy) NSString* callbackId;
-@property (nonatomic, copy) NSString* objectId;
-@property (nonatomic, copy) NSString* source;
-@property (nonatomic, copy) NSString* target;
-@property (nonatomic, copy) NSURL* targetURL;
-@property (nonatomic, copy) NSString* mimeType;
-@property (assign) int responseCode; // atomic
-@property (nonatomic, assign) long long bytesTransfered;
-@property (nonatomic, assign) long long bytesExpected;
-@property (nonatomic, assign) BOOL trustAllHosts;
-@property (strong) NSFileHandle* targetFileHandle;
-@property (nonatomic, strong) CDVFileTransferEntityLengthRequest* entityLengthRequest;
-@property (nonatomic, strong) CDVFile *filePlugin;
-
-@end
diff --git a/src/ios/CDVFileTransfer.m b/src/ios/CDVFileTransfer.m
deleted file mode 100644
index a1eeef2..0000000
--- a/src/ios/CDVFileTransfer.m
+++ /dev/null
@@ -1,778 +0,0 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
- */
-
-#import <Cordova/CDV.h>
-#import "CDVFileTransfer.h"
-#import "CDVLocalFilesystem.h"
-
-#import <AssetsLibrary/ALAsset.h>
-#import <AssetsLibrary/ALAssetRepresentation.h>
-#import <AssetsLibrary/ALAssetsLibrary.h>
-#import <CFNetwork/CFNetwork.h>
-
-@interface CDVFileTransfer ()
-// Sets the requests headers for the request.
-- (void)applyRequestHeaders:(NSDictionary*)headers toRequest:(NSMutableURLRequest*)req;
-// Creates a delegate to handle an upload.
-- (CDVFileTransferDelegate*)delegateForUploadCommand:(CDVInvokedUrlCommand*)command;
-// Creates an NSData* for the file for the given upload arguments.
-- (void)fileDataForUploadCommand:(CDVInvokedUrlCommand*)command;
-@end
-
-// Buffer size to use for streaming uploads.
-static const NSUInteger kStreamBufferSize = 32768;
-// Magic value within the options dict used to set a cookie.
-NSString* const kOptionsKeyCookie = @"__cookie";
-// Form boundary for multi-part requests.
-NSString* const kFormBoundary = @"+++++org.apache.cordova.formBoundary";
-
-// Writes the given data to the stream in a blocking way.
-// If successful, returns bytesToWrite.
-// If the stream was closed on the other end, returns 0.
-// If there was an error, returns -1.
-static CFIndex WriteDataToStream(NSData* data, CFWriteStreamRef stream)
-{
-    UInt8* bytes = (UInt8*)[data bytes];
-    long long bytesToWrite = [data length];
-    long long totalBytesWritten = 0;
-
-    while (totalBytesWritten < bytesToWrite) {
-        CFIndex result = CFWriteStreamWrite(stream,
-                bytes + totalBytesWritten,
-                bytesToWrite - totalBytesWritten);
-        if (result < 0) {
-            CFStreamError error = CFWriteStreamGetError(stream);
-            NSLog(@"WriteStreamError domain: %ld error: %ld", error.domain, (long)error.error);
-            return result;
-        } else if (result == 0) {
-            return result;
-        }
-        totalBytesWritten += result;
-    }
-
-    return totalBytesWritten;
-}
-
-@implementation CDVFileTransfer
-@synthesize activeTransfers;
-
-- (void)pluginInitialize {
-    activeTransfers = [[NSMutableDictionary alloc] init];
-}
-
-- (NSString*)escapePathComponentForUrlString:(NSString*)urlString
-{
-    NSRange schemeAndHostRange = [urlString rangeOfString:@"://.*?/" options:NSRegularExpressionSearch];
-
-    if (schemeAndHostRange.length == 0) {
-        return urlString;
-    }
-
-    NSInteger schemeAndHostEndIndex = NSMaxRange(schemeAndHostRange);
-    NSString* schemeAndHost = [urlString substringToIndex:schemeAndHostEndIndex];
-    NSString* pathComponent = [urlString substringFromIndex:schemeAndHostEndIndex];
-    pathComponent = [pathComponent stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
-
-    return [schemeAndHost stringByAppendingString:pathComponent];
-}
-
-- (void)applyRequestHeaders:(NSDictionary*)headers toRequest:(NSMutableURLRequest*)req
-{
-    [req setValue:@"XMLHttpRequest" forHTTPHeaderField:@"X-Requested-With"];
-
-    NSString* userAgent = [self.commandDelegate userAgent];
-    if (userAgent) {
-        [req setValue:userAgent forHTTPHeaderField:@"User-Agent"];
-    }
-
-    for (NSString* headerName in headers) {
-        id value = [headers objectForKey:headerName];
-        if (!value || (value == [NSNull null])) {
-            value = @"null";
-        }
-
-        // First, remove an existing header if one exists.
-        [req setValue:nil forHTTPHeaderField:headerName];
-
-        if (![value isKindOfClass:[NSArray class]]) {
-            value = [NSArray arrayWithObject:value];
-        }
-
-        // Then, append all header values.
-        for (id __strong subValue in value) {
-            // Convert from an NSNumber -> NSString.
-            if ([subValue respondsToSelector:@selector(stringValue)]) {
-                subValue = [subValue stringValue];
-            }
-            if ([subValue isKindOfClass:[NSString class]]) {
-                [req addValue:subValue forHTTPHeaderField:headerName];
-            }
-        }
-    }
-}
-
-- (NSURLRequest*)requestForUploadCommand:(CDVInvokedUrlCommand*)command fileData:(NSData*)fileData
-{
-    // arguments order from js: [filePath, server, fileKey, fileName, mimeType, params, debug, chunkedMode]
-    // however, params is a JavaScript object and during marshalling is put into the options dict,
-    // thus debug and chunkedMode are the 6th and 7th arguments
-    NSString* target = [command argumentAtIndex:0];
-    NSString* server = [command argumentAtIndex:1];
-    NSString* fileKey = [command argumentAtIndex:2 withDefault:@"file"];
-    NSString* fileName = [command argumentAtIndex:3 withDefault:@"no-filename"];
-    NSString* mimeType = [command argumentAtIndex:4 withDefault:nil];
-    NSDictionary* options = [command argumentAtIndex:5 withDefault:nil];
-    //    BOOL trustAllHosts = [[arguments objectAtIndex:6 withDefault:[NSNumber numberWithBool:YES]] boolValue]; // allow self-signed certs
-    BOOL chunkedMode = [[command argumentAtIndex:7 withDefault:[NSNumber numberWithBool:YES]] boolValue];
-    NSDictionary* headers = [command argumentAtIndex:8 withDefault:nil];
-    // Allow alternative http method, default to POST. JS side checks
-    // for allowed methods, currently PUT or POST (forces POST for
-    // unrecognised values)
-    NSString* httpMethod = [command argumentAtIndex:10 withDefault:@"POST"];
-    CDVPluginResult* result = nil;
-    CDVFileTransferError errorCode = 0;
-
-    // NSURL does not accepts URLs with spaces in the path. We escape the path in order
-    // to be more lenient.
-    NSURL* url = [NSURL URLWithString:server];
-
-    if (!url) {
-        errorCode = INVALID_URL_ERR;
-        NSLog(@"File Transfer Error: Invalid server URL %@", server);
-    } else if (!fileData) {
-        errorCode = FILE_NOT_FOUND_ERR;
-    }
-
-    if (errorCode > 0) {
-        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:[self createFileTransferError:errorCode AndSource:target AndTarget:server]];
-        [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
-        return nil;
-    }
-
-    NSMutableURLRequest* req = [NSMutableURLRequest requestWithURL:url];
-
-    [req setHTTPMethod:httpMethod];
-
-    //    Magic value to set a cookie
-    if ([options objectForKey:kOptionsKeyCookie]) {
-        [req setValue:[options objectForKey:kOptionsKeyCookie] forHTTPHeaderField:@"Cookie"];
-        [req setHTTPShouldHandleCookies:NO];
-    }
-
-    NSString* contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@", kFormBoundary];
-    [req setValue:contentType forHTTPHeaderField:@"Content-Type"];
-    [self applyRequestHeaders:headers toRequest:req];
-
-    NSData* formBoundaryData = [[NSString stringWithFormat:@"--%@\r\n", kFormBoundary] dataUsingEncoding:NSUTF8StringEncoding];
-    NSMutableData* postBodyBeforeFile = [NSMutableData data];
-
-    for (NSString* key in options) {
-        id val = [options objectForKey:key];
-        if (!val || (val == [NSNull null]) || [key isEqualToString:kOptionsKeyCookie]) {
-            continue;
-        }
-        // if it responds to stringValue selector (eg NSNumber) get the NSString
-        if ([val respondsToSelector:@selector(stringValue)]) {
-            val = [val stringValue];
-        }
-        // finally, check whether it is a NSString (for dataUsingEncoding selector below)
-        if (![val isKindOfClass:[NSString class]]) {
-            continue;
-        }
-
-        [postBodyBeforeFile appendData:formBoundaryData];
-        [postBodyBeforeFile appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"%@\"\r\n\r\n", key] dataUsingEncoding:NSUTF8StringEncoding]];
-        [postBodyBeforeFile appendData:[val dataUsingEncoding:NSUTF8StringEncoding]];
-        [postBodyBeforeFile appendData:[@"\r\n" dataUsingEncoding : NSUTF8StringEncoding]];
-    }
-
-    [postBodyBeforeFile appendData:formBoundaryData];
-    [postBodyBeforeFile appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"%@\"; filename=\"%@\"\r\n", fileKey, fileName] dataUsingEncoding:NSUTF8StringEncoding]];
-    if (mimeType != nil) {
-        [postBodyBeforeFile appendData:[[NSString stringWithFormat:@"Content-Type: %@\r\n", mimeType] dataUsingEncoding:NSUTF8StringEncoding]];
-    }
-    [postBodyBeforeFile appendData:[[NSString stringWithFormat:@"Content-Length: %ld\r\n\r\n", (long)[fileData length]] dataUsingEncoding:NSUTF8StringEncoding]];
-
-    DLog(@"fileData length: %d", [fileData length]);
-    NSData* postBodyAfterFile = [[NSString stringWithFormat:@"\r\n--%@--\r\n", kFormBoundary] dataUsingEncoding:NSUTF8StringEncoding];
-
-    long long totalPayloadLength = [postBodyBeforeFile length] + [fileData length] + [postBodyAfterFile length];
-    [req setValue:[[NSNumber numberWithLongLong:totalPayloadLength] stringValue] forHTTPHeaderField:@"Content-Length"];
-
-    if (chunkedMode) {
-        CFReadStreamRef readStream = NULL;
-        CFWriteStreamRef writeStream = NULL;
-        CFStreamCreateBoundPair(NULL, &readStream, &writeStream, kStreamBufferSize);
-        [req setHTTPBodyStream:CFBridgingRelease(readStream)];
-
-        [self.commandDelegate runInBackground:^{
-            if (CFWriteStreamOpen(writeStream)) {
-                NSData* chunks[] = {postBodyBeforeFile, fileData, postBodyAfterFile};
-                int numChunks = sizeof(chunks) / sizeof(chunks[0]);
-
-                for (int i = 0; i < numChunks; ++i) {
-                    CFIndex result = WriteDataToStream(chunks[i], writeStream);
-                    if (result <= 0) {
-                        break;
-                    }
-                }
-            } else {
-                NSLog(@"FileTransfer: Failed to open writeStream");
-            }
-            CFWriteStreamClose(writeStream);
-            CFRelease(writeStream);
-        }];
-    } else {
-        [postBodyBeforeFile appendData:fileData];
-        [postBodyBeforeFile appendData:postBodyAfterFile];
-        [req setHTTPBody:postBodyBeforeFile];
-    }
-    return req;
-}
-
-- (CDVFileTransferDelegate*)delegateForUploadCommand:(CDVInvokedUrlCommand*)command
-{
-    NSString* source = [command.arguments objectAtIndex:0];
-    NSString* server = [command.arguments objectAtIndex:1];
-    BOOL trustAllHosts = [[command.arguments objectAtIndex:6 withDefault:[NSNumber numberWithBool:NO]] boolValue]; // allow self-signed certs
-    NSString* objectId = [command.arguments objectAtIndex:9];
-
-    CDVFileTransferDelegate* delegate = [[CDVFileTransferDelegate alloc] init];
-
-    delegate.command = self;
-    delegate.callbackId = command.callbackId;
-    delegate.direction = CDV_TRANSFER_UPLOAD;
-    delegate.objectId = objectId;
-    delegate.source = source;
-    delegate.target = server;
-    delegate.trustAllHosts = trustAllHosts;
-    delegate.filePlugin = [self.commandDelegate getCommandInstance:@"File"];
-
-    return delegate;
-}
-
-- (void)fileDataForUploadCommand:(CDVInvokedUrlCommand*)command
-{
-    NSString* source = (NSString*)[command.arguments objectAtIndex:0];
-    NSString* server = [command.arguments objectAtIndex:1];
-    NSError* __autoreleasing err = nil;
-
-    CDVFilesystemURL *sourceURL = [CDVFilesystemURL fileSystemURLWithString:source];
-    NSObject<CDVFileSystem> *fs;
-    if (sourceURL) {
-        // Try to get a CDVFileSystem which will handle this file.
-        // This requires talking to the current CDVFile plugin.
-        fs = [[self.commandDelegate getCommandInstance:@"File"] filesystemForURL:sourceURL];
-    }
-    if (fs) {
-        [fs readFileAtURL:sourceURL start:0 end:-1 callback:^(NSData *fileData, NSString *mimeType, CDVFileError err) {
-            if (err) {
-                // We couldn't find the asset.  Send the appropriate error.
-                CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:[self createFileTransferError:NOT_FOUND_ERR AndSource:source AndTarget:server]];
-                [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
-            }  else {
-                [self uploadData:fileData command:command];
-            }
-        }];
-        return;
-    } else {
-        // Extract the path part out of a file: URL.
-        NSString* filePath = [source hasPrefix:@"/"] ? [source copy] : [(NSURL *)[NSURL URLWithString:source] path];
-        if (filePath == nil) {
-            // We couldn't find the asset.  Send the appropriate error.
-            CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:[self createFileTransferError:NOT_FOUND_ERR AndSource:source AndTarget:server]];
-            [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
-            return;
-        }
-
-        // Memory map the file so that it can be read efficiently even if it is large.
-        NSData* fileData = [NSData dataWithContentsOfFile:filePath options:NSDataReadingMappedIfSafe error:&err];
-
-        if (err != nil) {
-            NSLog(@"Error opening file %@: %@", source, err);
-            CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:[self createFileTransferError:NOT_FOUND_ERR AndSource:source AndTarget:server]];
-            [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
-        } else {
-            [self uploadData:fileData command:command];
-        }
-    }
-}
-
-- (void)upload:(CDVInvokedUrlCommand*)command
-{
-    // fileData and req are split into helper functions to ease the unit testing of delegateForUpload.
-    // First, get the file data.  This method will call `uploadData:command`.
-    [self fileDataForUploadCommand:command];
-}
-
-- (void)uploadData:(NSData*)fileData command:(CDVInvokedUrlCommand*)command
-{
-    NSURLRequest* req = [self requestForUploadCommand:command fileData:fileData];
-
-    if (req == nil) {
-        return;
-    }
-    CDVFileTransferDelegate* delegate = [self delegateForUploadCommand:command];
-    delegate.connection = [[NSURLConnection alloc] initWithRequest:req delegate:delegate startImmediately:NO];
-    if (self.queue == nil) {
-        self.queue = [[NSOperationQueue alloc] init];
-    }
-    [delegate.connection setDelegateQueue:self.queue];
-
-    // sets a background task ID for the transfer object.
-    delegate.backgroundTaskID = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{
-        [delegate cancelTransfer:delegate.connection];
-    }];
-
-    @synchronized (activeTransfers) {
-        activeTransfers[delegate.objectId] = delegate;
-    }
-    [delegate.connection start];
-}
-
-- (void)abort:(CDVInvokedUrlCommand*)command
-{
-    NSString* objectId = [command.arguments objectAtIndex:0];
-
-    @synchronized (activeTransfers) {
-        CDVFileTransferDelegate* delegate = activeTransfers[objectId];
-        if (delegate != nil) {
-            [delegate cancelTransfer:delegate.connection];
-            CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:[self createFileTransferError:CONNECTION_ABORTED AndSource:delegate.source AndTarget:delegate.target]];
-            [self.commandDelegate sendPluginResult:result callbackId:delegate.callbackId];
-        }
-    }
-}
-
-- (void)download:(CDVInvokedUrlCommand*)command
-{
-    DLog(@"File Transfer downloading file...");
-    NSString* source = [command.arguments objectAtIndex:0];
-    NSString* target = [command.arguments objectAtIndex:1];
-    BOOL trustAllHosts = [[command.arguments objectAtIndex:2 withDefault:[NSNumber numberWithBool:NO]] boolValue]; // allow self-signed certs
-    NSString* objectId = [command.arguments objectAtIndex:3];
-    NSDictionary* headers = [command.arguments objectAtIndex:4 withDefault:nil];
-
-    CDVPluginResult* result = nil;
-    CDVFileTransferError errorCode = 0;
-
-    NSURL* targetURL;
-
-    if ([target hasPrefix:@"/"]) {
-        /* Backwards-compatibility:
-         * Check here to see if it looks like the user passed in a raw filesystem path. (Perhaps they had the path saved, and were previously using it with the old version of File). If so, normalize it by removing empty path segments, and check with File to see if any of the installed filesystems will handle it. If so, then we will end up with a filesystem url to use for the remainder of this operation.
-         */
-        target = [target stringByReplacingOccurrencesOfString:@"//" withString:@"/"];
-        targetURL = [[self.commandDelegate getCommandInstance:@"File"] fileSystemURLforLocalPath:target].url;
-    } else {
-        targetURL = [NSURL URLWithString:target];
-    }
-
-    NSURL* sourceURL = [NSURL URLWithString:source];
-
-    if (!sourceURL) {
-        errorCode = INVALID_URL_ERR;
-        NSLog(@"File Transfer Error: Invalid server URL %@", source);
-    } else if (![targetURL isFileURL]) {
-        CDVFilesystemURL *fsURL = [CDVFilesystemURL fileSystemURLWithString:target];
-        if (!fsURL) {
-           errorCode = FILE_NOT_FOUND_ERR;
-           NSLog(@"File Transfer Error: Invalid file path or URL %@", target);
-        }
-    }
-
-    if (errorCode > 0) {
-        result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:[self createFileTransferError:errorCode AndSource:source AndTarget:target]];
-        [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
-        return;
-    }
-
-    NSMutableURLRequest* req = [NSMutableURLRequest requestWithURL:sourceURL];
-    [self applyRequestHeaders:headers toRequest:req];
-
-    CDVFileTransferDelegate* delegate = [[CDVFileTransferDelegate alloc] init];
-    delegate.command = self;
-    delegate.direction = CDV_TRANSFER_DOWNLOAD;
-    delegate.callbackId = command.callbackId;
-    delegate.objectId = objectId;
-    delegate.source = source;
-    delegate.target = [targetURL absoluteString];
-    delegate.targetURL = targetURL;
-    delegate.trustAllHosts = trustAllHosts;
-    delegate.filePlugin = [self.commandDelegate getCommandInstance:@"File"];
-    delegate.backgroundTaskID = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{
-        [delegate cancelTransfer:delegate.connection];
-    }];
-
-    delegate.connection = [[NSURLConnection alloc] initWithRequest:req delegate:delegate startImmediately:NO];
-
-    if (self.queue == nil) {
-        self.queue = [[NSOperationQueue alloc] init];
-    }
-    [delegate.connection setDelegateQueue:self.queue];
-
-    @synchronized (activeTransfers) {
-        activeTransfers[delegate.objectId] = delegate;
-    }
-    // Downloads can take time
-    // sending this to a new thread calling the download_async method
-    dispatch_async(
-                   dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, (unsigned long)NULL),
-                   ^(void) { [delegate.connection start];}
-                   );
-}
-
-- (NSMutableDictionary*)createFileTransferError:(int)code AndSource:(NSString*)source AndTarget:(NSString*)target
-{
-    NSMutableDictionary* result = [NSMutableDictionary dictionaryWithCapacity:3];
-
-    [result setObject:[NSNumber numberWithInt:code] forKey:@"code"];
-    if (source != nil) {
-        [result setObject:source forKey:@"source"];
-    }
-    if (target != nil) {
-        [result setObject:target forKey:@"target"];
-    }
-    NSLog(@"FileTransferError %@", result);
-
-    return result;
-}
-
-- (NSMutableDictionary*)createFileTransferError:(int)code
-                                      AndSource:(NSString*)source
-                                      AndTarget:(NSString*)target
-                                  AndHttpStatus:(int)httpStatus
-                                        AndBody:(NSString*)body
-{
-    NSMutableDictionary* result = [NSMutableDictionary dictionaryWithCapacity:5];
-
-    [result setObject:[NSNumber numberWithInt:code] forKey:@"code"];
-    if (source != nil) {
-        [result setObject:source forKey:@"source"];
-    }
-    if (target != nil) {
-        [result setObject:target forKey:@"target"];
-    }
-    [result setObject:[NSNumber numberWithInt:httpStatus] forKey:@"http_status"];
-    if (body != nil) {
-        [result setObject:body forKey:@"body"];
-    }
-    NSLog(@"FileTransferError %@", result);
-
-    return result;
-}
-
-- (void)onReset {
-    @synchronized (activeTransfers) {
-        while ([activeTransfers count] > 0) {
-            CDVFileTransferDelegate* delegate = [activeTransfers allValues][0];
-            [delegate cancelTransfer:delegate.connection];
-        }
-    }
-}
-
-@end
-
-@interface CDVFileTransferEntityLengthRequest : NSObject {
-    NSURLConnection* _connection;
-    CDVFileTransferDelegate* __weak _originalDelegate;
-}
-
-- (CDVFileTransferEntityLengthRequest*)initWithOriginalRequest:(NSURLRequest*)originalRequest andDelegate:(CDVFileTransferDelegate*)originalDelegate;
-
-@end
-
-@implementation CDVFileTransferEntityLengthRequest
-
-- (CDVFileTransferEntityLengthRequest*)initWithOriginalRequest:(NSURLRequest*)originalRequest andDelegate:(CDVFileTransferDelegate*)originalDelegate
-{
-    if (self) {
-        DLog(@"Requesting entity length for GZIPped content...");
-
-        NSMutableURLRequest* req = [originalRequest mutableCopy];
-        [req setHTTPMethod:@"HEAD"];
-        [req setValue:@"identity" forHTTPHeaderField:@"Accept-Encoding"];
-
-        _originalDelegate = originalDelegate;
-        _connection = [NSURLConnection connectionWithRequest:req delegate:self];
-    }
-    return self;
-}
-
-- (void)connection:(NSURLConnection*)connection didReceiveResponse:(NSURLResponse*)response
-{
-    DLog(@"HEAD request returned; content-length is %lld", [response expectedContentLength]);
-    [_originalDelegate updateBytesExpected:[response expectedContentLength]];
-}
-
-- (void)connection:(NSURLConnection*)connection didReceiveData:(NSData*)data
-{}
-
-- (void)connectionDidFinishLoading:(NSURLConnection*)connection
-{}
-
-@end
-
-@implementation CDVFileTransferDelegate
-
-@synthesize callbackId, connection = _connection, source, target, responseData, responseHeaders, command, bytesTransfered, bytesExpected, direction, responseCode, objectId, targetFileHandle, filePlugin;
-
-- (void)connectionDidFinishLoading:(NSURLConnection*)connection
-{
-    NSString* uploadResponse = nil;
-    NSString* downloadResponse = nil;
-    NSMutableDictionary* uploadResult;
-    CDVPluginResult* result = nil;
-
-    NSLog(@"File Transfer Finished with response code %d", self.responseCode);
-
-    if (self.direction == CDV_TRANSFER_UPLOAD) {
-        uploadResponse = [[NSString alloc] initWithData:self.responseData encoding:NSUTF8StringEncoding];
-
-        if ((self.responseCode >= 200) && (self.responseCode < 300)) {
-            // create dictionary to return FileUploadResult object
-            uploadResult = [NSMutableDictionary dictionaryWithCapacity:3];
-            if (uploadResponse != nil) {
-                [uploadResult setObject:uploadResponse forKey:@"response"];
-                [uploadResult setObject:self.responseHeaders forKey:@"headers"];
-            }
-            [uploadResult setObject:[NSNumber numberWithLongLong:self.bytesTransfered] forKey:@"bytesSent"];
-            [uploadResult setObject:[NSNumber numberWithInt:self.responseCode] forKey:@"responseCode"];
-            result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:uploadResult];
-        } else {
-            result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:[command createFileTransferError:CONNECTION_ERR AndSource:source AndTarget:target AndHttpStatus:self.responseCode AndBody:uploadResponse]];
-        }
-    }
-    if (self.direction == CDV_TRANSFER_DOWNLOAD) {
-        if (self.targetFileHandle) {
-            [self.targetFileHandle closeFile];
-            self.targetFileHandle = nil;
-            DLog(@"File Transfer Download success");
-
-            result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:[self.filePlugin makeEntryForURL:self.targetURL]];
-        } else {
-            downloadResponse = [[NSString alloc] initWithData:self.responseData encoding:NSUTF8StringEncoding];
-            result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:[command createFileTransferError:CONNECTION_ERR AndSource:source AndTarget:target AndHttpStatus:self.responseCode AndBody:downloadResponse]];
-        }
-    }
-
-    [self.command.commandDelegate sendPluginResult:result callbackId:callbackId];
-
-    // remove connection for activeTransfers
-    @synchronized (command.activeTransfers) {
-        [command.activeTransfers removeObjectForKey:objectId];
-        // remove background id task in case our upload was done in the background
-        [[UIApplication sharedApplication] endBackgroundTask:self.backgroundTaskID];
-        self.backgroundTaskID = UIBackgroundTaskInvalid;
-    }
-}
-
-- (void)removeTargetFile
-{
-    NSFileManager* fileMgr = [NSFileManager defaultManager];
-
-    [fileMgr removeItemAtPath:[self targetFilePath] error:nil];
-}
-
-- (void)cancelTransfer:(NSURLConnection*)connection
-{
-    [connection cancel];
-    @synchronized (self.command.activeTransfers) {
-        CDVFileTransferDelegate* delegate = self.command.activeTransfers[self.objectId];
-        [self.command.activeTransfers removeObjectForKey:self.objectId];
-        [[UIApplication sharedApplication] endBackgroundTask:delegate.backgroundTaskID];
-        delegate.backgroundTaskID = UIBackgroundTaskInvalid;
-    }
-
-    [self removeTargetFile];
-}
-
-- (void)cancelTransferWithError:(NSURLConnection*)connection errorMessage:(NSString*)errorMessage
-{
-    CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_IO_EXCEPTION messageAsDictionary:[self.command createFileTransferError:FILE_NOT_FOUND_ERR AndSource:self.source AndTarget:self.target AndHttpStatus:self.responseCode AndBody:errorMessage]];
-
-    NSLog(@"File Transfer Error: %@", errorMessage);
-    [self cancelTransfer:connection];
-    [self.command.commandDelegate sendPluginResult:result callbackId:callbackId];
-}
-
-- (NSString *)targetFilePath
-{
-    NSString *path = nil;
-    CDVFilesystemURL *sourceURL = [CDVFilesystemURL fileSystemURLWithString:self.target];
-    if (sourceURL && sourceURL.fileSystemName != nil) {
-        // This requires talking to the current CDVFile plugin
-        NSObject<CDVFileSystem> *fs = [self.filePlugin filesystemForURL:sourceURL];
-        path = [fs filesystemPathForURL:sourceURL];
-    } else {
-        // Extract the path part out of a file: URL.
-        path = [self.target hasPrefix:@"/"] ? [self.target copy] : [(NSURL *)[NSURL URLWithString:self.target] path];
-    }
-    return path;
-}
-
-- (void)connection:(NSURLConnection*)connection didReceiveResponse:(NSURLResponse*)response
-{
-    NSError* __autoreleasing error = nil;
-
-    self.mimeType = [response MIMEType];
-    self.targetFileHandle = nil;
-
-    // required for iOS 4.3, for some reason; response is
-    // a plain NSURLResponse, not the HTTP subclass
-    if ([response isKindOfClass:[NSHTTPURLResponse class]]) {
-        NSHTTPURLResponse* httpResponse = (NSHTTPURLResponse*)response;
-
-        self.responseCode = [httpResponse statusCode];
-        self.bytesExpected = [response expectedContentLength];
-        self.responseHeaders = [httpResponse allHeaderFields];
-        if ((self.direction == CDV_TRANSFER_DOWNLOAD) && (self.responseCode == 200) && (self.bytesExpected == NSURLResponseUnknownLength)) {
-            // Kick off HEAD request to server to get real length
-            // bytesExpected will be updated when that response is returned
-            self.entityLengthRequest = [[CDVFileTransferEntityLengthRequest alloc] initWithOriginalRequest:connection.currentRequest andDelegate:self];
-        }
-    } else if ([response.URL isFileURL]) {
-        NSDictionary* attr = [[NSFileManager defaultManager] attributesOfItemAtPath:[response.URL path] error:nil];
-        self.responseCode = 200;
-        self.bytesExpected = [attr[NSFileSize] longLongValue];
-    } else {
-        self.responseCode = 200;
-        self.bytesExpected = NSURLResponseUnknownLength;
-    }
-    if ((self.direction == CDV_TRANSFER_DOWNLOAD) && (self.responseCode >= 200) && (self.responseCode < 300)) {
-        // Download response is okay; begin streaming output to file
-        NSString *filePath = [self targetFilePath];
-        if (filePath == nil) {
-            // We couldn't find the asset.  Send the appropriate error.
-            [self cancelTransferWithError:connection errorMessage:[NSString stringWithFormat:@"Could not create target file"]];
-            return;
-        }
-
-        NSString* parentPath = [filePath stringByDeletingLastPathComponent];
-
-        // create parent directories if needed
-        if ([[NSFileManager defaultManager] createDirectoryAtPath:parentPath withIntermediateDirectories:YES attributes:nil error:&error] == NO) {
-            if (error) {
-                [self cancelTransferWithError:connection errorMessage:[NSString stringWithFormat:@"Could not create path to save downloaded file: %@", [error localizedDescription]]];
-            } else {
-                [self cancelTransferWithError:connection errorMessage:@"Could not create path to save downloaded file"];
-            }
-            return;
-        }
-        // create target file
-        if ([[NSFileManager defaultManager] createFileAtPath:filePath contents:nil attributes:nil] == NO) {
-            [self cancelTransferWithError:connection errorMessage:@"Could not create target file"];
-            return;
-        }
-        // open target file for writing
-        self.targetFileHandle = [NSFileHandle fileHandleForWritingAtPath:filePath];
-        if (self.targetFileHandle == nil) {
-            [self cancelTransferWithError:connection errorMessage:@"Could not open target file for writing"];
-        }
-        DLog(@"Streaming to file %@", filePath);
-    }
-}
-
-- (void)connection:(NSURLConnection*)connection didFailWithError:(NSError*)error
-{
-    NSString* body = [[NSString alloc] initWithData:self.responseData encoding:NSUTF8StringEncoding];
-    CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:[command createFileTransferError:CONNECTION_ERR AndSource:source AndTarget:target AndHttpStatus:self.responseCode AndBody:body]];
-
-    NSLog(@"File Transfer Error: %@", [error localizedDescription]);
-
-    [self cancelTransfer:connection];
-    [self.command.commandDelegate sendPluginResult:result callbackId:callbackId];
-}
-
-- (void)connection:(NSURLConnection*)connection didReceiveData:(NSData*)data
-{
-    self.bytesTransfered += data.length;
-    if (self.targetFileHandle) {
-        [self.targetFileHandle writeData:data];
-    } else {
-        [self.responseData appendData:data];
-    }
-    [self updateProgress];
-}
-
-- (void)updateBytesExpected:(long long)newBytesExpected
-{
-    DLog(@"Updating bytesExpected to %lld", newBytesExpected);
-    self.bytesExpected = newBytesExpected;
-    [self updateProgress];
-}
-
-- (void)updateProgress
-{
-    if (self.direction == CDV_TRANSFER_DOWNLOAD) {
-        BOOL lengthComputable = (self.bytesExpected != NSURLResponseUnknownLength);
-        // If the response is GZipped, and we have an outstanding HEAD request to get
-        // the length, then hold off on sending progress events.
-        if (!lengthComputable && (self.entityLengthRequest != nil)) {
-            return;
-        }
-        NSMutableDictionary* downloadProgress = [NSMutableDictionary dictionaryWithCapacity:3];
-        [downloadProgress setObject:[NSNumber numberWithBool:lengthComputable] forKey:@"lengthComputable"];
-        [downloadProgress setObject:[NSNumber numberWithLongLong:self.bytesTransfered] forKey:@"loaded"];
-        [downloadProgress setObject:[NSNumber numberWithLongLong:self.bytesExpected] forKey:@"total"];
-        CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:downloadProgress];
-        [result setKeepCallbackAsBool:true];
-        [self.command.commandDelegate sendPluginResult:result callbackId:callbackId];
-    }
-}
-
-- (void)connection:(NSURLConnection*)connection didSendBodyData:(NSInteger)bytesWritten totalBytesWritten:(NSInteger)totalBytesWritten totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite
-{
-    if (self.direction == CDV_TRANSFER_UPLOAD) {
-        NSMutableDictionary* uploadProgress = [NSMutableDictionary dictionaryWithCapacity:3];
-
-        [uploadProgress setObject:[NSNumber numberWithBool:true] forKey:@"lengthComputable"];
-        [uploadProgress setObject:[NSNumber numberWithLongLong:totalBytesWritten] forKey:@"loaded"];
-        [uploadProgress setObject:[NSNumber numberWithLongLong:totalBytesExpectedToWrite] forKey:@"total"];
-        CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:uploadProgress];
-        [result setKeepCallbackAsBool:true];
-        [self.command.commandDelegate sendPluginResult:result callbackId:callbackId];
-    }
-    self.bytesTransfered = totalBytesWritten;
-}
-
-// for self signed certificates
-- (void)connection:(NSURLConnection*)connection willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge*)challenge
-{
-    if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) {
-        if (self.trustAllHosts) {
-            NSURLCredential* credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust];
-            [challenge.sender useCredential:credential forAuthenticationChallenge:challenge];
-        }
-        [challenge.sender continueWithoutCredentialForAuthenticationChallenge:challenge];
-    } else {
-        [challenge.sender performDefaultHandlingForAuthenticationChallenge:challenge];
-    }
-}
-
-- (id)init
-{
-    if ((self = [super init])) {
-        self.responseData = [NSMutableData data];
-        self.targetFileHandle = nil;
-    }
-    return self;
-}
-
-@end
diff --git a/src/ubuntu/file-transfer.cpp b/src/ubuntu/file-transfer.cpp
deleted file mode 100644
index 192ba98..0000000
--- a/src/ubuntu/file-transfer.cpp
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- *
- * Copyright 2013 Canonical Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-#include "file-transfer.h"
-#include <cassert>
-
-void FileTransfer::download(int scId, int ecId, const QString& url, const QString &target, bool /*trustAllHost*/, int id, const QVariantMap &/*headers*/) {
-    QSharedPointer<FileTransferRequest> request(new FileTransferRequest(_manager, scId, ecId, id, this));
-
-    assert(_id2request.find(id) == _id2request.end());
-
-    _id2request.insert(id, request);
-
-    request->connect(request.data(), &FileTransferRequest::done, [&]() {
-        auto it = _id2request.find(id);
-        while (it != _id2request.end() && it.key() == id) {
-            if (it.value().data() == request.data()) {
-                _id2request.erase(it);
-                break;
-            }
-            it++;
-        }
-    });
-    request->download(url, target);
-}
-
-void FileTransfer::upload(int scId, int ecId, const QString &filePath, const QString& url, const QString& fileKey, const QString& fileName, const QString& mimeType,
-                          const QVariantMap & params, bool /*trustAllHosts*/, bool /*chunkedMode*/, const QVariantMap &headers, int id, const QString &httpMethod) {
-    QSharedPointer<FileTransferRequest> request(new FileTransferRequest(_manager, scId, ecId, id, this));
-
-    assert(_id2request.find(id) == _id2request.end());
-
-    _id2request.insert(id, request);
-
-    request->connect(request.data(), &FileTransferRequest::done, [&]() {
-        auto it = _id2request.find(id);
-        while (it != _id2request.end() && it.key() == id) {
-            if (it.value().data() == request.data()) {
-                _id2request.erase(it);
-                break;
-            }
-            it++;
-        }
-    });
-    request->upload(url, filePath, fileKey, fileName, mimeType, params, headers);
-}
-
-void FileTransfer::abort(int scId, int ecId, int id) {
-    Q_UNUSED(scId)
-    Q_UNUSED(ecId)
-
-    auto it = _id2request.find(id);
-    while (it != _id2request.end() && it.key() == id) {
-        (*it)->abort();
-        it++;
-    }
-}
-
-void FileTransferRequest::download(const QString& uri, const QString &target) {
-    QUrl url(uri);
-    QNetworkRequest request;
-
-    if (!url.isValid()) {
-        QVariantMap map;
-        map.insert("code", INVALID_URL_ERR);
-        map.insert("source", uri);
-        map.insert("target", target);
-        _plugin->cb(_ecId, map);
-        emit done();
-        return;
-    }
-
-    request.setUrl(url);
-    if (url.password().size() || url.userName().size()) {
-        QString headerData = "Basic " + (url.userName() + ":" + url.password()).toLocal8Bit().toBase64();
-        request.setRawHeader("Authorization", headerData.toLocal8Bit());
-    }
-    _reply = QSharedPointer<QNetworkReply>(_manager.get(request));
-
-    _reply->connect(_reply.data(), &QNetworkReply::finished, [this, target, uri]() {
-        if (!_scId || _reply->error() != QNetworkReply::NoError)
-            return;
-
-        QFile res(target);
-        qCritical() << target;
-        if (target[0] != '/' || !res.open(QIODevice::WriteOnly)) {
-            QVariantMap map;
-            map.insert("code", INVALID_URL_ERR);
-            map.insert("source", uri);
-            map.insert("target", target);
-            _plugin->cb(_ecId, map);
-            emit done();
-            return;
-        }
-        res.write(_reply->readAll());
-
-        QFileInfo info(target);
-        QVariantMap map;
-        map.insert("isFile", true);
-        map.insert("isDirectory", false);
-        map.insert("name", info.fileName());
-        map.insert("fullPath", info.absoluteFilePath());
-
-        _plugin->cb(_scId, map);
-
-        emit done();
-    });
-    _reply->connect(_reply.data(), SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(error(QNetworkReply::NetworkError)));
-    _reply->connect(_reply.data(), SIGNAL(downloadProgress(qint64, qint64)), this, SLOT(progress(qint64, qint64)));
-}
-
-void FileTransferRequest::upload(const QString& _url, const QString& filePath, QString fileKey, QString fileName, QString mimeType, const QVariantMap &params, const QVariantMap &headers) {
-    QUrl url(_url);
-    QNetworkRequest request;
-
-    if (!url.isValid()) {
-        QVariantMap map;
-        map.insert("code", INVALID_URL_ERR);
-        map.insert("source", filePath);
-        map.insert("target", _url);
-        _plugin->cb(_ecId, map);
-        emit done();
-        return;
-    }
-
-    QFile file(filePath);
-    if (filePath[0] != '/' || !file.open(QIODevice::ReadOnly)) {
-        QVariantMap map;
-        map.insert("code", FILE_NOT_FOUND_ERR);
-        map.insert("source", filePath);
-        map.insert("target", _url);
-        _plugin->cb(_ecId, map);
-        emit done();
-        return;
-    }
-    QString content{file.readAll()};
-
-    request.setUrl(url);
-    if (url.password().size() || url.userName().size()) {
-        QString headerData = "Basic " + (url.userName() + ":" + url.password()).toLocal8Bit().toBase64();
-        request.setRawHeader("Authorization", headerData.toLocal8Bit());
-    }
-
-    for (const QString &key: headers.keys()) {
-        const QString &value = headers.find(key)->toString();
-        request.setRawHeader(key.toUtf8(), value.toUtf8());
-    }
-
-    QString boundary = QString("CORDOVA-QT-%1A").arg(qrand());
-    while (content.contains(boundary)) {
-        boundary += QString("B%1A").arg(qrand());
-    }
-
-    request.setHeader(QNetworkRequest::ContentTypeHeader, QString("multipart/form-data; boundary=") + boundary);
-
-    fileKey.replace("\"", "");
-    fileName.replace("\"", "");
-    mimeType.replace("\"", "");
-    QString part = "--" + boundary + "\r\n";
-
-    part += "Content-Disposition: form-data; name=\"" + fileKey +"\"; filename=\"" + fileName + "\"\r\n";
-    part += "Content-Type: " + mimeType + "\r\n\r\n";
-    part += content + "\r\n";
-
-    for (QString key: params.keys()) {
-        part += "--" + boundary + "\r\n";
-        part += "Content-Disposition: form-data; name=\"" +  key + "\";\r\n\r\n";
-        part += params.find(key)->toString();
-        part += "\r\n";
-    }
-
-    part += QString("--") + boundary + "--" + "\r\n";
-
-    _reply = QSharedPointer<QNetworkReply>(_manager.post(request, QByteArray(part.toUtf8())));
-
-    _reply->connect(_reply.data(), &QNetworkReply::finished, [this, content]() {
-        if (_reply->error() != QNetworkReply::NoError)
-            return;
-        int status = 200;
-        QVariant statusCode = _reply->attribute(QNetworkRequest::HttpStatusCodeAttribute);
-
-        if (statusCode.isValid()) {
-            status = statusCode.toInt();
-        }
-
-        QVariantMap map;
-        map.insert("responseCode", status);
-        map.insert("response", QString(_reply->readAll()));
-        map.insert("bytesSent", content.size());
-        _plugin->cb(_scId, map);
-        emit done();
-    });
-    _reply->connect(_reply.data(), SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(error(QNetworkReply::NetworkError)));
-    _reply->connect(_reply.data(), SIGNAL(uploadProgress(qint64, qint64)), this, SLOT(progress(qint64, qint64)));
-}
-
-void FileTransferRequest::abort() {
-    QVariantMap map;
-    map.insert("code", ABORT_ERR);
-    _plugin->cb(_ecId, map);
-    _scId = 0;
-    emit done();
-}
-
-void FileTransferRequest::error(QNetworkReply::NetworkError code) {
-    Q_UNUSED(code);
-
-    int status = 404;
-    QVariant statusCode = _reply->attribute(QNetworkRequest::HttpStatusCodeAttribute);
-
-    if (statusCode.isValid()) {
-        status = statusCode.toInt();
-    }
-
-    QVariantMap map;
-    map.insert("http_status", status);
-    map.insert("body", QString(_reply->readAll()));
-    map.insert("code", CONNECTION_ERR);
-    _plugin->cb(_ecId, map);
-    emit done();
-}
-
-void FileTransferRequest::progress(qint64 bytesReceived, qint64 bytesTotal) {
-    QVariantMap map;
-    map.insert("lengthComputable", true);
-    map.insert("total", bytesTotal);
-    map.insert("loaded", bytesReceived);
-
-    if (bytesReceived && bytesTotal && _scId)
-        _plugin->callbackWithoutRemove(_scId, CordovaInternal::format(map));
-}
diff --git a/src/ubuntu/file-transfer.h b/src/ubuntu/file-transfer.h
deleted file mode 100644
index b30a99f..0000000
--- a/src/ubuntu/file-transfer.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- *
- * Copyright 2013 Canonical Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-#ifndef FILE_TRANSFER_H_SDASDASDAS
-#define FILE_TRANSFER_H_SDASDASDAS
-
-#include <QtCore>
-#include <QtNetwork>
-
-#include <cplugin.h>
-
-class FileTransferRequest: public QObject {
-    Q_OBJECT
-
-    QNetworkAccessManager &_manager;
-    int _scId, _ecId;
-    int _id;
-    QSharedPointer<QNetworkReply> _reply;
-
-    enum FileTransferError {
-        FILE_NOT_FOUND_ERR = 1,
-        INVALID_URL_ERR = 2,
-        CONNECTION_ERR = 3,
-        ABORT_ERR = 4
-    };
-
-public:
-    FileTransferRequest(QNetworkAccessManager &manager, int scId, int ecId, int id, CPlugin *plugin):
-        _manager(manager),
-        _scId(scId),
-        _ecId(ecId),
-        _id(id),
-        _plugin(plugin) {
-    }
-
-    void download(const QString& url, const QString &target);
-    void upload(const QString& _url, const QString& filePath, QString fileKey, QString fileName, QString mimeType, const QVariantMap &params, const QVariantMap &headers);
-    void abort();
-
-signals:
-    void done();
-
-private slots:
-    void progress(qint64 bytesReceived, qint64 bytesTotal);
-    void error(QNetworkReply::NetworkError code);
-private:
-    CPlugin *_plugin;
-    Q_DISABLE_COPY(FileTransferRequest);
-};
-
-class FileTransfer : public CPlugin {
-    Q_OBJECT
-public:
-    explicit FileTransfer(Cordova *cordova): CPlugin(cordova) {
-    }
-
-    virtual const QString fullName() override {
-        return FileTransfer::fullID();
-    }
-
-    virtual const QString shortName() override {
-        return "FileTransfer";
-    }
-
-    static const QString fullID() {
-        return "FileTransfer";
-    }
-
-public slots:
-    void abort(int scId, int ecId, int id);
-    void download(int scId, int ecId, const QString& url, const QString &target, bool /*trustAllHost*/, int id, const QVariantMap &/*headers*/);
-    void upload(int scId, int ecId, const QString &filePath, const QString& url, const QString& fileKey, const QString& fileName, const QString& mimeType,
-                const QVariantMap & params, bool /*trustAllHosts*/, bool /*chunkedMode*/, const QVariantMap &headers, int id, const QString &httpMethod);
-
-private:
-    QNetworkAccessManager _manager;
-    QMultiMap<int, QSharedPointer<FileTransferRequest> > _id2request;
-    int lastRequestId;
-};
-
-#endif
diff --git a/src/wp/FileTransfer.cs b/src/wp/FileTransfer.cs
deleted file mode 100644
index f8b6ed5..0000000
--- a/src/wp/FileTransfer.cs
+++ /dev/null
@@ -1,864 +0,0 @@
-/*
-	Licensed under the Apache License, Version 2.0 (the "License");
-	you may not use this file except in compliance with the License.
-	You may obtain a copy of the License at
-
-	http://www.apache.org/licenses/LICENSE-2.0
-
-	Unless required by applicable law or agreed to in writing, software
-	distributed under the License is distributed on an "AS IS" BASIS,
-	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-	See the License for the specific language governing permissions and
-	limitations under the License.
-*/
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.IO.IsolatedStorage;
-using System.Net;
-using System.Runtime.Serialization;
-using System.Windows;
-using System.Security;
-using System.Diagnostics;
-
-namespace WPCordovaClassLib.Cordova.Commands
-{
-    public class FileTransfer : BaseCommand
-    {
-        public class DownloadRequestState
-        {
-            // This class stores the State of the request.
-            public HttpWebRequest request;
-            public TransferOptions options;
-            public bool isCancelled;
-
-            public DownloadRequestState()
-            {
-                request = null;
-                options = null;
-                isCancelled = false;
-            }
-        }
-
-
-        public class TransferOptions
-        {
-            /// File path to upload  OR File path to download to
-            public string FilePath { get; set; }
-
-            public string Url { get; set; }
-            /// Flag to recognize if we should trust every host (only in debug environments)
-            public bool TrustAllHosts { get; set; }
-            public string Id { get; set; }
-            public string Headers { get; set; }
-            public string CallbackId { get; set; }
-            public bool ChunkedMode { get; set; }
-            /// Server address
-            public string Server { get; set; }
-            /// File key
-            public string FileKey { get; set; }
-            /// File name on the server
-            public string FileName { get; set; }
-            /// File Mime type
-            public string MimeType { get; set; }
-            /// Additional options
-            public string Params { get; set; }
-            public string Method { get; set; }
-
-            public TransferOptions()
-            {
-                FileKey = "file";
-                FileName = "image.jpg";
-                MimeType = "image/jpeg";
-            }
-        }
-
-        /// <summary>
-        /// Boundary symbol
-        /// </summary>
-        private string Boundary = "----------------------------" + DateTime.Now.Ticks.ToString("x");
-
-        // Error codes
-        public const int FileNotFoundError = 1;
-        public const int InvalidUrlError = 2;
-        public const int ConnectionError = 3;
-        public const int AbortError = 4; // not really an error, but whatevs
-
-        private static Dictionary<string, DownloadRequestState> InProcDownloads = new Dictionary<string,DownloadRequestState>();
-
-
-        /// <summary>
-        /// Uploading response info
-        /// </summary>
-        [DataContract]
-        public class FileUploadResult
-        {
-            /// <summary>
-            /// Amount of sent bytes
-            /// </summary>
-            [DataMember(Name = "bytesSent")]
-            public long BytesSent { get; set; }
-
-            /// <summary>
-            /// Server response code
-            /// </summary>
-            [DataMember(Name = "responseCode")]
-            public long ResponseCode { get; set; }
-
-            /// <summary>
-            /// Server response
-            /// </summary>
-            [DataMember(Name = "response", EmitDefaultValue = false)]
-            public string Response { get; set; }
-
-            /// <summary>
-            /// Creates FileUploadResult object with response values
-            /// </summary>
-            /// <param name="bytesSent">Amount of sent bytes</param>
-            /// <param name="responseCode">Server response code</param>
-            /// <param name="response">Server response</param>
-            public FileUploadResult(long bytesSent, long responseCode, string response)
-            {
-                this.BytesSent = bytesSent;
-                this.ResponseCode = responseCode;
-                this.Response = response;
-            }
-        }
-        /// <summary>
-        /// Represents transfer error codes for callback
-        /// </summary>
-        [DataContract]
-        public class FileTransferError
-        {
-            /// <summary>
-            /// Error code
-            /// </summary>
-            [DataMember(Name = "code", IsRequired = true)]
-            public int Code { get; set; }
-
-            /// <summary>
-            /// The source URI
-            /// </summary>
-            [DataMember(Name = "source", IsRequired = true)]
-            public string Source { get; set; }
-
-            /// <summary>
-            /// The target URI
-            /// </summary>
-            ///
-            [DataMember(Name = "target", IsRequired = true)]
-            public string Target { get; set; }
-
-            [DataMember(Name = "body", IsRequired = true)]
-            public string Body { get; set; }
-
-            /// <summary>
-            /// The http status code response from the remote URI
-            /// </summary>
-            [DataMember(Name = "http_status", IsRequired = true)]
-            public int HttpStatus { get; set; }
-
-            /// <summary>
-            /// Creates FileTransferError object
-            /// </summary>
-            /// <param name="errorCode">Error code</param>
-            public FileTransferError(int errorCode)
-            {
-                this.Code = errorCode;
-                this.Source = null;
-                this.Target = null;
-                this.HttpStatus = 0;
-                this.Body = "";
-            }
-            public FileTransferError(int errorCode, string source, string target, int status, string body = "")
-            {
-                this.Code = errorCode;
-                this.Source = source;
-                this.Target = target;
-                this.HttpStatus = status;
-                this.Body = body;
-            }
-        }
-
-        /// <summary>
-        /// Represents a singular progress event to be passed back to javascript
-        /// </summary>
-        [DataContract]
-        public class FileTransferProgress
-        {
-            /// <summary>
-            /// Is the length of the response known?
-            /// </summary>
-            [DataMember(Name = "lengthComputable", IsRequired = true)]
-            public bool LengthComputable { get; set; }
-            /// <summary>
-            /// amount of bytes loaded
-            /// </summary>
-            [DataMember(Name = "loaded", IsRequired = true)]
-            public long BytesLoaded { get; set; }
-            /// <summary>
-            /// Total bytes
-            /// </summary>
-            [DataMember(Name = "total", IsRequired = false)]
-            public long BytesTotal { get; set; }
-
-            public FileTransferProgress(long bTotal = 0, long bLoaded = 0)
-            {
-                LengthComputable = bTotal > 0;
-                BytesLoaded = bLoaded;
-                BytesTotal = bTotal;
-            }
-
-
-        }
-
-        /// <summary>
-        /// Upload options
-        /// </summary>
-        //private TransferOptions uploadOptions;
-
-        /// <summary>
-        /// Bytes sent
-        /// </summary>
-        private long bytesSent;
-
-        /// <summary>
-        /// sends a file to a server
-        /// </summary>
-        /// <param name="options">Upload options</param>
-        /// exec(win, fail, 'FileTransfer', 'upload', [filePath, server, fileKey, fileName, mimeType, params, trustAllHosts, chunkedMode, headers, this._id, httpMethod]);
-        public void upload(string options)
-        {
-            options = options.Replace("{}", ""); // empty objects screw up the Deserializer
-            string callbackId = "";
-
-            TransferOptions uploadOptions = null;
-            HttpWebRequest webRequest = null;
-
-            try
-            {
-                try
-                {
-                    string[] args = JSON.JsonHelper.Deserialize<string[]>(options);
-                    uploadOptions = new TransferOptions();
-                    uploadOptions.FilePath = args[0];
-                    uploadOptions.Server = args[1];
-                    uploadOptions.FileKey = args[2];
-                    uploadOptions.FileName = args[3];
-                    uploadOptions.MimeType = args[4];
-                    uploadOptions.Params = args[5];
-
-
-                    bool trustAll = false;
-                    bool.TryParse(args[6],out trustAll);
-                    uploadOptions.TrustAllHosts = trustAll;
-
-                    bool doChunked = false;
-                    bool.TryParse(args[7], out doChunked);
-                    uploadOptions.ChunkedMode = doChunked;
-
-                    //8 : Headers
-                    //9 : id
-                    //10: method
-
-                    uploadOptions.Headers = args[8];
-                    uploadOptions.Id = args[9];
-                    uploadOptions.Method = args[10];
-
-                    uploadOptions.CallbackId = callbackId = args[11];
-                }
-                catch (Exception)
-                {
-                    DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION));
-                    return;
-                }
-
-                Uri serverUri;
-                try
-                {
-                    serverUri = new Uri(uploadOptions.Server);
-                }
-                catch (Exception)
-                {
-                    DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, new FileTransferError(InvalidUrlError, uploadOptions.Server, null, 0)));
-                    return;
-                }
-                webRequest = (HttpWebRequest)WebRequest.Create(serverUri);
-                webRequest.ContentType = "multipart/form-data; boundary=" + Boundary;
-                webRequest.Method = uploadOptions.Method;
-
-                if (!string.IsNullOrEmpty(uploadOptions.Headers))
-                {
-                    Dictionary<string, string> headers = parseHeaders(uploadOptions.Headers);
-                    foreach (string key in headers.Keys)
-                    {
-                        webRequest.Headers[key] = headers[key];
-                    }
-                }
-
-                DownloadRequestState reqState = new DownloadRequestState();
-                reqState.options = uploadOptions;
-                reqState.request = webRequest;
-
-                InProcDownloads[uploadOptions.Id] = reqState;
-
-
-                webRequest.BeginGetRequestStream(uploadCallback, reqState);
-            }
-            catch (Exception /*ex*/)
-            {
-
-                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, new FileTransferError(ConnectionError)),callbackId);
-
-
-            }
-        }
-
-        // example : "{\"Authorization\":\"Basic Y29yZG92YV91c2VyOmNvcmRvdmFfcGFzc3dvcmQ=\"}"
-        protected Dictionary<string,string> parseHeaders(string jsonHeaders)
-        {
-            try
-            {
-                Dictionary<string, string> result = new Dictionary<string, string>();
-
-                string temp = jsonHeaders.StartsWith("{") ? jsonHeaders.Substring(1) : jsonHeaders;
-                temp = temp.EndsWith("}") ? temp.Substring(0, temp.Length - 1) : temp;
-
-                string[] strHeaders = temp.Split(',');
-                for (int n = 0; n < strHeaders.Length; n++)
-                {
-                    // we need to use indexOf in order to WP7 compatible
-                    int splitIndex = strHeaders[n].IndexOf(':');
-                    if (splitIndex > 0)
-                    {
-                        string[] split = new string[2];
-                        split[0] = strHeaders[n].Substring(0, splitIndex);
-                        split[1] = strHeaders[n].Substring(splitIndex + 1);
-
-                        split[0] = JSON.JsonHelper.Deserialize<string>(split[0]);
-                        split[1] = JSON.JsonHelper.Deserialize<string>(split[1]);
-                        result[split[0]] = split[1];
-                    }
-                }
-                return result;
-            }
-            catch (Exception)
-            {
-                Debug.WriteLine("Failed to parseHeaders from string :: " + jsonHeaders);
-            }
-            return null;
-        }
-
-
-
-        public void download(string options)
-        {
-            TransferOptions downloadOptions = null;
-            HttpWebRequest webRequest = null;
-            string callbackId;
-
-            try
-            {
-                // source, target, trustAllHosts, this._id, headers
-                string[] optionStrings = JSON.JsonHelper.Deserialize<string[]>(options);
-
-                downloadOptions = new TransferOptions();
-                downloadOptions.Url = optionStrings[0];
-                downloadOptions.FilePath = optionStrings[1];
-
-                bool trustAll = false;
-                bool.TryParse(optionStrings[2],out trustAll);
-                downloadOptions.TrustAllHosts = trustAll;
-
-                downloadOptions.Id = optionStrings[3];
-                downloadOptions.Headers = optionStrings[4];
-                downloadOptions.CallbackId = callbackId = optionStrings[5];
-
-            }
-            catch (Exception)
-            {
-                DispatchCommandResult(new PluginResult(PluginResult.Status.JSON_EXCEPTION));
-                return;
-            }
-
-            try
-            {
-                // is the URL a local app file?
-                if (downloadOptions.Url.StartsWith("x-wmapp0") || downloadOptions.Url.StartsWith("file:"))
-                {
-                    using (IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication())
-                    {
-                        // just copy from one area of iso-store to another ...
-                        if (isoFile.FileExists(downloadOptions.Url))
-                        {
-                            isoFile.CopyFile(downloadOptions.Url, downloadOptions.FilePath);
-                        }
-                        else
-                        {
-                            // need to unpack resource from the dll
-                            string cleanUrl = downloadOptions.Url.Replace("x-wmapp0:", "").Replace("file:", "");
-                            Uri uri = new Uri(cleanUrl, UriKind.Relative);
-                            var resource = Application.GetResourceStream(uri);
-
-                            if (resource != null)
-                            {
-                                // create the file destination
-                                if (!isoFile.FileExists(downloadOptions.FilePath))
-                                {
-                                    var destFile = isoFile.CreateFile(downloadOptions.FilePath);
-                                    destFile.Close();
-                                }
-
-                                using (FileStream fileStream = new IsolatedStorageFileStream(downloadOptions.FilePath, FileMode.Open, FileAccess.Write, isoFile))
-                                {
-                                    long totalBytes = resource.Stream.Length;
-                                    int bytesRead = 0;
-                                    using (BinaryReader reader = new BinaryReader(resource.Stream))
-                                    {
-                                        using (BinaryWriter writer = new BinaryWriter(fileStream))
-                                        {
-                                            int BUFFER_SIZE = 1024;
-                                            byte[] buffer;
-
-                                            while (true)
-                                            {
-                                                buffer = reader.ReadBytes(BUFFER_SIZE);
-                                                // fire a progress event ?
-                                                bytesRead += buffer.Length;
-                                                if (buffer.Length > 0)
-                                                {
-                                                    writer.Write(buffer);
-                                                    DispatchFileTransferProgress(bytesRead, totalBytes, callbackId);
-                                                }
-                                                else
-                                                {
-                                                    writer.Close();
-                                                    reader.Close();
-                                                    fileStream.Close();
-                                                    break;
-                                                }
-                                            }
-                                        }
-
-                                    }
-                                }
-                            }
-                        }
-
-                    }
-
-                    File.FileEntry entry = File.FileEntry.GetEntry(downloadOptions.FilePath);
-                    if (entry != null)
-                    {
-                        DispatchCommandResult(new PluginResult(PluginResult.Status.OK, entry), callbackId);
-                    }
-                    else
-                    {
-                        DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, File.NOT_FOUND_ERR), callbackId);
-                    }
-
-                    return;
-
-                }
-                else
-                {
-                    // otherwise it is web-bound, we will actually download it
-                    //Debug.WriteLine("Creating WebRequest for url : " + downloadOptions.Url);
-                    webRequest = (HttpWebRequest)WebRequest.Create(downloadOptions.Url);
-                }
-            }
-            catch (Exception /*ex*/)
-            {
-                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR,
-                                      new FileTransferError(InvalidUrlError, downloadOptions.Url, null, 0)));
-                return;
-            }
-
-            if (downloadOptions != null && webRequest != null)
-            {
-                DownloadRequestState state = new DownloadRequestState();
-                state.options = downloadOptions;
-                state.request = webRequest;
-                InProcDownloads[downloadOptions.Id] = state;
-
-                if (!string.IsNullOrEmpty(downloadOptions.Headers))
-                {
-                    Dictionary<string, string> headers = parseHeaders(downloadOptions.Headers);
-                    foreach (string key in headers.Keys)
-                    {
-                        webRequest.Headers[key] = headers[key];
-                    }
-                }
-
-                try
-                {
-                    webRequest.BeginGetResponse(new AsyncCallback(downloadCallback), state);
-                }
-                catch (WebException)
-                {
-                    // eat it
-                }
-                // dispatch an event for progress ( 0 )
-                lock (state)
-                {
-                    if (!state.isCancelled)
-                    {
-                        var plugRes = new PluginResult(PluginResult.Status.OK, new FileTransferProgress());
-                        plugRes.KeepCallback = true;
-                        plugRes.CallbackId = callbackId;
-                        DispatchCommandResult(plugRes, callbackId);
-                    }
-                }
-            }
-
-        }
-
-        public void abort(string options)
-        {
-            Debug.WriteLine("Abort :: " + options);
-            string[] optionStrings = JSON.JsonHelper.Deserialize<string[]>(options);
-            string id = optionStrings[0];
-            string callbackId = optionStrings[1];
-
-            if (InProcDownloads.ContainsKey(id))
-            {
-                 DownloadRequestState state = InProcDownloads[id];
-                 if (!state.isCancelled)
-                 { // prevent multiple callbacks for the same abort
-                     state.isCancelled = true;
-                     if (!state.request.HaveResponse)
-                     {
-                         state.request.Abort();
-                         InProcDownloads.Remove(id);
-                         //callbackId = state.options.CallbackId;
-                         //state = null;
-                         DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR,
-                                                                new FileTransferError(FileTransfer.AbortError)),
-                                                                state.options.CallbackId);
-                     }
-                 }
-
-            }
-            else
-            {
-                DispatchCommandResult(new PluginResult(PluginResult.Status.IO_EXCEPTION), callbackId); // TODO: is it an IO exception?
-            }
-        }
-
-        private void DispatchFileTransferProgress(long bytesLoaded, long bytesTotal, string callbackId, bool keepCallback = true)
-        {
-            Debug.WriteLine("DispatchFileTransferProgress : " + callbackId);
-            // send a progress change event
-            FileTransferProgress progEvent = new FileTransferProgress(bytesTotal);
-            progEvent.BytesLoaded = bytesLoaded;
-            PluginResult plugRes = new PluginResult(PluginResult.Status.OK, progEvent);
-            plugRes.KeepCallback = keepCallback;
-            plugRes.CallbackId = callbackId;
-            DispatchCommandResult(plugRes, callbackId);
-        }
-
-        /// <summary>
-        ///
-        /// </summary>
-        /// <param name="asynchronousResult"></param>
-        private void downloadCallback(IAsyncResult asynchronousResult)
-        {
-
-
-            DownloadRequestState reqState = (DownloadRequestState)asynchronousResult.AsyncState;
-            HttpWebRequest request = reqState.request;
-
-            string callbackId = reqState.options.CallbackId;
-            try
-            {
-                HttpWebResponse response = (HttpWebResponse)request.EndGetResponse(asynchronousResult);
-
-                // send a progress change event
-                DispatchFileTransferProgress(0, response.ContentLength, callbackId);
-
-                using (IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication())
-                {
-                    // create the file if not exists
-                    if (!isoFile.FileExists(reqState.options.FilePath))
-                    {
-                        var file = isoFile.CreateFile(reqState.options.FilePath);
-                        file.Close();
-                    }
-
-                    using (FileStream fileStream = new IsolatedStorageFileStream(reqState.options.FilePath, FileMode.Open, FileAccess.Write, isoFile))
-                    {
-                        long totalBytes = response.ContentLength;
-                        int bytesRead = 0;
-                        using (BinaryReader reader = new BinaryReader(response.GetResponseStream()))
-                        {
-                            using (BinaryWriter writer = new BinaryWriter(fileStream))
-                            {
-                                int BUFFER_SIZE = 1024;
-                                byte[] buffer;
-
-                                while (true)
-                                {
-                                    buffer = reader.ReadBytes(BUFFER_SIZE);
-                                    // fire a progress event ?
-                                    bytesRead += buffer.Length;
-                                    if (buffer.Length > 0 && !reqState.isCancelled)
-                                    {
-                                        writer.Write(buffer);
-                                        DispatchFileTransferProgress(bytesRead, totalBytes, callbackId);
-                                    }
-                                    else
-                                    {
-                                        writer.Close();
-                                        reader.Close();
-                                        fileStream.Close();
-                                        break;
-                                    }
-                                    System.Threading.Thread.Sleep(1);
-                                }
-                            }
-
-                        }
-                    }
-                    if (reqState.isCancelled)
-                    {
-                        isoFile.DeleteFile(reqState.options.FilePath);
-                    }
-
-                }
-
-                if (reqState.isCancelled)
-                {
-                    DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, new FileTransferError(AbortError)),
-                  callbackId);
-
-                }
-                else
-                {
-                    File.FileEntry entry = new File.FileEntry(reqState.options.FilePath);
-                    DispatchCommandResult(new PluginResult(PluginResult.Status.OK, entry), callbackId);
-                }
-            }
-            catch (IsolatedStorageException)
-            {
-                // Trying to write the file somewhere within the IsoStorage.
-                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, new FileTransferError(FileNotFoundError)),
-                                      callbackId);
-            }
-            catch (SecurityException)
-            {
-                // Trying to write the file somewhere not allowed.
-                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, new FileTransferError(FileNotFoundError)),
-                                      callbackId);
-            }
-            catch (WebException webex)
-            {
-                // TODO: probably need better work here to properly respond with all http status codes back to JS
-                // Right now am jumping through hoops just to detect 404.
-                HttpWebResponse response = (HttpWebResponse)webex.Response;
-                if ((webex.Status == WebExceptionStatus.ProtocolError && response.StatusCode == HttpStatusCode.NotFound)
-                    || webex.Status == WebExceptionStatus.UnknownError)
-                {
-
-                    // Weird MSFT detection of 404... seriously... just give us the f(*&#$@ status code as a number ffs!!!
-                    // "Numbers for HTTP status codes? Nah.... let's create our own set of enums/structs to abstract that stuff away."
-                    // FACEPALM
-                    // Or just cast it to an int, whiner ... -jm
-                    int statusCode = (int)response.StatusCode;
-                    string body = "";
-
-                    using (Stream streamResponse = response.GetResponseStream())
-                    {
-                        using (StreamReader streamReader = new StreamReader(streamResponse))
-                        {
-                            body = streamReader.ReadToEnd();
-                        }
-                    }
-                    FileTransferError ftError = new FileTransferError(ConnectionError, null, null, statusCode, body);
-                    DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, ftError),
-                                          callbackId);
-                }
-                else
-                {
-                    lock (reqState)
-                    {
-                        if (!reqState.isCancelled)
-                        {
-                            DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR,
-                                                                   new FileTransferError(ConnectionError)),
-                                                  callbackId);
-                        }
-                        else
-                        {
-                            Debug.WriteLine("It happened");
-                        }
-                    }
-                }
-            }
-            catch (Exception)
-            {
-                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR,
-                                                        new FileTransferError(FileNotFoundError)),
-                                      callbackId);
-            }
-
-            //System.Threading.Thread.Sleep(1000);
-            if (InProcDownloads.ContainsKey(reqState.options.Id))
-            {
-                InProcDownloads.Remove(reqState.options.Id);
-            }
-
-        }
-
-
-
-        /// <summary>
-        /// Read file from Isolated Storage and sends it to server
-        /// </summary>
-        /// <param name="asynchronousResult"></param>
-        private void uploadCallback(IAsyncResult asynchronousResult)
-        {
-            DownloadRequestState reqState = (DownloadRequestState)asynchronousResult.AsyncState;
-            HttpWebRequest webRequest = reqState.request;
-            string callbackId = reqState.options.CallbackId;
-
-            try
-            {
-                using (Stream requestStream = (webRequest.EndGetRequestStream(asynchronousResult)))
-                {
-                    string lineStart = "--";
-                    string lineEnd = Environment.NewLine;
-                    byte[] boundaryBytes = System.Text.Encoding.UTF8.GetBytes(lineStart + Boundary + lineEnd);
-                    string formdataTemplate = "Content-Disposition: form-data; name=\"{0}\"" + lineEnd + lineEnd + "{1}" + lineEnd;
-
-
-
-                    if (!string.IsNullOrEmpty(reqState.options.Params))
-                    {
-                        Dictionary<string, string> paramMap = parseHeaders(reqState.options.Params);
-                        foreach (string key in paramMap.Keys)
-                        {
-                            requestStream.Write(boundaryBytes, 0, boundaryBytes.Length);
-                            string formItem = string.Format(formdataTemplate, key, paramMap[key]);
-                            byte[] formItemBytes = System.Text.Encoding.UTF8.GetBytes(formItem);
-                            requestStream.Write(formItemBytes, 0, formItemBytes.Length);
-                        }
-                        requestStream.Write(boundaryBytes, 0, boundaryBytes.Length);
-                    }
-                    using (IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication())
-                    {
-                        if (!isoFile.FileExists(reqState.options.FilePath))
-                        {
-                            DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, new FileTransferError(FileNotFoundError, reqState.options.Server, reqState.options.FilePath, 0)));
-                            return;
-                        }
-
-                        byte[] endRequest = System.Text.Encoding.UTF8.GetBytes(lineEnd + lineStart + Boundary + lineStart + lineEnd);
-                        long totalBytesToSend = 0;
-
-                        using (FileStream fileStream = new IsolatedStorageFileStream(reqState.options.FilePath, FileMode.Open, isoFile))
-                        {
-
-                            string headerTemplate = "Content-Disposition: form-data; name=\"{0}\"; filename=\"{1}\"" + lineEnd + "Content-Type: {2}" + lineEnd + lineEnd;
-                            string header = string.Format(headerTemplate, reqState.options.FileKey, reqState.options.FileName, reqState.options.MimeType);
-                            byte[] headerBytes = System.Text.Encoding.UTF8.GetBytes(header);
-
-                            byte[] buffer = new byte[4096];
-                            int bytesRead = 0;
-                            totalBytesToSend = fileStream.Length;
-
-                            requestStream.Write(boundaryBytes, 0, boundaryBytes.Length);
-
-                            requestStream.Write(headerBytes, 0, headerBytes.Length);
-
-                            while ((bytesRead = fileStream.Read(buffer, 0, buffer.Length)) != 0)
-                            {
-                                if (!reqState.isCancelled)
-                                {
-                                    requestStream.Write(buffer, 0, bytesRead);
-                                    bytesSent += bytesRead;
-                                    DispatchFileTransferProgress(bytesSent, totalBytesToSend, callbackId);
-                                    System.Threading.Thread.Sleep(1);
-                                }
-                                else
-                                {
-                                    throw new Exception("UploadCancelledException");
-                                }
-                            }
-                        }
-
-                        requestStream.Write(endRequest, 0, endRequest.Length);
-                    }
-                }
-                // webRequest
-
-                webRequest.BeginGetResponse(ReadCallback, reqState);
-            }
-            catch (Exception /*ex*/)
-            {
-                if (!reqState.isCancelled)
-                {
-                    DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, new FileTransferError(ConnectionError)), callbackId);
-                }
-            }
-        }
-
-        /// <summary>
-        /// Reads response into FileUploadResult
-        /// </summary>
-        /// <param name="asynchronousResult"></param>
-        private void ReadCallback(IAsyncResult asynchronousResult)
-        {
-            DownloadRequestState reqState = (DownloadRequestState)asynchronousResult.AsyncState;
-            try
-            {
-                HttpWebRequest webRequest = reqState.request;
-                string callbackId = reqState.options.CallbackId;
-
-                if (InProcDownloads.ContainsKey(reqState.options.Id))
-                {
-                    InProcDownloads.Remove(reqState.options.Id);
-                }
-
-                using (HttpWebResponse response = (HttpWebResponse)webRequest.EndGetResponse(asynchronousResult))
-                {
-                    using (Stream streamResponse = response.GetResponseStream())
-                    {
-                        using (StreamReader streamReader = new StreamReader(streamResponse))
-                        {
-                            string responseString = streamReader.ReadToEnd();
-                            Deployment.Current.Dispatcher.BeginInvoke(() =>
-                            {
-                                DispatchCommandResult(new PluginResult(PluginResult.Status.OK, new FileUploadResult(bytesSent, (long)response.StatusCode, responseString)));
-                            });
-                        }
-                    }
-                }
-            }
-            catch (WebException webex)
-            {
-                // TODO: probably need better work here to properly respond with all http status codes back to JS
-                // Right now am jumping through hoops just to detect 404.
-                if ((webex.Status == WebExceptionStatus.ProtocolError && ((HttpWebResponse)webex.Response).StatusCode == HttpStatusCode.NotFound)
-                    || webex.Status == WebExceptionStatus.UnknownError)
-                {
-                    int statusCode = (int)((HttpWebResponse)webex.Response).StatusCode;
-                    FileTransferError ftError = new FileTransferError(ConnectionError, null, null, statusCode);
-                    DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, ftError), reqState.options.CallbackId);
-                }
-                else
-                {
-                    DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR,
-                                                           new FileTransferError(ConnectionError)),
-                                          reqState.options.CallbackId);
-                }
-            }
-            catch (Exception /*ex*/)
-            {
-                FileTransferError transferError = new FileTransferError(ConnectionError, reqState.options.Server, reqState.options.FilePath, 403);
-                DispatchCommandResult(new PluginResult(PluginResult.Status.ERROR, transferError), reqState.options.CallbackId);
-
-            }
-        }
-    }
-}
diff --git a/www/FileTransfer.js b/www/FileTransfer.js
deleted file mode 100644
index d842c5a..0000000
--- a/www/FileTransfer.js
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var argscheck = require('cordova/argscheck'),
-    exec = require('cordova/exec'),
-    FileTransferError = require('./FileTransferError'),
-    ProgressEvent = require('org.apache.cordova.file.ProgressEvent');
-
-function newProgressEvent(result) {
-    var pe = new ProgressEvent();
-    pe.lengthComputable = result.lengthComputable;
-    pe.loaded = result.loaded;
-    pe.total = result.total;
-    return pe;
-}
-
-function getBasicAuthHeader(urlString) {
-    var header =  null;
-
-    if (window.btoa) {
-        // parse the url using the Location object
-        var url = document.createElement('a');
-        url.href = urlString;
-
-        var credentials = null;
-        var protocol = url.protocol + "//";
-        var origin = protocol + url.host.replace(":" + url.port, ""); // Windows 8 (IE10) append :80 or :443 to url.host
-
-        // check whether there are the username:password credentials in the url
-        if (url.href.indexOf(origin) !== 0) { // credentials found
-            var atIndex = url.href.indexOf("@");
-            credentials = url.href.substring(protocol.length, atIndex);
-        }
-
-        if (credentials) {
-            var authHeader = "Authorization";
-            var authHeaderValue = "Basic " + window.btoa(credentials);
-
-            header = {
-                name : authHeader,
-                value : authHeaderValue
-            };
-        }
-    }
-
-    return header;
-}
-
-var idCounter = 0;
-
-/**
- * FileTransfer uploads a file to a remote server.
- * @constructor
- */
-var FileTransfer = function() {
-    this._id = ++idCounter;
-    this.onprogress = null; // optional callback
-};
-
-/**
-* Given an absolute file path, uploads a file on the device to a remote server
-* using a multipart HTTP request.
-* @param filePath {String}           Full path of the file on the device
-* @param server {String}             URL of the server to receive the file
-* @param successCallback (Function}  Callback to be invoked when upload has completed
-* @param errorCallback {Function}    Callback to be invoked upon error
-* @param options {FileUploadOptions} Optional parameters such as file name and mimetype
-* @param trustAllHosts {Boolean} Optional trust all hosts (e.g. for self-signed certs), defaults to false
-*/
-FileTransfer.prototype.upload = function(filePath, server, successCallback, errorCallback, options, trustAllHosts) {
-    argscheck.checkArgs('ssFFO*', 'FileTransfer.upload', arguments);
-    // check for options
-    var fileKey = null;
-    var fileName = null;
-    var mimeType = null;
-    var params = null;
-    var chunkedMode = true;
-    var headers = null;
-    var httpMethod = null;
-    var basicAuthHeader = getBasicAuthHeader(server);
-    if (basicAuthHeader) {
-        options = options || {};
-        options.headers = options.headers || {};
-        options.headers[basicAuthHeader.name] = basicAuthHeader.value;
-    }
-
-    if (options) {
-        fileKey = options.fileKey;
-        fileName = options.fileName;
-        mimeType = options.mimeType;
-        headers = options.headers;
-        httpMethod = options.httpMethod || "POST";
-        if (httpMethod.toUpperCase() == "PUT"){
-            httpMethod = "PUT";
-        } else {
-            httpMethod = "POST";
-        }
-        if (options.chunkedMode !== null || typeof options.chunkedMode != "undefined") {
-            chunkedMode = options.chunkedMode;
-        }
-        if (options.params) {
-            params = options.params;
-        }
-        else {
-            params = {};
-        }
-    }
-
-    var fail = errorCallback && function(e) {
-        var error = new FileTransferError(e.code, e.source, e.target, e.http_status, e.body);
-        errorCallback(error);
-    };
-
-    var self = this;
-    var win = function(result) {
-        if (typeof result.lengthComputable != "undefined") {
-            if (self.onprogress) {
-                self.onprogress(newProgressEvent(result));
-            }
-        } else {
-            successCallback && successCallback(result);
-        }
-    };
-    exec(win, fail, 'FileTransfer', 'upload', [filePath, server, fileKey, fileName, mimeType, params, trustAllHosts, chunkedMode, headers, this._id, httpMethod]);
-};
-
-/**
- * Downloads a file form a given URL and saves it to the specified directory.
- * @param source {String}          URL of the server to receive the file
- * @param target {String}         Full path of the file on the device
- * @param successCallback (Function}  Callback to be invoked when upload has completed
- * @param errorCallback {Function}    Callback to be invoked upon error
- * @param trustAllHosts {Boolean} Optional trust all hosts (e.g. for self-signed certs), defaults to false
- * @param options {FileDownloadOptions} Optional parameters such as headers
- */
-FileTransfer.prototype.download = function(source, target, successCallback, errorCallback, trustAllHosts, options) {
-    argscheck.checkArgs('ssFF*', 'FileTransfer.download', arguments);
-    var self = this;
-
-    var basicAuthHeader = getBasicAuthHeader(source);
-    if (basicAuthHeader) {
-        options = options || {};
-        options.headers = options.headers || {};
-        options.headers[basicAuthHeader.name] = basicAuthHeader.value;
-    }
-
-    var headers = null;
-    if (options) {
-        headers = options.headers || null;
-    }
-
-    var win = function(result) {
-        if (typeof result.lengthComputable != "undefined") {
-            if (self.onprogress) {
-                return self.onprogress(newProgressEvent(result));
-            }
-        } else if (successCallback) {
-            var entry = null;
-            if (result.isDirectory) {
-                entry = new (require('org.apache.cordova.file.DirectoryEntry'))();
-            }
-            else if (result.isFile) {
-                entry = new (require('org.apache.cordova.file.FileEntry'))();
-            }
-            entry.isDirectory = result.isDirectory;
-            entry.isFile = result.isFile;
-            entry.name = result.name;
-            entry.fullPath = result.fullPath;
-            entry.filesystem = new FileSystem(result.filesystemName || (result.filesystem == window.PERSISTENT ? 'persistent' : 'temporary'));
-            entry.nativeURL = result.nativeURL;
-            successCallback(entry);
-        }
-    };
-
-    var fail = errorCallback && function(e) {
-        var error = new FileTransferError(e.code, e.source, e.target, e.http_status, e.body);
-        errorCallback(error);
-    };
-
-    exec(win, fail, 'FileTransfer', 'download', [source, target, trustAllHosts, this._id, headers]);
-};
-
-/**
- * Aborts the ongoing file transfer on this object. The original error
- * callback for the file transfer will be called if necessary.
- */
-FileTransfer.prototype.abort = function() {
-    exec(null, null, 'FileTransfer', 'abort', [this._id]);
-};
-
-module.exports = FileTransfer;
diff --git a/www/FileTransferError.js b/www/FileTransferError.js
deleted file mode 100644
index 1394f59..0000000
--- a/www/FileTransferError.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * FileTransferError
- * @constructor
- */
-var FileTransferError = function(code, source, target, status, body) {
-    this.code = code || null;
-    this.source = source || null;
-    this.target = target || null;
-    this.http_status = status || null;
-    this.body = body || null;
-};
-
-FileTransferError.FILE_NOT_FOUND_ERR = 1;
-FileTransferError.INVALID_URL_ERR = 2;
-FileTransferError.CONNECTION_ERR = 3;
-FileTransferError.ABORT_ERR = 4;
-
-module.exports = FileTransferError;
diff --git a/www/blackberry10/FileTransfer.js b/www/blackberry10/FileTransfer.js
deleted file mode 100644
index f74914a..0000000
--- a/www/blackberry10/FileTransfer.js
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var argscheck = require('cordova/argscheck'),
-    FileTransferError = require('./FileTransferError');
-    xhrImpl = require('./BB10XHRImplementation');
-
-
-function getBasicAuthHeader(urlString) {
-    var header =  null;
-
-    if (window.btoa) {
-        // parse the url using the Location object
-        var url = document.createElement('a');
-        url.href = urlString;
-
-        var credentials = null;
-        var protocol = url.protocol + "//";
-        var origin = protocol + url.host;
-
-        // check whether there are the username:password credentials in the url
-        if (url.href.indexOf(origin) !== 0) { // credentials found
-            var atIndex = url.href.indexOf("@");
-            credentials = url.href.substring(protocol.length, atIndex);
-        }
-
-        if (credentials) {
-            var authHeader = "Authorization";
-            var authHeaderValue = "Basic " + window.btoa(credentials);
-
-            header = {
-                name : authHeader,
-                value : authHeaderValue
-            };
-        }
-    }
-
-    return header;
-}
-
-var idCounter = 0;
-
-/**
- * FileTransfer uploads a file to a remote server.
- * @constructor
- */
-var FileTransfer = function() {
-    this._id = ++idCounter;
-    this.onprogress = null; // optional callback
-};
-
-/**
-* Given an absolute file path, uploads a file on the device to a remote server
-* using a multipart HTTP request.
-* @param filePath {String}           Full path of the file on the device
-* @param server {String}             URL of the server to receive the file
-* @param successCallback (Function}  Callback to be invoked when upload has completed
-* @param errorCallback {Function}    Callback to be invoked upon error
-* @param options {FileUploadOptions} Optional parameters such as file name and mimetype
-* @param trustAllHosts {Boolean} Optional trust all hosts (e.g. for self-signed certs), defaults to false
-*/
-FileTransfer.prototype.upload = function(filePath, server, successCallback, errorCallback, options, trustAllHosts) {
-    argscheck.checkArgs('ssFFO*', 'FileTransfer.upload', arguments);
-    // check for options
-    var fileKey = null;
-    var fileName = null;
-    var mimeType = null;
-    var params = null;
-    var chunkedMode = true;
-    var headers = null;
-    var httpMethod = null;
-    var basicAuthHeader = getBasicAuthHeader(server);
-    if (basicAuthHeader) {
-        options = options || {};
-        options.headers = options.headers || {};
-        options.headers[basicAuthHeader.name] = basicAuthHeader.value;
-    }
-
-    if (options) {
-        fileKey = options.fileKey;
-        fileName = options.fileName;
-        mimeType = options.mimeType;
-        headers = options.headers;
-        httpMethod = options.httpMethod || "POST";
-        if (httpMethod.toUpperCase() == "PUT"){
-            httpMethod = "PUT";
-        } else {
-            httpMethod = "POST";
-        }
-        if (options.chunkedMode !== null || typeof options.chunkedMode != "undefined") {
-            chunkedMode = options.chunkedMode;
-        }
-        if (options.params) {
-            params = options.params;
-        }
-        else {
-            params = {};
-        }
-    }
-
-    var fail = errorCallback && function(e) {
-        var error = new FileTransferError(e.code, e.source, e.target, e.http_status, e.body);
-        errorCallback(error);
-    };
-
-    var self = this;
-    var win = function(result) {
-        if (typeof result.lengthComputable != "undefined") {
-            if (self.onprogress) {
-                self.onprogress(result);
-            }
-        } else {
-            successCallback && successCallback(result);
-        }
-    };
-    xhrImpl.upload(win, fail, [filePath, server, fileKey, fileName, mimeType, params, trustAllHosts, chunkedMode, headers, this._id, httpMethod]);
-};
-
-/**
- * Downloads a file form a given URL and saves it to the specified directory.
- * @param source {String}          URL of the server to receive the file
- * @param target {String}         Full path of the file on the device
- * @param successCallback (Function}  Callback to be invoked when upload has completed
- * @param errorCallback {Function}    Callback to be invoked upon error
- * @param trustAllHosts {Boolean} Optional trust all hosts (e.g. for self-signed certs), defaults to false
- * @param options {FileDownloadOptions} Optional parameters such as headers
- */
-FileTransfer.prototype.download = function(source, target, successCallback, errorCallback, trustAllHosts, options) {
-    argscheck.checkArgs('ssFF*', 'FileTransfer.download', arguments);
-    var self = this;
-
-    var basicAuthHeader = getBasicAuthHeader(source);
-    if (basicAuthHeader) {
-        options = options || {};
-        options.headers = options.headers || {};
-        options.headers[basicAuthHeader.name] = basicAuthHeader.value;
-    }
-
-    var headers = null;
-    if (options) {
-        headers = options.headers || null;
-    }
-
-    var win = function(result) {
-        if (typeof result.lengthComputable != "undefined") {
-            if (self.onprogress) {
-                return self.onprogress(result);
-            }
-        } else if (successCallback) {
-            successCallback(result);
-        }
-    };
-
-    var fail = errorCallback && function(e) {
-        var error = new FileTransferError(e.code, e.source, e.target, e.http_status, e.body);
-        errorCallback(error);
-    };
-
-    xhrImpl.download(win, fail, [source, target, trustAllHosts, this._id, headers]);
-};
-
-/**
- * Aborts the ongoing file transfer on this object. The original error
- * callback for the file transfer will be called if necessary.
- */
-FileTransfer.prototype.abort = function() {
-    xhrImpl.abort(null, null, [this._id]);
-};
-
-module.exports = FileTransfer;
diff --git a/www/blackberry10/XHRImplementation.js b/www/blackberry10/XHRImplementation.js
deleted file mode 100644
index 974e06f..0000000
--- a/www/blackberry10/XHRImplementation.js
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/*global Blob:false */
-var cordova = require('cordova'),
-    nativeResolveLocalFileSystemURI = function(uri, success, fail) {
-        if (uri.substring(0,11) !== "filesystem:") {
-            uri = "filesystem:" + uri;
-        }
-        resolveLocalFileSystemURI(uri, success, fail);
-    },
-    xhr;
-
-function getParentPath(filePath) {
-    var pos = filePath.lastIndexOf('/');
-    return filePath.substring(0, pos + 1);
-}
-
-function getFileName(filePath) {
-    var pos = filePath.lastIndexOf('/');
-    return filePath.substring(pos + 1);
-}
-
-function checkURL(url) {
-    return url.indexOf(' ') === -1 ?  true : false;
-}
-
-module.exports = {
-    abort: function () {
-        return { "status" : cordova.callbackStatus.NO_RESULT, "message" : "async"};
-    },
-
-    upload: function(win, fail, args) {
-        var filePath = args[0],
-            server = args[1],
-            fileKey = args[2],
-            fileName = args[3],
-            mimeType = args[4],
-            params = args[5],
-            /*trustAllHosts = args[6],*/
-            chunkedMode = args[7],
-            headers = args[8];
-
-        if (!checkURL(server)) {
-            fail(new FileTransferError(FileTransferError.INVALID_URL_ERR, server, filePath));
-        }
-
-        nativeResolveLocalFileSystemURI(filePath, function(entry) {
-            entry.file(function(file) {
-                function uploadFile(blobFile) {
-                    var fd = new FormData();
-
-                    fd.append(fileKey, blobFile, fileName);
-                    for (var prop in params) {
-                        if(params.hasOwnProperty(prop)) {
-                            fd.append(prop, params[prop]);
-                        }
-                    }
-
-                    xhr = new XMLHttpRequest();
-                    xhr.open("POST", server);
-                    xhr.onload = function(evt) {
-                        if (xhr.status === 200) {
-                            var result = new FileUploadResult();
-                            result.bytesSent = file.size;
-                            result.responseCode = xhr.status;
-                            result.response = xhr.response;
-                            win(result);
-                        } else if (xhr.status === 404) {
-                            fail(new FileTransferError(FileTransferError.INVALID_URL_ERR, server, filePath, xhr.status, xhr.response));
-                        } else {
-                            fail(new FileTransferError(FileTransferError.CONNECTION_ERR, server, filePath, xhr.status, xhr.response));
-                        }
-                    };
-                    xhr.ontimeout = function(evt) {
-                        fail(new FileTransferError(FileTransferError.CONNECTION_ERR, server, filePath, xhr.status, xhr.response));
-                    };
-                    xhr.onerror = function () {
-                        fail(new FileTransferError(FileTransferError.CONNECTION_ERR, server, filePath, this.status, xhr.response));
-                    };
-                    xhr.onprogress = function (evt) {
-                        win(evt);
-                    };
-
-                    for (var header in headers) {
-                        if (headers.hasOwnProperty(header)) {
-                            xhr.setRequestHeader(header, headers[header]);
-                        }
-                    }
-
-                    xhr.send(fd);
-                }
-
-                var bytesPerChunk;
-                if (chunkedMode === true) {
-                    bytesPerChunk = 1024 * 1024; // 1MB chunk sizes.
-                } else {
-                    bytesPerChunk = file.size;
-                }
-                var start = 0;
-                var end = bytesPerChunk;
-                while (start < file.size) {
-                    var chunk = file.nativeFile.slice(start, end, mimeType);
-                    uploadFile(chunk);
-                    start = end;
-                    end = start + bytesPerChunk;
-                }
-            }, function(error) {
-                fail(new FileTransferError(FileTransferError.FILE_NOT_FOUND_ERR, server, filePath));
-            });
-        }, function(error) {
-            fail(new FileTransferError(FileTransferError.FILE_NOT_FOUND_ERR, server, filePath));
-        });
-
-        return { "status" : cordova.callbackStatus.NO_RESULT, "message" : "async"};
-    },
-
-    download: function (win, fail, args) {
-        var source = args[0],
-            target = args[1],
-            headers = args[4],
-            fileWriter;
-
-        if (!checkURL(source)) {
-            fail(new FileTransferError(FileTransferError.INVALID_URL_ERR, source, target));
-        }
-
-        xhr = new XMLHttpRequest();
-
-        function writeFile(entry) {
-            entry.nativeEntry.createWriter(function (writer) {
-                fileWriter = writer;
-                fileWriter.onwriteend = function (evt) {
-                    if (!evt.target.error) {
-                        win(entry);
-                    } else {
-                        fail(evt.target.error);
-                    }
-                };
-                fileWriter.onerror = function (evt) {
-                    fail(evt.target.error);
-                };
-                fileWriter.write(new Blob([xhr.response]));
-            }, function (error) {
-                fail(error);
-            });
-        }
-
-        xhr.onerror = function (e) {
-            fail(new FileTransferError(FileTransferError.CONNECTION_ERR, source, target, xhr.status, xhr.response));
-        };
-
-        xhr.onload = function () {
-            if (xhr.readyState === xhr.DONE) {
-                if (xhr.status === 200 && xhr.response) {
-                    nativeResolveLocalFileSystemURI(getParentPath(target), function (dir) {
-                        dir.getFile(getFileName(target), {create: true}, writeFile, function (error) {
-                            fail(new FileTransferError(FileTransferError.FILE_NOT_FOUND_ERR, source, target, xhr.status, xhr.response));
-                        });
-                    }, function (error) {
-                        fail(new FileTransferError(FileTransferError.FILE_NOT_FOUND_ERR, source, target, xhr.status, xhr.response));
-                    });
-                } else if (xhr.status === 404) {
-                    fail(new FileTransferError(FileTransferError.INVALID_URL_ERR, source, target, xhr.status, xhr.response));
-                } else {
-                    fail(new FileTransferError(FileTransferError.CONNECTION_ERR, source, target, xhr.status, xhr.response));
-                }
-            }
-        };
-        xhr.onprogress = function (evt) {
-            win(evt);
-        };
-        xhr.open("GET", source, true);
-        for (var header in headers) {
-            if (headers.hasOwnProperty(header)) {
-                xhr.setRequestHeader(header, headers[header]);
-            }
-        }
-        xhr.responseType = "blob";
-        xhr.send();
-        return { "status" : cordova.callbackStatus.NO_RESULT, "message" : "async"};
-    }
-};
diff --git a/www/windows8/FileTransferProxy.js b/www/windows8/FileTransferProxy.js
deleted file mode 100644
index fae6533..0000000
--- a/www/windows8/FileTransferProxy.js
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-
-var FileTransferError = require('./FileTransferError'),
-    FileUploadResult = require('org.apache.cordova.file.FileUploadResult'),
-    FileEntry = require('org.apache.cordova.file.FileEntry');
-
-module.exports = {
-
-    upload:function(successCallback, error, options) {
-        var filePath = options[0];
-        var server = options[1];
-        var headers = options[8] || {};
-
-        if (filePath === null || typeof filePath === 'undefined') {
-            error && error(FileTransferError.FILE_NOT_FOUND_ERR);
-            return;
-        }
-
-        if (String(filePath).substr(0, 8) == "file:///") {
-            filePath = Windows.Storage.ApplicationData.current.localFolder.path + String(filePath).substr(8).split("/").join("\\");
-        }
-
-        Windows.Storage.StorageFile.getFileFromPathAsync(filePath).then(function (storageFile) {
-            storageFile.openAsync(Windows.Storage.FileAccessMode.read).then(function (stream) {
-                var blob = MSApp.createBlobFromRandomAccessStream(storageFile.contentType, stream);
-                var formData = new FormData();
-                formData.append("source\";filename=\"" + storageFile.name + "\"", blob);
-                WinJS.xhr({ type: "POST", url: server, data: formData, headers: headers }).then(function (response) {
-                    var code = response.status;
-                    storageFile.getBasicPropertiesAsync().done(function (basicProperties) {
-
-                        Windows.Storage.FileIO.readBufferAsync(storageFile).done(function (buffer) {
-                            var dataReader = Windows.Storage.Streams.DataReader.fromBuffer(buffer);
-                            var fileContent = dataReader.readString(buffer.length);
-                            dataReader.close();
-                            var ftResult = new FileUploadResult(basicProperties.size, code, fileContent);
-                            // for now we explicitly write the bytesSent,responseCode,result 
-                            // in case cordova-plugin-file is not yet updated. -jm
-                            ftResult.bytesSent = basicProperties.size;
-                            ftResult.responseCode = code;
-                            ftResult.response = fileContent;
-                            successCallback && successCallback(ftResult);
-                        });
-
-                    });
-                }, function () {
-                    error && error(FileTransferError.INVALID_URL_ERR);
-                });
-            });
-
-        },function() {
-            error && error(FileTransferError.FILE_NOT_FOUND_ERR);
-        });
-    },
-
-    download:function(successCallback, error, options) {
-        var source = options[0];
-        var target = options[1];
-        var headers = options[4] || {};
-
-
-        if (target === null || typeof target === undefined) {
-            error && error(FileTransferError.FILE_NOT_FOUND_ERR);
-            return;
-        }
-        if (String(target).substr(0, 8) == "file:///") {
-            target = Windows.Storage.ApplicationData.current.localFolder.path + String(target).substr(8).split("/").join("\\");
-        }
-        var path = target.substr(0, String(target).lastIndexOf("\\"));
-        var fileName = target.substr(String(target).lastIndexOf("\\") + 1);
-        if (path === null || fileName === null) {
-            error && error(FileTransferError.FILE_NOT_FOUND_ERR);
-            return;
-        }
-
-        var download = null;
-
-
-        Windows.Storage.StorageFolder.getFolderFromPathAsync(path).then(function (storageFolder) {
-            storageFolder.createFileAsync(fileName, Windows.Storage.CreationCollisionOption.generateUniqueName).then(function (storageFile) {
-                var uri = Windows.Foundation.Uri(source);
-                var downloader = new Windows.Networking.BackgroundTransfer.BackgroundDownloader();
-
-                for (var header in headers) {
-                    downloader.setRequestHeader(header, headers[header]);
-                }
-
-
-                download = downloader.createDownload(uri, storageFile);
-                download.startAsync().then(function () {
-                    successCallback && successCallback(new FileEntry(storageFile.name, storageFile.path));
-                }, function () {
-                    error && error(FileTransferError.INVALID_URL_ERR);
-                });
-            });
-        });
-    }
-};
-
-require("cordova/exec/proxy").add("FileTransfer",module.exports);
diff --git a/www/wp7/base64.js b/www/wp7/base64.js
deleted file mode 100644
index 6c211e7..0000000
--- a/www/wp7/base64.js
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',
-    INVALID_CHARACTER_ERR = (function () {
-        // fabricate a suitable error object
-        try { document.createElement('$'); }
-        catch (error) { return error; }
-    }());
-
-    // encoder
-    // [https://gist.github.com/999166] by [https://github.com/nignag]
-    window.btoa || (
-    window.btoa = function (input) {
-        for (
-            // initialize result and counter
-          var block, charCode, idx = 0, map = chars, output = '';
-            // if the next input index does not exist:
-            //   change the mapping table to "="
-            //   check if d has no fractional digits
-          input.charAt(idx | 0) || (map = '=', idx % 1) ;
-            // "8 - idx % 1 * 8" generates the sequence 2, 4, 6, 8
-          output += map.charAt(63 & block >> 8 - idx % 1 * 8)
-        ) {
-            charCode = input.charCodeAt(idx += 3 / 4);
-            if (charCode > 0xFF) throw INVALID_CHARACTER_ERR;
-            block = block << 8 | charCode;
-        }
-        return output;
-    });
-
-    // decoder
-    // [https://gist.github.com/1020396] by [https://github.com/atk]
-    window.atob || (
-    window.atob = function (input) {
-        input = input.replace(/=+$/, '')
-        if (input.length % 4 == 1) throw INVALID_CHARACTER_ERR;
-        for (
-            // initialize result and counters
-          var bc = 0, bs, buffer, idx = 0, output = '';
-            // get next character
-          buffer = input.charAt(idx++) ;
-            // character found in table? initialize bit storage and add its ascii value;
-          ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,
-            // and if not first of each 4 characters,
-            // convert the first 8 bits to one ascii character
-            bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0
-        ) {
-            // try to find character in table (0-63, not found => -1)
-            buffer = chars.indexOf(buffer);
-        }
-        return output;
-    });
\ No newline at end of file