It's not a secret anymore!*
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 Murach's Java Servlets and JSP this week in the Servlets 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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How can I examine or change file permissions using Java?
 
Similar Threads
delete content of file from java
Where can i see the java file of a container converted JSP file in weblogic
Sorting XML nodes?
How to Delete a Directory
Connecting to Unix via Windows