Building a hex uploader

Hi So has anyone taken apart the IDE sourcecode to make a java hex uploader - standalone - or even looked at the code? I program my AVR currently using AVR ISP MKII, and I am making a circuit for a simple midi controller. I am going to publish my circuit on the web along with code, but I want the circuit to include the ability to upgrade the firmware on the mega2560 if people want to use other peoples code - but I want the toption to be there for people who dont want to get down and dirty with source code. My plan is to build a simple app that just replicates SHIFT clicking the upload button - I can build a simple programmer into the circuit (I dont want to use a bootloader). Has anyone gone near this? I know how to program Java, I just havent got experience in how one might upload hex? Any thoughts?

I believe the IDE uses avrdude to actually upload the image to the board. So, you should be able to use avrdude directly (assuming you have a hex file). You will need to figure out all of the options the IDE passes to avrdude, but you can turn on verbose messages in the IDE, it will show you the options.

Take a look at NickGammon's work here too on loading from SD card.