diff --git a/lib/units/device/plugins/filesystem.js b/lib/units/device/plugins/filesystem.js index 16060a55..e0c938fe 100644 --- a/lib/units/device/plugins/filesystem.js +++ b/lib/units/device/plugins/filesystem.js @@ -19,7 +19,7 @@ module.exports = syrup.serial() var log = logger.createLogger('device:plugins:filesystem') var plugin = Object.create(null) - plugin.retrive = function(file) { + plugin.retrieve = function(file) { log.info('Retriving file %s', file) return adb.pull(options.serial, file) @@ -37,7 +37,7 @@ module.exports = syrup.serial() // if this is a new store type, somethings need add to units/storage/plugins/ return storage.store('blob', transfer, { filename: path.basename(file), - contentType: 'text/plain', // FIXME(ssx): need to detect file type + contentType: 'application/octet-stream', // FIXME(ssx): need to detect file type knownLength: stats.size }) }) @@ -49,7 +49,7 @@ module.exports = syrup.serial() router.on(wire.FileSystemGetMessage, function(channel, message) { var reply = wireutil.reply(options.serial) - plugin.retrive(message.file) + plugin.retrieve(message.file) .then(function(file){ push.send([ channel, @@ -57,7 +57,7 @@ module.exports = syrup.serial() ]) }) .catch(function(err){ - log.error('File retrive %s failed\n%s', message.file, err.stack) + log.error('File retrieve %s failed\n%s', message.file, err.stack) push.send([ channel, reply.fail(err.message) diff --git a/lib/units/websocket/index.js b/lib/units/websocket/index.js index 7aeccb79..9c0e26b0 100644 --- a/lib/units/websocket/index.js +++ b/lib/units/websocket/index.js @@ -826,7 +826,7 @@ module.exports = function(options) { ) ]) }) - .on('fs.retrive', function(channel, responseChannel, data) { + .on('fs.retrieve', function(channel, responseChannel, data) { joinChannel(responseChannel) push.send([ channel diff --git a/res/app/components/stf/control/control-service.js b/res/app/components/stf/control/control-service.js index 5db6b015..d3b23fdf 100644 --- a/res/app/components/stf/control/control-service.js +++ b/res/app/components/stf/control/control-service.js @@ -225,8 +225,8 @@ module.exports = function ControlServiceFactory( return sendTwoWay('screen.capture') } - this.fsretrive = function(file){ - return sendTwoWay('fs.retrive', { + this.fsretrieve = function(file){ + return sendTwoWay('fs.retrieve', { file: file, }) } diff --git a/res/app/control-panes/filesystem/fs-controller.js b/res/app/control-panes/filesystem/fs-controller.js index 4e67c63b..7238148b 100644 --- a/res/app/control-panes/filesystem/fs-controller.js +++ b/res/app/control-panes/filesystem/fs-controller.js @@ -32,7 +32,7 @@ module.exports = function FsCtrl($scope, $timeout) { $scope.getFile = function(file){ var path = '/'+$scope.paths.join('/')+'/'+file; - $scope.control.fsretrive(path) + $scope.control.fsretrieve(path) .then(function(result){ location.href = result.body.href+"?download" })