summaryrefslogtreecommitdiff
path: root/plugins/cordova-plugin-file/www/ubuntu
diff options
context:
space:
mode:
authorArjun Roychowdhury <pliablepixels@gmail.com>2015-10-31 08:21:38 -0400
committerArjun Roychowdhury <pliablepixels@gmail.com>2015-10-31 08:21:38 -0400
commit02811010cf62f1b21a06780d1e470d04bb24c50f (patch)
tree0d933789068aac11c810ed4bb169d14ab16c43c6 /plugins/cordova-plugin-file/www/ubuntu
parentbca561c1b3989d62a1fba829e0380c6fbf36caf5 (diff)
removed unecessary files from git
Diffstat (limited to 'plugins/cordova-plugin-file/www/ubuntu')
-rw-r--r--plugins/cordova-plugin-file/www/ubuntu/FileSystem.js34
-rw-r--r--plugins/cordova-plugin-file/www/ubuntu/FileWriter.js135
-rw-r--r--plugins/cordova-plugin-file/www/ubuntu/fileSystems-roots.js53
3 files changed, 0 insertions, 222 deletions
diff --git a/plugins/cordova-plugin-file/www/ubuntu/FileSystem.js b/plugins/cordova-plugin-file/www/ubuntu/FileSystem.js
deleted file mode 100644
index c43da824..00000000
--- a/plugins/cordova-plugin-file/www/ubuntu/FileSystem.js
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-FILESYSTEM_PROTOCOL = "cdvfile";
-
-module.exports = {
- __format__: function(fullPath) {
- if (this.name === 'content') {
- return 'content:/' + fullPath;
- }
- var path = ('/' + this.name + (fullPath[0] === '/' ? '' : '/') + encodeURI(fullPath)).replace('//','/');
-
- return FILESYSTEM_PROTOCOL + '://localhost' + path;
- }
-};
-
diff --git a/plugins/cordova-plugin-file/www/ubuntu/FileWriter.js b/plugins/cordova-plugin-file/www/ubuntu/FileWriter.js
deleted file mode 100644
index a75506b7..00000000
--- a/plugins/cordova-plugin-file/www/ubuntu/FileWriter.js
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var exec = require('cordova/exec'),
- FileError = require('./FileError'),
- ProgressEvent = require('./ProgressEvent');
-
-function write(data) {
- var that=this;
- var supportsBinary = (typeof window.Blob !== 'undefined' && typeof window.ArrayBuffer !== 'undefined');
- var isBinary;
-
- // Check to see if the incoming data is a blob
- if (data instanceof File || (supportsBinary && data instanceof Blob)) {
- var fileReader = new FileReader();
- fileReader.onload = function() {
- // Call this method again, with the arraybuffer as argument
- FileWriter.prototype.write.call(that, this.result);
- };
- if (supportsBinary) {
- fileReader.readAsArrayBuffer(data);
- } else {
- fileReader.readAsText(data);
- }
- return;
- }
-
- // Mark data type for safer transport over the binary bridge
- isBinary = supportsBinary && (data instanceof ArrayBuffer);
-
- // Throw an exception if we are already writing a file
- if (this.readyState === FileWriter.WRITING) {
- throw new FileError(FileError.INVALID_STATE_ERR);
- }
-
- // WRITING state
- this.readyState = FileWriter.WRITING;
-
- var me = this;
-
- // If onwritestart callback
- if (typeof me.onwritestart === "function") {
- me.onwritestart(new ProgressEvent("writestart", {"target":me}));
- }
-
- if (data instanceof ArrayBuffer || data.buffer instanceof ArrayBuffer) {
- data = new Uint8Array(data);
- var binary = "";
- for (var i = 0; i < data.byteLength; i++) {
- binary += String.fromCharCode(data[i]);
- }
- data = binary;
- }
-
- var prefix = "file://localhost";
- var path = this.localURL;
- if (path.substr(0, prefix.length) == prefix) {
- path = path.substr(prefix.length);
- }
- // Write file
- exec(
- // Success callback
- function(r) {
- // If DONE (cancelled), then don't do anything
- if (me.readyState === FileWriter.DONE) {
- return;
- }
-
- // position always increases by bytes written because file would be extended
- me.position += r;
- // The length of the file is now where we are done writing.
-
- me.length = me.position;
-
- // DONE state
- me.readyState = FileWriter.DONE;
-
- // If onwrite callback
- if (typeof me.onwrite === "function") {
- me.onwrite(new ProgressEvent("write", {"target":me}));
- }
-
- // If onwriteend callback
- if (typeof me.onwriteend === "function") {
- me.onwriteend(new ProgressEvent("writeend", {"target":me}));
- }
- },
- // Error callback
- function(e) {
- // If DONE (cancelled), then don't do anything
- if (me.readyState === FileWriter.DONE) {
- return;
- }
-
- // DONE state
- me.readyState = FileWriter.DONE;
-
- // Save error
- me.error = new FileError(e);
-
- // If onerror callback
- if (typeof me.onerror === "function") {
- me.onerror(new ProgressEvent("error", {"target":me}));
- }
-
- // If onwriteend callback
- if (typeof me.onwriteend === "function") {
- me.onwriteend(new ProgressEvent("writeend", {"target":me}));
- }
- }, "File", "write", [path, data, this.position, isBinary]);
-};
-
-module.exports = {
- write: write
-};
-
-require("cordova/exec/proxy").add("FileWriter", module.exports);
diff --git a/plugins/cordova-plugin-file/www/ubuntu/fileSystems-roots.js b/plugins/cordova-plugin-file/www/ubuntu/fileSystems-roots.js
deleted file mode 100644
index e132a959..00000000
--- a/plugins/cordova-plugin-file/www/ubuntu/fileSystems-roots.js
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-var fsMap = null;
-var FileSystem = require('./FileSystem');
-var LocalFileSystem = require('./LocalFileSystem');
-var exec = require('cordova/exec');
-
-var requestFileSystem = function(type, size, successCallback) {
- var success = function(file_system) {
- if (file_system) {
- if (successCallback) {
- fs = new FileSystem(file_system.name, file_system.root);
- successCallback(fs);
- }
- }
- };
- exec(success, null, "File", "requestFileSystem", [type, size]);
-};
-
-require('./fileSystems').getFs = function(name, callback) {
- if (fsMap) {
- callback(fsMap[name]);
- } else {
- requestFileSystem(LocalFileSystem.PERSISTENT, 1, function(fs) {
- requestFileSystem(LocalFileSystem.TEMPORARY, 1, function(tmp) {
- fsMap = {};
- fsMap[tmp.name] = tmp;
- fsMap[fs.name] = fs;
- callback(fsMap[name]);
- });
- });
- }
-};
-