I would like to hear some of you about the policy file configuration. Without complicating my testing on RMI, I currently grant all permission to accessing to remote resources.
J Hartley
Ranch Hand
Joined: Mar 29, 2001
Posts: 52
posted
0
I was wondering the same thing......anyone? Joe
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
Taken explicitly from The Java Tutorial: Here is a general policy file that allows downloaded code, from any code base, to do two things: Connect to or accept connections on unprivileged ports (ports greater than 1024) on any host Connect to port 80 (the port for HTTP) Here is the code for the general policy file: grant { permission java.net.SocketPermission "*:1024-65535", "connect,accept"; permission java.net.SocketPermission "*:80", "connect"; }; If you make your code available for downloading via HTTP URLs, you should use the preceding policy file when you run this example. However, if you use file URLs instead, you can use the following policy file. Note that in Windows-style file names, the backslash character needs to be represented by two backslash characters in the policy file. grant { permission java.net.SocketPermission "*:1024-65535", "connect,accept"; permission java.io.FilePermission "c:\\home\\ann\\public_html\\classes\\-", "read"; permission java.io.FilePermission "c:\\home\\jones\\public_html\\classes\\-", "read"; };
Cleland Early
Ranch Hand
Joined: Apr 16, 2001
Posts: 38
posted
0
According to the instructions, you can't require the examiner to edit any files. Under those restrictions, I'm not sure how you could use the second example you provide. Whatever you send with your submission needs to work no matter which platform the examiner uses or where the examiner installs the files.
J Hartley
Ranch Hand
Joined: Mar 29, 2001
Posts: 52
posted
0
They will be using unix i think. Joe
Cleland Early
Ranch Hand
Joined: Apr 16, 2001
Posts: 38
posted
0
Solaris, more than likely, but I don't think you can make any assumptions about the platform in your code or in any related files.
This whole policy file deal strikes me as extremely counter-intuitive. Let me get this: you create a policy file on the client end to grant access to resources stored on the server.
aleks nikolic
Greenhorn
Joined: Mar 04, 2001
Posts: 25
posted
0
You use the following symbol : ${/} to represent system independent file separators .