Macro_Runner.java runMacroFromJar(String name) adds an extra "/" to the name, bug?
Posted by Markus Sutter on Jul 26, 2010; 2:31pm
URL: http://imagej.273.s1.nabble.com/Macro-Runner-java-runMacroFromJar-String-name-adds-an-extra-to-the-name-bug-tp3687452.html
Hello everybody,
I want to load and run a macro file in my plugin. The macro file is
located in the same jar with the plugin, therefore I use Macro_Runner
to load and run it.
I specified the name of the macro file like "JAR:macros/macro.ijm",
but runMacroFromJar adds a / and so the macro is not found.
What's the correct way to load a macro from a jar or is this just a
bug in the method runMacroFromJar(String name) in class Macro_Runner
on line 48:
InputStream is = pcl.getResourceAsStream("/" + name); may should look like
InputStream is = pcl.getResourceAsStream(name)
Kind regards
Markus