I am working on project which needs setting of the project to be saved and when the program starts it should read the file from the settings.
In windows I dont have permission to make the file where-ever I want. I dont want to make in the temp folder as it can be deleted after some time. Any idea where should i place the file ?
I am working on project which needs setting of the project to be saved
Share
You can take a look at the following:
http://www.mindspring.com/~mgrand/java-system-properties.htm
Of these, I have seen the following being used:
being used for temporary files. However, I would assume that user.dir would be safest to use, while user.home would be the most commonplace.
EDIT: It seems the common practice is to use user.home for files that will be reused by your app, when starting and restarting, while user.dir is more commonly used for temporary files.
So, I reccommend using:
As your java will have the permissions to read and write there, so you can never go wrong.