scijava/scijava-plugins-commands

Refactor OpenFile to use FileLocation

Closed this issue · 6 comments

Currently OpenFile uses file.getAbsolutePath and passes the string result to the IOService.

Instead we should be wrapping the File in a Location and passing that.

Success for this issue is that ExecuteCommands works with the latest pom-scijava (and development version of scijava-plugins-commands, if not other libraries as well).

However, I suspect this change as-written will not be sufficient as the SCIFIO TestImgFormat only operates on TestImgLocations.

So we will probably also want to create an OpenLocation command that takes a Location instead of a File and then update ExecuteCommands to just create and pass it a TestImgLocation.

@hinerm I do not think the issue with ExecuteCommands is relevant to this issue here. The problem there is with changes to SCIFIO's .fake file logic. The fix will not happen in this repository.

@ctrueden This issue is for ecmagnusson, who I want to test the ExecuteCommands with a dev version of this repo. It may result in new commands in this repo as I mentioned above.

I also think creating an OpenLocation command is not useful, because Location parameters cannot be harvested by the input harvester, and so this command appearing in the menus is not usable for users.

OK, well I leave it to you then, but I think my fix was the correct one with respect to the issue described above.

Closing in favor of imagej/tutorials#101