From 906776893138257f96a0530674eda456ca3d817b Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Tue, 31 Jan 2012 06:24:03 -0800 Subject: added the api to check if a file is writable Signed-off-by: Ananya Sen --- js/io/system/coreioapi.js | 47 +---------------------------------------------- 1 file changed, 1 insertion(+), 46 deletions(-) (limited to 'js/io/system') diff --git a/js/io/system/coreioapi.js b/js/io/system/coreioapi.js index 1585fc33..c99ebda7 100755 --- a/js/io/system/coreioapi.js +++ b/js/io/system/coreioapi.js @@ -837,50 +837,7 @@ exports.CoreIoApi = Montage.create(Component, { var serviceURL = this._prepareServiceURL(this.fileServiceURL, file.uri), xhr = new XMLHttpRequest(); xhr.open("GET", serviceURL, false); - xhr.setRequestHeader("get-attributes", "true"); - xhr.send(); - if (xhr.readyState === 4) { - retValue.status = xhr.status; - if(xhr.status == 200) { - retValue.content = xhr.responseText; - } - retValue.success = true; - } - } - catch(error) { - xhr = null; - retValue.success = false; - } - } - return retValue; - } - }, - - //////////////////////////////////////////////////////////////////// - // Checks if the directory is writable - // Parameters: - // the file parameter must contain the following properties - // uri: string value containing the full directory path/URI i.e. "c:/foo" - // - // Return values: - // returns an object with two properties - // success: boolean indicating if the call succeeded or failed - // status: int indicating the request HTTP status code - // 204 - The file exists and response body has writable flag - // 404 - the file does not exist - // 500 - unknown server error occurred - //TODO:to be finalized - isDirectoryWritable:{ - enumerable:true, - writable:false, - value:function(file){ - var retValue = { success:null, status:null }; - if(file && file.uri) { - try { - var serviceURL = this._prepareServiceURL(this.directoryServiceURL, file.uri), - xhr = new XMLHttpRequest(); - xhr.open("GET", serviceURL, false); - xhr.setRequestHeader("get-attributes", "true"); + xhr.setRequestHeader("get-file-info", "true"); xhr.send(); if (xhr.readyState === 4) { retValue.status = xhr.status; @@ -899,8 +856,6 @@ exports.CoreIoApi = Montage.create(Component, { } } - - }); //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// \ No newline at end of file -- cgit v1.2.3 From 553fce7721cacfd13b6013fdcdd0243c90083b5e Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Wed, 1 Feb 2012 11:59:11 -0800 Subject: fixed reference to coreioapi cleaning up opening code view tabs Signed-off-by: Ananya Sen --- js/io/system/coreioapi.js | 3 --- 1 file changed, 3 deletions(-) (limited to 'js/io/system') diff --git a/js/io/system/coreioapi.js b/js/io/system/coreioapi.js index 5deeae73..43812b3c 100755 --- a/js/io/system/coreioapi.js +++ b/js/io/system/coreioapi.js @@ -134,9 +134,6 @@ exports.CoreIoApi = Montage.create(Component, { directoryServiceURL: { enumerable: false, get: function() { - if(!this.rootUrl){ - this.rootUrl = 'http://localhost:16380'; - } return String(this.rootUrl+this._directoryServiceURL); }, set: function(value) { -- cgit v1.2.3