I didn't say its interesting
I said my main interest, or what I'm interested in knowing... or i have to know!!
You see its an RMI program, the server is a compute engine that performs Task computation for clients, and so if we want to find two very large prime numbers, we often cant use the regular computers since they aren't powerful enough! So we make a powerful machine do the work for us and send the results back...
I'm using the default Java.policy in my user directory, just editing that one.. and no i didnt change the default one at all other than the few statements i quoted in my first post...
One of the tasks which originates from the client directory attempts to access the file system, and since I only gave the codebase in that directory to access the network, i thought it should have failed accessing anything else! (i.e. the file system!)
Here is the client code
<blockquote>
code:
<pre name="code" class="core">
package client;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import compute.Compute;
import java.io.*;
public class ComputeFile {
public static void main(String args[]) {
if (System.getSecurityManager() == null) {
System.setSecurityManager(new SecurityManager());
}
try {
String name = "Compute";
Registry registry = LocateRegistry.getRegistry(args[0]);
Compute comp = (Compute) registry.lookup(name);
File1 task = new File1();
File f = comp.executeTask(task);
System.out.println(f);
} catch (Exception e) {
System.err.println("ComputeFile exception:");
e.printStackTrace();
}
}
}
</pre>
</blockquote>
The class File1 is simply a normal class that attempts to read the file system system using FileInputStream class...
Thanks for your patience
HannaH