Possible Duplicate:
Capturing stdout when calling Runtime.exec
Ok so,
I am developing an Eclipse plugin that generates some PHP code based a visual interface (i.e. the user drags and drops some stuff on a View and then my plugin will update some php files with the code associated)
I am creating the php files with FileUtils (Apache Commons) and I am generating the PHP code using an ASTParser.
My problem is that I need my freshly generated code to be beautified and nicely indented. I have googled around and found this http://www.waterproof.fr/products/phpCodeBeautifier/ . It comes as a .exe file. I have added it to resources but I'm having some trouble calling it and getting the output from it.
How can I do this? Also I have to say that I need it to work on both a Mac and a Windows machine. Can this be done? Is there an easier way to beautify the code?
Thanks!