From 7bee50379c1df86bb571e0e8d6c08e24d25231f5 Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Mon, 9 Jul 2012 16:38:08 -0700 Subject: BSD License --- js/io/system/coreioapi.js | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'js/io/system/coreioapi.js') diff --git a/js/io/system/coreioapi.js b/js/io/system/coreioapi.js index d3977106..b8c08832 100755 --- a/js/io/system/coreioapi.js +++ b/js/io/system/coreioapi.js @@ -1,24 +1,25 @@ /* -Copyright (c) 2012, Motorola Mobility, Inc +Copyright (c) 2012, Motorola Mobility LLC. All Rights Reserved. -BSD License. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - - Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - Neither the name of Motorola Mobility nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of Motorola Mobility LLC nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS @@ -33,7 +34,7 @@ POSSIBILITY OF SUCH DAMAGE. NOTES: Core API reference in NINJA: this.application.ninja.coreIoApi - + //////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// */ var Montage = require("montage/core/core").Montage, @@ -101,7 +102,7 @@ exports.CoreIoApi = Montage.create(Component, { this.ninjaLibrary.addEventListener('sync', this, false); //Sending library to be synced to chrome this.ninjaLibrary.synchronize(e._event.ninjaChromeLibrary, this.chromeFileSystem); - + } }, //////////////////////////////////////////////////////////////////// @@ -389,7 +390,7 @@ exports.CoreIoApi = Montage.create(Component, { try { var serviceURL = this._prepareServiceURL(this.fileServiceURL, file.uri), xhr = new XMLHttpRequest(); - // + // xhr.open("GET", serviceURL, false); xhr.setRequestHeader("check-existence-only", "true"); xhr.send(); @@ -434,12 +435,12 @@ exports.CoreIoApi = Montage.create(Component, { xhr = new XMLHttpRequest(); // xhr.open("POST", serviceURL, false); - //xhr.responseType = "arraybuffer"; + //xhr.responseType = "arraybuffer"; if(file.contentType && file.contentType.length) xhr.setRequestHeader("Content-Type", file.contentType); else xhr.setRequestHeader("Content-Type", "text/plain"); - + if (file.contents) xhr.send(file.contents); else @@ -700,7 +701,7 @@ exports.CoreIoApi = Montage.create(Component, { // status: int indicating the request HTTP status code // 200 - the file was read and its contents were returned // 404 - the file does not exist - // 500 - unknown server error occurred + // 500 - unknown server error occurred readExternalFile: { enumerable: false, value: function(file) { @@ -893,7 +894,7 @@ exports.CoreIoApi = Montage.create(Component, { var retValue = { success:null, content:null, status:null }; if(dir && dir.uri && dir.uri.length) { try { - var serviceURL = this._prepareServiceURL(this.directoryServiceURL, dir.uri), + var serviceURL = this._prepareServiceURL(this.directoryServiceURL, dir.uri), xhr = new XMLHttpRequest(); // xhr.open("GET", serviceURL, false); -- cgit v1.2.3