|
| |||||||||
| Tags: file, java, policy, programming |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| ||||
| ||||
| Creating a New Policy File in java
Hello, I am learning java programming language and while learning it, I am not able to get the solution for the creating the New Policy File. If anyone from you know how to create a Policy File with the help of java programming language then please help me to achieve it. I will be thankful to you. |
|
#2
| ||||
| ||||
| Re: Creating a New Policy File in java
Hello, I have got the code below for creating a new policy file in java: Code: > policytool -file .policy
keystore ".keystore";
grant signedBy "TA"
{
permission java.io.FilePermission "${user.dir}/-", "read";
};
grant codeBase "http://Techarena.in/myjar.jar"
{
permission java.util.PropertyPermission "file.encoding", "read";
} |
|
#3
| ||||
| ||||
| Re: Creating a New Policy File in java
To create a new policy file, start by simply selecting the New command from the File menu. This will close the currently open policy file and bring up a new policy tool window, that is, a window with headings and buttons but no data in it. Please Note: this is not necessary the first time you run the Policy Tool. Since the tool tries to open the user policy file and one doesn't exist yet (unless it was created manually), the tool will bring up a window without any data in it. Once you have a new policy tool window, you can then create the policy entries, and specify the keystore. At any point, you can save the policy file. |
|
#4
| ||||
| ||||
| Re: Creating a New Policy File in java
Hello, for creating a policy file you need to make use of the following Symbol in java:
|
|
#5
| ||||
| ||||
| Re: Creating a New Policy File in java
Hey, I have got one code in java which will help you to create a new policy file in java. So, just make use of it and get information about it: Code: grant
{
permission java.util.PropertyPermission "java.version", "read";
}
grant signedBy "me", codeBase "http://forums.techarena.in/"
{
permission java.io.FilePermission "${/}tmp${/}-", "read, write, delete";
permission XYZPayrollPermission "*", "read, write";
}
grant codeBase "http://www.techarena.in"
{
permission java.io.FilePermission "${/}tmp${/}-", "read";
permission java.io.FilePermission "${/}tmp${/}-","read, write, delete", signedBy "me";
} |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Creating a New Policy File in java" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Creating a counter in java | Beverly Archer | Software Development | 5 | 10-03-2010 01:49 PM |
| Creating a Bar Graph In Java | Aakarshan.d | Software Development | 4 | 05-03-2010 12:10 PM |
| Creating a Custom Event in Java | Jagdish Gada | Software Development | 5 | 16-02-2010 08:16 PM |
| Creating an operating system (OS) in Java | Shaan12 | Software Development | 3 | 30-10-2009 12:51 AM |
| Creating Tables in Java | RockOn | Software Development | 3 | 09-04-2009 11:57 PM |