File Path - file:///data/data/io.ionic.starter/data.json
I wish to check if 'data.json' exists in the mentioned path.
But I recieve an error - {"code":1,"message":"NOT_FOUND_ERR"}
Currently the file isn't present in the path so I am expecting the Promise<> to return false, but it ends up throwing an error.
Sample code:
var fileName = "data.json";
this.file.checkFile(this.file.applicationStorageDirectory, fileName)
.then((result) => {
console.log('file exists :' + result);
},(error){
console.log('error : ' + JSON.stringify(error)});