Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

A Java problem is my problem.... ;0)  RSS feed

 
Cristian Negresco
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Is it my problem or Java's problem?
In Java2 1.3 and 1.4 I couldn't find any method that make a file writable.
There is a setReadOnly() method but no method that could get me out of this state. It doesn't seem very OO to me.
Did I miss something?

BR,
Cristian
 
Sam Moran
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
setReadOnly() --
Marks the file or directory named by this abstract pathname so that only read operations are allowed. After invoking this method the file or directory is guaranteed not to change until it is either deleted or marked to allow write access. Whether or not a read-only file or directory may be deleted depends upon the underlying system.
Returns:
true if and only if the operation succeeded; false otherwise
So, based on thye information above if you set it and want to revert back, you have to delete the file.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!