aspose file tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Policy File Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Developer Certification (SCJD/OCMJD)
Reply Bookmark "Policy File" Watch "Policy File" New topic
Author

Policy File

Rudy Yeung
Ranch Hand

Joined: Dec 27, 2000
Posts: 183
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
I was wondering the same thing......anyone?
Joe
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
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
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
They will be using unix i think.
Joe
Cleland Early
Ranch Hand

Joined: Apr 16, 2001
Posts: 38

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
You use the following symbol : ${/}
to represent system independent file separators .
 
 
subject: Policy File
 
Threads others viewed
no security manager rmi class loader disabled
Security Exception After Moving RMI Server Jar
struts file upload problem
file read/write permissions
RMI Example
MyEclipse, The Clear Choice

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture