Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Policy file in a Jar
Is there way to specify a policy file in a jar?  I've tired different
url for this and can't seem to get it to work.

For example:

jar:file:c:\test.jar!\policy.file

doesn't work

Report this thread to moderator Post Follow-up to this message
Old Post
James Poli
10-14-04 01:57 AM


Re: Policy file in a Jar
James Poli <James.Poli@sas.com> wrote:

>Is there way to specify a policy file in a jar?  I've tired different
>url for this and can't seem to get it to work.
>
>For example:
>
>jar:file:c:\test.jar!\policy.file
>
>doesn't work

I've received (by email) the following answer to the same question a
while ago :

It is possible to include a policy file within a jar, and the
ClassLoader provides an elegant way to access it. Assuming a client
policy file with the name client.policy in a subdirectory of the jar
called "other" it is possible to obtain a URL to the policy by doing
the following:

ClassLoader cl = getClass().getClassLoader(); URL policyURL =
cl.getResource("other/client.policy");

then set the policy by doing:

System.setProperty("java.security.policy",policyURL.toString());

and finally set the security manager:

System.setSecurityManager(new RMISecurityManager());




Report this thread to moderator Post Follow-up to this message
Old Post
Remi Bastide
10-14-04 09:00 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Java Security archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:00 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.