Return-Path: X-Original-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0E3C99FD2 for ; Thu, 7 Jun 2012 20:40:47 +0000 (UTC) Received: (qmail 71683 invoked by uid 500); 7 Jun 2012 20:40:45 -0000 Delivered-To: apmail-incubator-callback-commits-archive@incubator.apache.org Received: (qmail 71629 invoked by uid 500); 7 Jun 2012 20:40:45 -0000 Mailing-List: contact callback-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-commits@incubator.apache.org Received: (qmail 70793 invoked by uid 99); 7 Jun 2012 20:40:44 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jun 2012 20:40:44 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 9D67810B35; Thu, 7 Jun 2012 20:40:44 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: timkim@apache.org To: callback-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [45/48] js commit: trying to get entry object to work Message-Id: <20120607204044.9D67810B35@tyr.zones.apache.org> Date: Thu, 7 Jun 2012 20:40:44 +0000 (UTC) trying to get entry object to work Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/commit/93d7f505 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/93d7f505 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/93d7f505 Branch: refs/heads/master Commit: 93d7f5057e65663c0899ea788415919e451a5183 Parents: 9d2ad4c Author: Tim Kim Authored: Mon May 14 15:38:44 2012 -0700 Committer: Tim Kim Committed: Thu Jun 7 13:40:22 2012 -0700 ---------------------------------------------------------------------- lib/playbook/plugin/playbook/Entry.js | 28 +++++++++++++++++++++++++++- 1 files changed, 27 insertions(+), 1 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/93d7f505/lib/playbook/plugin/playbook/Entry.js ---------------------------------------------------------------------- diff --git a/lib/playbook/plugin/playbook/Entry.js b/lib/playbook/plugin/playbook/Entry.js index c8071a9..1630493 100644 --- a/lib/playbook/plugin/playbook/Entry.js +++ b/lib/playbook/plugin/playbook/Entry.js @@ -2,7 +2,12 @@ var FileError = require('cordova/plugin/FileError'), LocalFileSystem = require('cordova/plugin/LocalFileSystem'), resolveLocalFileSystemURI = require('cordova/plugin/resolveLocalFileSystemURI'); -module.exports = { +function playbookEntry(){ + +} + +playbookEntry.prototype = { + getMetadata : function(successCallback, errorCallback){ var success = typeof successCallback !== 'function' ? null : function(lastModified) { var metadata = new Metadata(lastModified); @@ -57,6 +62,25 @@ module.exports = { } }; + if(this.isFile){ + if(blackberry.io.file.exists(parent + newName)){ + // overwrite file + + }else{ + console.log('this.srcPath: ' + this.srcPath); + console.log('newName: ' + newName); + blackberry.io.file.copy(this.srcPath,parent+newName); + blackberry.io.deleteFile(this.srcPath); + } + }else{ + if(blackberry.io.dir.exists(parent + newName)){ + fail(FileError.NO_MODIFICATION_ALLOWED_ERR); + }else{ + blackberry.io.dir.createNewDir(parent + newName); + blackberry.io.dir.deleteDirectory(this.srcPath); + } + } + }, copyTo : function(parent, newName, successCallback, errorCallback) { @@ -147,3 +171,5 @@ module.exports = { } } }; + +module.exports = playbookEntry; \ No newline at end of file