You can not. That would impose a security risk. There is only one folder you have access to on the server where you can put temp files and you can retrieve the path in java with:
Core.getConfiguration().getTempPath()
Do note that you have to clean this directory yourself. Mendix does not do that.
Regards,
Ronald