If you execute your program as an applet, you will have to give the applet permission to write to and read from the local PC's disk.