Can I make a file uneditable?

Hi there!!In fact my java app creates a config file on the client's machine and I want that after the file's creation the client or any user can't edit the file,,,is it possible some way?Thanks...
[220 byte] By [Kami_Pakistana] at [2007-11-27 9:14:09]
# 1
no.But you can do this on os level, taking off privileges and permissions of your user.
pbulgarellia at 2007-7-12 22:02:08 > top of Java-index,Core,Core APIs...
# 2
Thanks,,I wanted to do it through Java code......
Kami_Pakistana at 2007-7-12 22:02:08 > top of Java-index,Core,Core APIs...
# 3

use the

setReadOnly()

method on the File class. (since java 1.2)

It doesn't stop people from modifying the file but makes it likely that thy won't accidentaly modify it. They have to deliberately change the file permissions. (Note this is platform dependent. On some OS's it may have no effect whatsoever)

matfud

matfuda at 2007-7-12 22:02:08 > top of Java-index,Core,Core APIs...