From 42122c5c708769e11b626654bf3d989b6b0eddad Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Wed, 1 Feb 2012 13:34:53 -0800 Subject: Updating after merge with other FileIO branch --- js/io/system/fileio.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'js/io/system/fileio.js') diff --git a/js/io/system/fileio.js b/js/io/system/fileio.js index ac5812e9..f40aa96b 100755 --- a/js/io/system/fileio.js +++ b/js/io/system/fileio.js @@ -11,7 +11,7 @@ NOTES: empty file will be created. 'contents' should be a string to be saved as the file. 'contentType' is the mime type of the file. - coreIoApi: this.application.ninja.coreIoApi + Core API reference in NINJA: this.application.ninja.coreIoApi //////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// */ @@ -65,24 +65,44 @@ exports.FileIo = Montage.create(Object.prototype, { readFile: { enumerable: true, value: function() { + //Checking for API to be available + if (!this.application.ninja.coreIoApi.cloudAvailable()) { + //API not available, no IO action taken + return null; + } // } }, saveFile: { enumerable: true, value: function() { + //Checking for API to be available + if (!this.application.ninja.coreIoApi.cloudAvailable()) { + //API not available, no IO action taken + return null; + } // } }, copyFile: { enumerable: true, value: function() { + //Checking for API to be available + if (!this.application.ninja.coreIoApi.cloudAvailable()) { + //API not available, no IO action taken + return null; + } // } }, infoFile: { enumerable: true, value: function() { + //Checking for API to be available + if (!this.application.ninja.coreIoApi.cloudAvailable()) { + //API not available, no IO action taken + return null; + } // } } -- cgit v1.2.3