how to set a file to read only using java
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   mark_webb
Posted On:   Wednesday, May 16, 2001 06:05 AM

I know you can do this using the File.setReadOnly method. But can someone please post a sample policy file that will allow me to do this. I am having trouble setting files that my JVM creates to read only.

thank you.

Re: how to set a file to read only using java

Posted By:   Tim_Rohaly  
Posted On:   Wednesday, May 16, 2001 08:49 AM

Java, of course, gives you no way to bypass the inherent
permission scheme built into your operating system.
You can't give yourself superuser privilege simply by
creating an appropriate policy file - that would be an
unforgivable security hole. File.setReadOnly()
will work only if your user/program has the appropriate permission
from the operating system to change the permission
on that specific file. If you want it to work, log in as
a user who does have permission and run your program
again.
About | Sitemap | Contact