This content has been marked as final. Show 1 reply
First of all, you shouldn't check script't extension with .contains() method. I guess in this case "script.py" and "call.pyre.exe" could be both interpreted as Python scripts. Use rather String.endsWith() method.
The second thing is that if your application is going to be so generic that its re-compilations and updates will get you in trouble, simply force specifying script interpreters together with script names. For example, change implementation from guessing what should be called with "script.py" to plain invoking of "python script.py".
Another way will be probably dealing with the properties files, explained here: http://docs.oracle.com/javase/tutorial/essential/environment/properties.html
In these properties files you could store all your supported interpreters against script extensions, like "python=.py", etc.
Edited by: 1000031 on Apr 15, 2013 11:13 AM