All calls trying to access local files fail with the following exception:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
com.apple.mrj.JManager.JMAppletSecurityExc: security.file.read:
/MacHD1/Temporary Items/TrapMarshallLib
at
com.apple.mrj.JManager.JMAppletSecurityOld.checkRead(JMAppletSecurityOld.jav
a)
at
com.apple.mrj.JManager.JMAppletSecurityOld.checkRead(JMAppletSecurityOld.jav
a)
at java.io.File.exists(File.java)
at
client.common.java.NativeInterface.winInstallFile(NativeInterface.java:505)
at
client.common.java.NativeInterface.macInstall(NativeInterface.java:453)
at
client.common.java.LoadNativeModulesThread.run(LoadNativeModulesThread.java:
28)
at java.lang.Thread.run(Thread.java)
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
It doesn't fail on Windows...
How can I get this to work? There's no other way, I need access to local
files.
I've found a similar solution for Windows which involves playing with
com.ms.security package (which is not available on the mac).
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
try{
if (Class.forName("com.ms.security.PolicyEngine") != null)
{
PolicyEngine.assertPermission(PermissionID.FILEIO);
PolicyEngine.assertPermission(PermissionID.USERFILEIO);
}
}
catch (Throwable cnfe)
{
throw new IOException(cnfe.toString()) ;
}
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Given that it is com.apple.mrj.JManager that throws that exception, I then
searched for solutions in the MRJ to bypass that security check. I did find
something close enough
(http://developer.apple.com/techpubs/java/MacOSandJava/JManager/JManager2.1/
JManager.57.html), but it seems to be more for applications that want to
create applet environments (through C) than for applets to wide their file
access.
Can anyone help me on this issue.
Thanks.
_______________________________
Philippe Roy
pr...@deltagreen.com