aboutsummaryrefslogtreecommitdiff
path: root/js/io/system
diff options
context:
space:
mode:
Diffstat (limited to 'js/io/system')
-rwxr-xr-xjs/io/system/coreioapi.js29
1 files changed, 28 insertions, 1 deletions
diff --git a/js/io/system/coreioapi.js b/js/io/system/coreioapi.js
index 717606b5..7839acee 100755
--- a/js/io/system/coreioapi.js
+++ b/js/io/system/coreioapi.js
@@ -983,8 +983,35 @@ exports.CoreIoApi = Montage.create(Component, {
983 // 983 //
984 return retValue; 984 return retValue;
985 } 985 }
986 } 986 },
987 //////////////////////////////////////////////////////////////////// 987 ////////////////////////////////////////////////////////////////////
988 /***
989 * check if the file exists
990 */
991 checkFileExists:{
992 value: function(fileUri, folderUri, fileType){
993 var uri = "", response=null, status=true;
994
995 //prepare absolute uri
996 if(/[^/\\]$/g.test(folderUri)){
997 folderUri = folderUri + "/";
998 }
999
1000 //todo:add file extension check if fileType present
1001
1002 uri = ""+folderUri+fileUri;
1003
1004 response = this.fileExists({"uri":uri});
1005 if(!!response && response.success && (response.status === 204)){
1006 status = true;
1007 }else if(!!response && response.success && (response.status === 404)){
1008 status = false;
1009 }else{
1010 status = false;
1011 }
1012 return status;
1013 }
1014 }
988 //////////////////////////////////////////////////////////////////// 1015 ////////////////////////////////////////////////////////////////////
989}); 1016});
990//////////////////////////////////////////////////////////////////////// 1017////////////////////////////////////////////////////////////////////////