Making a file writable

Hi,I see class java.io.File has a public method setReadOnly(): boolean. But I don't see a reverse method, i.e something like setWritable().Is there a way to make a file writable, without resorting to JNI?I am using JDK 5.0Thank you
[267 byte] By [cristiba] at [2007-11-27 4:06:40]
# 1
err, setReadOnly(false)?
ejpa at 2007-7-12 9:11:49 > top of Java-index,Core,Core APIs...
# 2
> err, setReadOnly(false)?Yes, this is what I need. But setReadOnly() doesn't take a boolean argument.:( Any workaround?Thank you
cristiba at 2007-7-12 9:11:49 > top of Java-index,Core,Core APIs...
# 3

> Yes, this is what I need. But setReadOnly() doesn't

> take a boolean argument.:( Any workaround?

>

> Thank you

Install Java 1.6: there are numerous enhancements in the File class concerning permissions:

http://java.sun.com/javase/6/docs/api/java/io/File.html

prometheuzza at 2007-7-12 9:11:49 > top of Java-index,Core,Core APIs...
# 4
That's nice...But I'm bound to JDK 5.0. Can't use 6.0 in this project.Maybe File class is the wrong place to look for such a thing in 5.0.Doesn't at least NIO provide such a utility?Thanks.
cristiba at 2007-7-12 9:11:49 > top of Java-index,Core,Core APIs...
# 5
Hi,By using JDK 5.0, we can not give write access to a file. It is possible in JDK 6.0. In case if you want to do it with JDK 5.0 itself, use the DOS command with Runtime, your problem will solve.What will you say ?
mahesh.komuravellia at 2007-7-12 9:11:49 > top of Java-index,Core,Core APIs...