When programming in Eclipse you sometimes must use plain Java based libraries. These libraries handle files using
java.io.File. When you work in Eclipse you reference files in the workspace using
org.eclipse.core.resources.IFile. So in this case I needed to convert between the two formats.
First attempt, WRONG!My first attempt was to use
f.getFullPath().toFile()and that worked! Because I tested all my code with small data sets in the workspace, it wasn't until later that I found out, this does not work with linked resources:
java.io.FileNotFoundException: /Remote-Data/eulumdat/data.file (No such file or directory)
at java.io.FileInputStream.open(Native Method)
Second attempt: the proper wayMy went back to the offending code and used CTRL+SPACE again. Now I selected
f.getLocation().toFile()and that did it!
ConclusionIn order to get your code working in all circumstances, you need to test with both resources in the workspace and outside.
I'm i good company though, as there are 64 open bugs in the Eclipse bugzilla about linked resources.
Also I suspect code that doesn't work with linked resources, will not work with the remote system explorer, like this one.