aboutsummaryrefslogtreecommitdiff
path: root/js/io/system/fileio.js
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-02-01 11:51:24 -0800
committerJose Antonio Marquez2012-02-01 11:51:24 -0800
commitd74910a897f2db920f6f67d922532d245074c8f7 (patch)
tree2a19bc6a17324af2b1a33c316aa1109006f4d8dc /js/io/system/fileio.js
parente824b4901817429231cd9ab6aa068cc0a0849e3a (diff)
downloadninja-d74910a897f2db920f6f67d922532d245074c8f7.tar.gz
Fixing coreIO API referencing
Diffstat (limited to 'js/io/system/fileio.js')
-rwxr-xr-xjs/io/system/fileio.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/js/io/system/fileio.js b/js/io/system/fileio.js
index 38ab05e8..ac5812e9 100755
--- a/js/io/system/fileio.js
+++ b/js/io/system/fileio.js
@@ -11,11 +11,12 @@ NOTES:
11 empty file will be created. 'contents' should be a string to be saved 11 empty file will be created. 'contents' should be a string to be saved
12 as the file. 'contentType' is the mime type of the file. 12 as the file. 'contentType' is the mime type of the file.
13 13
14 coreIoApi: this.application.ninja.coreIoApi
15
14//////////////////////////////////////////////////////////////////////// 16////////////////////////////////////////////////////////////////////////
15///////////////////////////////////////////////////////////////////// */ 17///////////////////////////////////////////////////////////////////// */
16// 18//
17var Montage = require("montage/core/core").Montage, 19var Montage = require("montage/core/core").Montage;
18 CoreIoApi = require("js/io/system/coreioapi").CoreIoApi;
19//////////////////////////////////////////////////////////////////////// 20////////////////////////////////////////////////////////////////////////
20//Exporting as File I/O 21//Exporting as File I/O
21exports.FileIo = Montage.create(Object.prototype, { 22exports.FileIo = Montage.create(Object.prototype, {
@@ -28,12 +29,12 @@ exports.FileIo = Montage.create(Object.prototype, {
28 enumerable: true, 29 enumerable: true,
29 value: function(file) { 30 value: function(file) {
30 //Checking for API to be available 31 //Checking for API to be available
31 if (!CoreIoApi.cloudAvailable()) { 32 if (!this.application.ninja.coreIoApi.cloudAvailable()) {
32 //API not available, no IO action taken 33 //API not available, no IO action taken
33 return null; 34 return null;
34 } 35 }
35 //Peforming check for file to exist 36 //Peforming check for file to exist
36 var check = CoreIoApi.fileExists(file.uri), status, create; 37 var check = this.application.ninja.coreIoApi.fileExists(file.uri), status, create;
37 //Upon successful check, handling results 38 //Upon successful check, handling results
38 if (check.success) { 39 if (check.success) {
39 //Handling status of check 40 //Handling status of check
@@ -44,7 +45,7 @@ exports.FileIo = Montage.create(Object.prototype, {
44 break; 45 break;
45 case 404: 46 case 404:
46 //File does not exists, ready to be created 47 //File does not exists, ready to be created
47 create = CoreIoApi.createFile(file); 48 create = this.application.ninja.coreIoApi.createFile(file);
48 //Storing status to be returned (for UI handling) 49 //Storing status to be returned (for UI handling)
49 if (create.success) { 50 if (create.success) {
50 status = check.status; 51 status = check.status;