From ceeb14e6209c29552760af4c5ab571315685cf17 Mon Sep 17 00:00:00 2001 From: Raymond Feng Date: Tue, 25 Jun 2013 10:44:37 -0700 Subject: [PATCH] Set properties --- lib/providers/filesystem/container.js | 6 +++++- lib/providers/filesystem/file.js | 6 +++++- lib/providers/filesystem/index.js | 6 +++--- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/lib/providers/filesystem/container.js b/lib/providers/filesystem/container.js index d0be4de..dd83daf 100644 --- a/lib/providers/filesystem/container.js +++ b/lib/providers/filesystem/container.js @@ -8,5 +8,9 @@ var Container = exports.Container = function Container(client, details) { util.inherits(Container, base.Container); Container.prototype._setProperties = function(details) { - + for(var k in details) { + if(typeof details[k] !== 'function') { + this[k] = details[k]; + } + } } \ No newline at end of file diff --git a/lib/providers/filesystem/file.js b/lib/providers/filesystem/file.js index 8161065..86709a0 100644 --- a/lib/providers/filesystem/file.js +++ b/lib/providers/filesystem/file.js @@ -8,5 +8,9 @@ var File = exports.File = function File(client, details) { util.inherits(File, base.File); File.prototype._setProperties = function(details) { - + for(var k in details) { + if(typeof details[k] !== 'function') { + this[k] = details[k]; + } + } } \ No newline at end of file diff --git a/lib/providers/filesystem/index.js b/lib/providers/filesystem/index.js index 8debf65..8f93a07 100644 --- a/lib/providers/filesystem/index.js +++ b/lib/providers/filesystem/index.js @@ -177,15 +177,15 @@ FileSystemProvider.prototype.getFile = function (container, file, cb) { if (!validateName(file, cb)) return; var filePath = path.join(this.root, container, file); fs.stat(filePath, function (err, stat) { - var file = null; + var f = null; if (!err) { var props = {container: container, name: file}; for (var p in stat) { props[p] = stat[p]; } - file = new File(self, props); + f = new File(self, props); } - cb && cb(err, file); + cb && cb(err, f); }); }