Use a cordovaFile in a function

I downloaded a file using $cordovaFileTransfer.download(). I checked the existance of the file using $cordovaFile.checkFile and everything looks ok.

Then I wanted to use that file in one of my functions. I tested the function before and it was working fine, but the file was just placed in the js folder.

Now that file is in the cordova.file.externalDataDirectory, the function is like it does not recognise it, or it fails to load it.

I define the file path as: var icalFile = cordova.file.externalDataDirectory + $localStorage.iCalFileName;

if I do console.log(iCalFile) I get file:///storage/emulated/0/Android/data/com.myapp.menu/files/5kFYk.ics

But the function do not like it…
Any Ideas?