Loading external data


I would like to load external data inside a NodeModel at runtime.
I imported this file into eclipse and the file appears in the root directory
of my current project.

How do I get the path to this file at runtime ????

Greetings, Uwe

Hi Uwe,

not exactly sure what you try to accomplish. If it's "just" figuring out where the workspace location is, you may want to have a look at the class KNIMEPath and CorePlugin (both contained in the org.knime.core plugin).

You won't be able to use either of both (as we hide these classes to downstream plugins) but it may be worthwhile seeing how we solve the problem in there. The CorePlugin class (in general the NodePlugin class that comes with each of the plugins) allows one to access eclipse internals, for instance the workspace dir.

Hope it helps. If not or you are not able to locate the classes, please let us know.


Hi, I found it myself:

URL u = XXNodePlugin.getDefault().getBundle().getEntry("/");
File rf = new File(Platform.asLocalURL(u).getPath()+"/config/config.dat");

works for me.

Greetings, Uwe