File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes does anyone use the .java.policy file? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "does anyone use the .java.policy file?" Watch "does anyone use the .java.policy file?" New topic
Author

does anyone use the .java.policy file?

Norm Radder
Ranch Hand

Joined: Aug 10, 2005
Posts: 685
Hi,
Am I the only one using .java.policy file to allow an applet to read files on my local disks? I'm able to have an applet in Firefox read/write a file, but in IE7 it fails.

Any recommendations on how to debug/trace it so I can get it to work?

Thanks,
Norm
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41603
    
  55
The first step would be to make sure that the policy file that contains your modifications is being used at all. Maybe create a new Permission class, require that in the applet, but don't add it to the file. Then the applet should fail.

Or comment out some of the permissions that were in the file before, and make sure that the applet fails where those are required.

Once you know the file is being used you can work on the individual permission you actually want to add. I seem to recall seeing a discussion recently that implied different browsers didn't recognize quite the same policy file syntax (which doesn't make much sense, as it's the JVM doing the interpreting, but it was being claimed).


Ping & DNS - my free Android networking tools app
Norm Radder
Ranch Hand

Joined: Aug 10, 2005
Posts: 685
Thanks for the response.
I've asked questions on this problem from several points of view. You probably saw some of them.
The .java.policy file has been working for years with some browsers. It works for IE7 if the file to be writtten is fully referenced, but not with the - or * wildcard.
It seems that IE7 must have a different Security Manager.

The only techniques I've seen are what I call the shotgun method, try every possible combination until you find the one that works. No way to trace the Security manager to see what it needs or what it doesn't like.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: does anyone use the .java.policy file?