diff --git a/plugin.xml b/plugin.xml
index f99020d8..b39fccfb 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -182,6 +182,9 @@ to config.xml in order for the application to find previously stored files.
+
+
+
diff --git a/tests/tests.js b/tests/tests.js
index 84da3626..676d6fe7 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -135,7 +135,7 @@ exports.defineAutoTests = function () {
success = success || function () {};
error = error || failed.bind(null, success, 'deleteEntry failed.');
- window.resolveLocalFileSystemURL(root.toURL() + '/' + name, function (entry) {
+ window.resolveLocalFileSystemURL(root.nativeURL + '/' + name, function (entry) {
if (entry.isDirectory === true) {
entry.removeRecursively(success, error);
} else {
@@ -321,7 +321,7 @@ exports.defineAutoTests = function () {
deleteEntry(fileName, done);
};
createFile(fileName, function (entry) {
- window.resolveLocalFileSystemURL(entry.toURL(), win, failed.bind(null, done, 'window.resolveLocalFileSystemURL - Error resolving file URL: ' + entry.toURL()));
+ window.resolveLocalFileSystemURL(entry.nativeURL, win, failed.bind(null, done, 'window.resolveLocalFileSystemURL - Error resolving file URL: ' + entry.nativeURL));
}, failed.bind(null, done, 'createFile - Error creating file: ' + fileName), failed.bind(null, done, 'createFile - Error creating file: ' + fileName));
});
@@ -338,7 +338,7 @@ exports.defineAutoTests = function () {
deleteEntry(fileName, done);
};
createFile(fileName, function (entry) {
- const entryURL = entry.toURL() + '/';
+ const entryURL = entry.nativeURL + '/';
window.resolveLocalFileSystemURL(entryURL, win, failed.bind(null, done, 'window.resolveLocalFileSystemURL - Error resolving file URL: ' + entryURL));
}, failed.bind(null, done, 'createFile - Error creating file: ' + fileName), failed.bind(null, done, 'createFile - Error creating file: ' + fileName));
});
@@ -357,7 +357,7 @@ exports.defineAutoTests = function () {
};
function gotDirectory (entry) {
// lookup file system entry
- window.resolveLocalFileSystemURL(entry.toURL(), win, failed.bind(null, done, 'window.resolveLocalFileSystemURL - Error resolving directory URL: ' + entry.toURL()));
+ window.resolveLocalFileSystemURL(entry.nativeURL, win, failed.bind(null, done, 'window.resolveLocalFileSystemURL - Error resolving directory URL: ' + entry.nativeURL));
}
createDirectory(fileName, gotDirectory, failed.bind(null, done, 'createDirectory - Error creating directory: ' + fileName), failed.bind(null, done, 'createDirectory - Error creating directory: ' + fileName));
});
@@ -376,7 +376,7 @@ exports.defineAutoTests = function () {
};
function gotDirectory (entry) {
// lookup file system entry
- let entryURL = entry.toURL();
+ let entryURL = entry.nativeURL;
entryURL = entryURL.substring(0, entryURL.length - 1);
window.resolveLocalFileSystemURL(entryURL, win, failed.bind(null, done, 'window.resolveLocalFileSystemURL - Error resolving directory URL: ' + entryURL));
}
@@ -412,12 +412,12 @@ exports.defineAutoTests = function () {
};
// create a new file entry
createFile(fileName, function (entry) {
- window.resolveLocalFileSystemURL(entry.toURL() + '?1234567890', win, failed.bind(null, done, 'window.resolveLocalFileSystemURL - Error resolving file URI: ' + entry.toURL()));
+ window.resolveLocalFileSystemURL(entry.nativeURL + '?1234567890', win, failed.bind(null, done, 'window.resolveLocalFileSystemURL - Error resolving file URI: ' + entry.nativeURL));
}, failed.bind(null, done, 'createFile - Error creating file: ' + fileName));
});
it('file.spec.11 should error (NOT_FOUND_ERR) when resolving (non-existent) invalid file name', function (done) {
- const fileName = joinURL(root.toURL(), 'this.is.not.a.valid.file.txt');
+ const fileName = joinURL(root.nativeURL, 'this.is.not.a.valid.file.txt');
const fail = function (error) {
expect(error).toBeDefined();
if (isChrome) {
@@ -488,7 +488,7 @@ exports.defineAutoTests = function () {
expect(entry.removeRecursively).toBeDefined();
done();
};
- window.resolveLocalFileSystemURL(root.toURL(), win, failed.bind(null, done, 'window.resolveLocalFileSystemURL - Error resolving file URI: ' + root.toURL()));
+ window.resolveLocalFileSystemURL(root.nativeURL, win, failed.bind(null, done, 'window.resolveLocalFileSystemURL - Error resolving file URI: ' + root.nativeURL));
});
});
@@ -684,7 +684,7 @@ exports.defineAutoTests = function () {
function getDir (dirEntry) {
expect(dirEntry.filesystem).toBeDefined();
expect(dirEntry.filesystem).toBe(root.filesystem);
- const dirURI = dirEntry.toURL();
+ const dirURI = dirEntry.nativeURL;
// now encode URI and try to resolve
window.resolveLocalFileSystemURL(dirURI, win, failed.bind(null, done, 'window.resolveLocalFileSystemURL - getDir function - Error resolving directory: ' + dirURI));
}
@@ -3355,7 +3355,7 @@ exports.defineAutoTests = function () {
/* These specs verify that paths with parent references i("..") in them
* work correctly, and do not cause the application to crash.
*/
- it('file.spec.110 should not throw exception resolving parent refefences', function (done) {
+ it('file.spec.110 should not throw exception resolving parent references', function (done) {
/* This is a direct copy of file.spec.9, with the filename changed, * as reported in CB-5721.
*/
const fileName = 'resolve.file.uri';
@@ -3364,12 +3364,12 @@ exports.defineAutoTests = function () {
createDirectory(dirName, function () {
createFile(dirName + '/../' + fileName, function (entry) {
// lookup file system entry
- window.resolveLocalFileSystemURL(entry.toURL(), function (fileEntry) {
+ window.resolveLocalFileSystemURL(entry.nativeURL, function (fileEntry) {
expect(fileEntry).toBeDefined();
expect(fileEntry.name).toCanonicallyMatch(fileName);
// cleanup
deleteEntry(fileName, done);
- }, failed.bind(null, done, 'window.resolveLocalFileSystemURL - Error resolving URI: ' + entry.toURL()));
+ }, failed.bind(null, done, 'window.resolveLocalFileSystemURL - Error resolving URI: ' + entry.nativeURL));
}, failed.bind(null, done, 'createFile - Error creating file: ../' + fileName));
}, failed.bind(null, done, 'createDirectory - Error creating directory: ' + dirName));
});
@@ -3442,6 +3442,8 @@ exports.defineAutoTests = function () {
// From Cordova-Android 10.x, app content is served from the "https" scheme by default
// The paramedic plugin changes the scheme to http to avoid ssl.
pathExpect = 'http://';
+ } else if (cordova.platformId === 'ios') {
+ pathExpect = 'app://';
} else if (isChrome) {
pathExpect = 'filesystem:http://';
}
@@ -3502,7 +3504,7 @@ exports.defineAutoTests = function () {
const fileName = 'native.resolve.uri';
// create a new file entry
createFile(fileName, function (entry) {
- resolveLocalFileSystemURL(entry.toURL(), function (entry) { // eslint-disable-line no-undef
+ resolveLocalFileSystemURL(entry.nativeURL, function (entry) { // eslint-disable-line no-undef
expect(entry.toNativeURL).toBeDefined();
expect(entry.name).toCanonicallyMatch(fileName);
expect(typeof entry.toNativeURL).toBe('function');
@@ -3512,7 +3514,7 @@ exports.defineAutoTests = function () {
expect(nativeURL.substring(nativeURL.length - fileName.length)).toEqual(fileName);
// cleanup
deleteEntry(fileName, done);
- }, failed.bind(null, done, 'resolveLocalFileSystemURL - Error resolving file URL: ' + entry.toURL()));
+ }, failed.bind(null, done, 'resolveLocalFileSystemURL - Error resolving file URL: ' + entry.nativeURL));
}, failed.bind(null, done, 'createFile - Error creating file: ' + fileName));
});
});
@@ -3553,7 +3555,10 @@ exports.defineAutoTests = function () {
});
});
- it('file.spec.121 should resolve native URLs returned by API', function (done) {
+ // TODO: .toNativeURL() / .toURL() were repurposed at some point so return a DOM-usable url
+ // these urls are not resolvable as they expect file:// or content://schemes
+ // I think these tests can simply be removed.
+ xit('file.spec.121 should resolve native URLs returned by API', function (done) {
const fileName = 'native.resolve.uri1';
// create a new file entry
createFile(fileName, function (entry) {
@@ -3566,7 +3571,10 @@ exports.defineAutoTests = function () {
}, failed.bind(null, done, 'createFile - Error creating file: ' + fileName));
});
- it('file.spec.122 should resolve native URLs returned by API with localhost', function (done) {
+ // TODO: .toNativeURL() / .toURL() were repurposed at some point so return a DOM-usable url
+ // these urls are not resolvable as they expect file:// or content://schemes
+ // I think these tests can simply be removed.
+ xit('file.spec.122 should resolve native URLs returned by API with localhost', function (done) {
const fileName = 'native.resolve.uri2';
// create a new file entry
createFile(fileName, function (entry) {
@@ -3580,7 +3588,10 @@ exports.defineAutoTests = function () {
}, failed.bind(null, done, 'createFile - Error creating file: ' + fileName));
});
- it('file.spec.123 should resolve native URLs returned by API with query string', function (done) {
+ // TODO: .toNativeURL() / .toURL() were repurposed at some point so return a DOM-usable url
+ // these urls are not resolvable as they expect file:// or content://schemes
+ // I think these tests can simply be removed.
+ xit('file.spec.123 should resolve native URLs returned by API with query string', function (done) {
const fileName = 'native.resolve.uri3';
// create a new file entry
createFile(fileName, function (entry) {
@@ -3594,7 +3605,10 @@ exports.defineAutoTests = function () {
}, failed.bind(null, done, 'createFile - Error creating file: ' + fileName));
});
- it('file.spec.124 should resolve native URLs returned by API with localhost and query string', function (done) {
+ // TODO: .toNativeURL() / .toURL() were repurposed at some point so return a DOM-usable url
+ // these urls are not resolvable as they expect file:// or content://schemes
+ // I think these tests can simply be removed.
+ xit('file.spec.124 should resolve native URLs returned by API with localhost and query string', function (done) {
const fileName = 'native.resolve.uri4';
// create a new file entry
createFile(fileName, function (entry) {
diff --git a/www/ios/Entry.js b/www/ios/Entry.js
new file mode 100644
index 00000000..03bcb264
--- /dev/null
+++ b/www/ios/Entry.js
@@ -0,0 +1,33 @@
+/*
+ *
+ * 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.
+ *
+*/
+
+module.exports = {
+ /**
+ * Return a URL that can be used to identify this entry.
+ * Use a URL that can be used to as the src attribute of a