aboutsummaryrefslogtreecommitdiff
path: root/js/io/system
diff options
context:
space:
mode:
Diffstat (limited to 'js/io/system')
-rwxr-xr-xjs/io/system/coreioapi.js9
-rwxr-xr-xjs/io/system/projectio.js2
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//
13exports.ProjectIo = = Montage.create(Object.prototype, { 13exports.ProjectIo = Montage.create(Object.prototype, {
14 //////////////////////////////////////////////////////////////////// 14 ////////////////////////////////////////////////////////////////////
15 // 15 //
16 newProject: { 16 newProject: {