find the internDir path

I would like to save files which are generated by my node in the directory "internDir" of the node (KnimePath/WorkflowProjectPath/Decision Tree Learner (#69) for instance).

I can do this in the saveInternals method because this path is in its parameters, but I do not have this path in the execute method, someone know how I could get it ?

 

Otherwise, I would like to know if it is possible to change the value of the output of the node (a BufferedDataTable) after its execution, in the saveInternals method for instance.

The counterpart of saveInternals is loadInternals. What prevents you from using this method? You could remember the path that is passed to loadInternals in your node model and then use it in execute, but this doesn't sound like a good design.

Also you cannot change the output of a node after execution.

The loadInternals method is called only when the node has been executed and saved once. So this will not work before the first execution and save.

My objective is to delete all the files which are generated by my node when the user delete the node.

Files in the "internals"-directory are automatically deleted when the node is removed from the workflow.

This is why I want to put my files in this directory (in the execute method).

Yes, but what files are you creating during execute that are still needed later on? If it's only temporary files, then some methods from org.knime.core.util.FileUtil may be of interest. If it's data that you want to show in a view then it needs to be stored in-memory and only written to disk/read from disk in save/loadInternals.

During execute, I want to create a file and put the path of this file into the output of the node (a BufferedDataTable with only one String cell).

If this file will be a temporary file, when Knime restart, the path in the output will not be good because the temporary file will have been deleted. Even if I will save (copy in the internDir directory) the file in the saveInternals method, the absolute path which has been put into the output of the node (during the execute method) will be wrong.