Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MRJ on Mac IE 5 java implementation of java.io.File.FileExist fails

0 views
Skip to first unread message

Philippe Roy (proy@deltagreen.com)

unread,
Feb 14, 2001, 2:28:46 PM2/14/01
to
I have an applet that is signed and the site is trusted under Mac IE 5
(security zones pane - added all servers involved) which is as loose as
possible for privileges (under trusted sites zone menu, choose 'custom' and
made it as loose as possible).

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

http://www.deltagreen.com/proy

Mickey Segal

unread,
Feb 14, 2001, 4:55:38 PM2/14/01
to
A signed applet can definitely read and write files on Macintosh IE 5 / MRJ
2.2.x. It sounds like you are probably familiar with the material at:
http://developer.apple.com/technotes/tn/tn1175.html
and that you are able to do other things that only a signed applet can do
(except getting rid of the applet window warning, which doesn't work on
Macintosh IE 5). So the best thing to do is to ask this at the Apple Java-Dev
group:
http://www.lists.apple.com/mailman/listinfo/java-dev


0 new messages