Java Web Start Application can read files from local systems, but not write [closed]

青春壹個敷衍的年華 提交于 2019-12-06 10:02:53

Can you try creating the file, before using it?.

temp[1].createNewFile()

This will create the file only if it doesn't exist. You can use return boolean flag to find out if the file already exists. This method will also throw an IOException if the security manager denies the create request.

EDIT:

According to java.io.FileWriter, file creation depends upon the underlying platform. Since you are able to read the file if it exists and only having problem with creating a new file in a JNLP app. I suggested creating a new file using createNewFile instead of relying on FileWriter to create the file.

From java.io.FileWriter javadoc:

Whether or not a file is available or may be created depends upon the underlying platform.

Sorry guys, I was an idiot. My jnlp file pointed to a different version of my java program in my local system and basically I'm an idiot. When I went home, I tested the website from my home pc and found my error.

Thanks so much for your help though!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!