aboutsummaryrefslogtreecommitdiff
path: root/js/io/system/coreioapi.js
diff options
context:
space:
mode:
authorAnanya Sen2012-02-02 12:37:29 -0800
committerAnanya Sen2012-02-02 12:37:29 -0800
commit0e595c4e11ce9b44eff157de8616ed15fcd5d6fc (patch)
treeaba0df7f15b631345b9c44b6b50884d06b7a803a /js/io/system/coreioapi.js
parent87e247e74040b5e80ff40003d233d5317881102a (diff)
downloadninja-0e595c4e11ce9b44eff157de8616ed15fcd5d6fc.tar.gz
refactoring some file names and locations,
change made to maintain only one codemirror div. Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/io/system/coreioapi.js')
-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////////////////////////////////////////////////////////////////////////