Results 1 to 5 of 5

Thread: Creating a New Policy File in java

  1. #1
    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.

  2. #2
    Join Date
    Apr 2008
    Posts
    2,010

    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. #3
    Join Date
    May 2008
    Posts
    2,302

    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. #4
    Join Date
    Oct 2005
    Posts
    2,394

    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}

  5. #5
    Join Date
    May 2008
    Posts
    2,393

    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";
    }

Similar Threads

  1. Creating a counter in java
    By Beverly Archer in forum Software Development
    Replies: 5
    Last Post: 10-03-2010, 12:49 PM
  2. Creating a Bar Graph In Java
    By Aakarshan.d in forum Software Development
    Replies: 4
    Last Post: 05-03-2010, 11:10 AM
  3. Creating an Internal Frame in java
    By samualres in forum Software Development
    Replies: 4
    Last Post: 24-02-2010, 09:46 PM
  4. Creating an operating system (OS) in Java
    By Shaan12 in forum Software Development
    Replies: 3
    Last Post: 29-10-2009, 11:51 PM
  5. Creating Tables in Java
    By RockOn in forum Software Development
    Replies: 3
    Last Post: 09-04-2009, 10:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •