How do you get files used with "Open With" on Mac in Java?

I've compiled my Java program into the Mac's .app format using the javapackager command. How do I get the files that a user will open my program with using the system's "Open With" context menu command?

For example, if I had a file MyFile.txt on the desktop and I right clicked and opened it with my program, how do I access MyFile.txt?