File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes file read/write permissions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "file read/write permissions" Watch "file read/write permissions" New topic

file read/write permissions

John Mack

Joined: Jan 17, 2002
Posts: 2
Hi, my question is:
In the server (or client) security policy file, do you have to give the db.db file a setting?
I pass the location (as a full pathname) of the db.db file on the command line so that I can create a Data object. If I don't specify the full pathname of this file in the security policy file I get a ' access denied ('
The problem is that the specification states 'allow the user to specify the location of the database', so if they move the database, the location will differ from the location in the policy file, and this exception will occur. Is there any way of setting policy file attributes after starting the program, or is there another way of making sure there is access to the file, wherever it is, without using 'permission' which I don't think is a good idea.
please advise!
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

I just put one permission in my policy file that gave full access to everything.
grant {
permission "", "";

I didn't lose points for it.

Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
John Mack

Joined: Jan 17, 2002
Posts: 2
Hi Mark,
thanks for your reply. I have got a policy file now that basically allows all access to the files below the current user directory. But,if it goes pear-shaped it's good to know I can use the simple permission and not lose marks.
I agree. Here's the link:
subject: file read/write permissions
It's not a secret anymore!