diff options
author | Jose Antonio Marquez | 2012-02-04 22:35:28 -0800 |
---|---|---|
committer | Jose Antonio Marquez | 2012-02-04 22:35:28 -0800 |
commit | d1fda420f898965b5dd57de0c8340886cef308a8 (patch) | |
tree | 2fad2e890c1142a7eee30c45710f1f0b78adfdde /js/io/system | |
parent | cc64cfc5aaa570ed9f72545fc135200019d62311 (diff) | |
parent | 45cfffd9261ab1aa714554c584f0d0d8fe627c91 (diff) | |
download | ninja-d1fda420f898965b5dd57de0c8340886cef308a8.tar.gz |
Merge branch 'refs/heads/AnanyaFileIO' into FileIO
Diffstat (limited to 'js/io/system')
-rwxr-xr-x | js/io/system/coreioapi.js | 9 | ||||
-rwxr-xr-x | js/io/system/projectio.js | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/js/io/system/coreioapi.js b/js/io/system/coreioapi.js index fa6c4cf6..c34e0736 100755 --- a/js/io/system/coreioapi.js +++ b/js/io/system/coreioapi.js | |||
@@ -1013,6 +1013,7 @@ exports.CoreIoApi = Montage.create(Component, { | |||
1013 | /*** | 1013 | /*** |
1014 | * checks for valid uri pattern | 1014 | * checks for valid uri pattern |
1015 | * also flags if Windows uri pattern and Unix uri patterns are mixed | 1015 | * also flags if Windows uri pattern and Unix uri patterns are mixed |
1016 | * Todo: need to augment when files can be accessed via other protocols like http, ftp, ssh, etc. | ||
1016 | */ | 1017 | */ |
1017 | isValidUri:{ | 1018 | isValidUri:{ |
1018 | value: function(uri){ | 1019 | value: function(uri){ |
@@ -1035,7 +1036,7 @@ exports.CoreIoApi = Montage.create(Component, { | |||
1035 | * check if the file exists | 1036 | * check if the file exists |
1036 | */ | 1037 | */ |
1037 | checkFileExists:{ | 1038 | checkFileExists:{ |
1038 | value: function(fileUri, folderUri, fileType){ | 1039 | value: function(fileName, folderUri, fileType){ |
1039 | var uri = "", response=null, status=true; | 1040 | var uri = "", response=null, status=true; |
1040 | 1041 | ||
1041 | //prepare absolute uri | 1042 | //prepare absolute uri |
@@ -1043,9 +1044,11 @@ exports.CoreIoApi = Montage.create(Component, { | |||
1043 | folderUri = folderUri + "/"; | 1044 | folderUri = folderUri + "/"; |
1044 | } | 1045 | } |
1045 | 1046 | ||
1046 | //todo:add file extension check if fileType present | 1047 | if(!!fileType && (fileName.lastIndexOf(fileType) !== (fileName.length - fileType.length))){ |
1048 | fileName = fileName+fileType; | ||
1049 | } | ||
1047 | 1050 | ||
1048 | uri = ""+folderUri+fileUri; | 1051 | uri = ""+folderUri+fileName; |
1049 | 1052 | ||
1050 | response = this.fileExists({"uri":uri}); | 1053 | response = this.fileExists({"uri":uri}); |
1051 | if(!!response && response.success && (response.status === 204)){ | 1054 | if(!!response && response.success && (response.status === 204)){ |
diff --git a/js/io/system/projectio.js b/js/io/system/projectio.js index ad4cf151..8e3230d7 100755 --- a/js/io/system/projectio.js +++ b/js/io/system/projectio.js | |||
@@ -10,7 +10,7 @@ var Montage = require("montage/core/core").Montage, | |||
10 | FileIo = require("js/io/system/fileio").FileIo; | 10 | FileIo = require("js/io/system/fileio").FileIo; |
11 | //////////////////////////////////////////////////////////////////////// | 11 | //////////////////////////////////////////////////////////////////////// |
12 | // | 12 | // |
13 | exports.ProjectIo = = Montage.create(Object.prototype, { | 13 | exports.ProjectIo = Montage.create(Object.prototype, { |
14 | //////////////////////////////////////////////////////////////////// | 14 | //////////////////////////////////////////////////////////////////// |
15 | // | 15 | // |
16 | newProject: { | 16 | newProject: { |