You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2015/02/06 09:02:33 UTC
[1/2] cordova-plugin-file-transfer git commit: CB-8407 Removes excess
path to native path conversion in download method
Repository: cordova-plugin-file-transfer
Updated Branches:
refs/heads/master 7753baacf -> 7a9362681
CB-8407 Removes excess path to native path conversion in download method
This fixes file transfer download tests failures, when target file is specified by ms-appdata:/// uri on Windows.
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/commit/0394c0ce
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/tree/0394c0ce
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/diff/0394c0ce
Branch: refs/heads/master
Commit: 0394c0ce1eaf60f93ef1d529bc2fe1634d5d33da
Parents: 7753baa
Author: Vladimir Kotikov <v-...@microsoft.com>
Authored: Tue Feb 3 15:50:31 2015 +0300
Committer: Vladimir Kotikov <v-...@microsoft.com>
Committed: Thu Feb 5 16:48:32 2015 +0300
----------------------------------------------------------------------
src/windows/FileTransferProxy.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/blob/0394c0ce/src/windows/FileTransferProxy.js
----------------------------------------------------------------------
diff --git a/src/windows/FileTransferProxy.js b/src/windows/FileTransferProxy.js
index 453b02b..2649282 100644
--- a/src/windows/FileTransferProxy.js
+++ b/src/windows/FileTransferProxy.js
@@ -237,7 +237,7 @@ exec(win, fail, 'FileTransfer', 'upload',
// [source, target, trustAllHosts, id, headers]
download:function(successCallback, errorCallback, options) {
var source = options[0];
- var target = cordovaPathToNative(options[1]);
+ var target = options[1];
var downloadId = options[3];
var headers = options[4] || {};
@@ -252,7 +252,7 @@ exec(win, fail, 'FileTransfer', 'upload',
target = target.replace('ms-appdata:///local', appData.localFolder.path)
.replace('ms-appdata:///temp', appData.temporaryFolder.path);
}
- target = cordovaPathToNative(target); // again?
+ target = cordovaPathToNative(target);
var path = target.substr(0, target.lastIndexOf("\\"));
var fileName = target.substr(target.lastIndexOf("\\") + 1);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[2/2] cordova-plugin-file-transfer git commit: CB-8407 Use File proxy
to construct valid FileEntry for download success callback
Posted by an...@apache.org.
CB-8407 Use File proxy to construct valid FileEntry for download success callback
Due to changes in file plugin (https://github.com/apache/cordova-plugin-file/commit/bcbeae24cd24583b790da95e0e076492eb16cd4f) result of download method should now have filesystemName specified for proper work. This updates download method to construct FileEntry properly, using File plugin proxy.
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/commit/7a936268
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/tree/7a936268
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/diff/7a936268
Branch: refs/heads/master
Commit: 7a93626812522e473248c7629238da81d03fb805
Parents: 0394c0c
Author: Vladimir Kotikov <v-...@microsoft.com>
Authored: Tue Feb 3 17:06:14 2015 +0300
Committer: Vladimir Kotikov <v-...@microsoft.com>
Committed: Thu Feb 5 16:48:33 2015 +0300
----------------------------------------------------------------------
src/windows/FileTransferProxy.js | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/blob/7a936268/src/windows/FileTransferProxy.js
----------------------------------------------------------------------
diff --git a/src/windows/FileTransferProxy.js b/src/windows/FileTransferProxy.js
index 2649282..df5dd0a 100644
--- a/src/windows/FileTransferProxy.js
+++ b/src/windows/FileTransferProxy.js
@@ -26,6 +26,7 @@
var FTErr = require('./FileTransferError'),
ProgressEvent = require('org.apache.cordova.file.ProgressEvent'),
FileUploadResult = require('org.apache.cordova.file.FileUploadResult'),
+ FileProxy = require('org.apache.cordova.file.FileProxy'),
FileEntry = require('org.apache.cordova.file.FileEntry');
var appData = Windows.Storage.ApplicationData.current;
@@ -313,7 +314,9 @@ exec(win, fail, 'FileTransfer', 'upload',
.replace(appData.temporaryFolder.path, 'ms-appdata:///temp')
.replace('\\', '/');
- successCallback(new FileEntry(storageFile.name, storageFile.path, null, nativeURI));
+ // Passing null as error callback here because downloaded file should exist in any case
+ // otherwise the error callback will be hit during file creation in another place
+ FileProxy.resolveLocalFileSystemURI(successCallback, null, [nativeURI]);
}, function(error) {
var getTransferError = new WinJS.Promise(function (resolve) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org