How to grant java permission objects?

R

Rach

Hi,

I understand that to grant a permission, one has to have a policy file and
attach the policy file either in command prompt:
e.g. java -Djava.security.policy=file.policy classtoinvoke

or in the java file:
System.setProperty("java.security.policy",
getClass().getResource("/file.policy").toString());

Can I grant a policy without a policy file? I mean, I want to hardcode the
permissions and grant them in the java class file. I know I can create
permission objects in java, but how do I grant these objects?

Thanks in advance,
-rach
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top