[Filesystem] Fixing file filter
[Bug]
1. FileFilter name was not matching '%' wildcard on the beginning of filename
2. wildcard escaping need to be done by using '\\%' not '\%' - proper comment
added in code to ease future investigations.
[Verification] Code compiles successfully.
TCT passrate is 100%.
Below code:
var filter = "piotr\\%kosko%";
function onsuccess(files) {
console.log("There are " + files.length + " in the selected folder");
for (var i =0; i < files.length; ++i) { console.log(files[i].name) }
}
function onerror(error) {
console.log("The error " + error.message +
" occurred when listing the files in the selected folder");
}
tizen.filesystem.resolve("documents", function(dir) {
dir.listFiles(onsuccess, onerror, {name: filter});
}, function(e) { console.log("Error " + e.message);}, "r");
for filter "piotr\\%kosko%" filters file:
piotr%koskoTest
for filter "%kosko%" filter files:
piotrkoskoTest
piotrkosko
piotrTestkoskoTest
kosko
piotr%koskoTest
piotr%kosko
Change-Id: If7e6c3c3ad97a3d01a800916ba73c5f7749ae0cb
Signed-off-by: Piotr Kosko <p.kosko@samsung.com>