Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Creating a New Policy File in java

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 18-02-2010
Member
 
Join Date: Nov 2009
Posts: 680
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.

Reply With Quote
  #2  
Old 18-02-2010
Member
 
Join Date: Apr 2008
Posts: 2,000
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"; 
}
Reply With Quote
  #3  
Old 18-02-2010
Member
 
Join Date: May 2008
Posts: 2,291
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.
Reply With Quote
  #4  
Old 18-02-2010
Member
 
Join Date: Oct 2005
Posts: 2,389
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:
  • file:${application}
  • file:${jars}
  • file:${ejbComponent}
  • file:${webComponent}
  • file:${connectorComponent}
Reply With Quote
  #5  
Old 18-02-2010
Member
 
Join Date: May 2008
Posts: 2,383
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";
}
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


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 an Internal Frame in java samualres Software Development 4 24-02-2010 10:46 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


All times are GMT +5.5. The time now is 05:56 AM.