aspose file tools*
The moose likes I/O and Streams and the fly likes How can I examine or change file permissions using Java? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "How can I examine or change file permissions using Java?" Watch "How can I examine or change file permissions using Java?" New topic
Author

How can I examine or change file permissions using Java?

Prakash Dwivedi
Ranch Hand

Joined: Sep 28, 2002
Posts: 452
I have to write in a file which is sometimes read-only, can i make it writable using java?


Thanks


Prakash Dwivedi (SCJP2, SCWCD, SCBCD)
"Failure is not when you fall down, Its only when you don't get up again"
Prashant Sehgal
Ranch Hand

Joined: Jun 20, 2003
Posts: 56
No using java API.

You can do this:



Call this method with the path of the file.

But even for this to run you need to be the owner of the file.

Regards,
Prashant.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How can I examine or change file permissions using Java?