genericworkflownodes / GenericKnimeNodes

Base package for GenericKnimeNodes
https://github.com/genericworkflownodes/GenericKnimeNodes
Other
15 stars 16 forks source link

Output Folder node: add option to create folder if not existing #155

Open timosachsenberg opened 7 years ago

jpfeuffer commented 7 years ago

I also find this very useful. I would like to see a Folder chooser dialog with Variable option for a base folder. And a folder name text box. Like the Create Folder node of KNIME.

jpfeuffer commented 7 years ago

And would be nice if it accepted folders with and without the file:// prefix

AlexanderFillbrunn commented 5 years ago

I opened PR #235 to address this issue. However, I only added a checkbox. I don't know if changing the node to behave like the Create Folder node of KNIME makes sense. That node explicitly has the task to create the folder, which is not the case here. If you want to create a folder using a variable, you could just use the KNIME Create Folder beforehand and pass the whole folder path to the Output Folder node using a variable.

@jpfeuffer The file:// prefix seems to work for me. Do you have an example were it does not? Then I can fix that in the PR as well.

jpfeuffer commented 5 years ago

I'll recheck the prefix thing.

jpfeuffer commented 5 years ago

I think I meant passing a URI from a Workflow variable to the Output Folder settings. If we would resolve the URI to a Path in the Node, you would not need to do nasty String Manipulations all the time. I think that would also allow to give knime: URLs to the Output nodes.

AlexanderFillbrunn commented 5 years ago

Unless I misunderstand you, this already works (on branch "develop"). In the screenshot below the path passed as a variable to the output folder is "knime://knime.workflow/data".

bildschirmfoto 2019-01-10 um 10 31 45

jpfeuffer commented 5 years ago

And does it go into the right directory? For me I think it goes somewhere under the KNIME Application folder.

AlexanderFillbrunn commented 5 years ago

It does go into the right directory.

AlexanderFillbrunn commented 5 years ago

I added a commit to the PR that adds an option to overwrite existing files (by default it is off). Additionally I moved the file checks before the loop that copies the files, so that when one file cannot be copied, none will be.

jpfeuffer commented 5 years ago

Ok true. Maybe I fixed it recently. But what I forgot is to change the Views of the Output nodes. They do not open the underlying folders correctly (right click - open folder) because they use the plain entry and do not use FileUtil.getFileFromURL(FileUtil.toURL(folder_name)). Can you fix that quickly in the PR?

AlexanderFillbrunn commented 5 years ago

@jpfeuffer I pushed another commit with the proposed change.

AlexanderFillbrunn commented 5 years ago

More changes packed into this PR:

AlexanderFillbrunn commented 5 years ago

The attached file is a workflow demonstrating all the changes made in this PR (except for the views).

File Outputs.zip