crazyme207
Programmer
I have written the following code:
-------------------------------
----------------------------------
my policyfile has the following entry"
notice, secThread does not have permission to write to anyfile
---------------------------------
when i run mainProg, using the default security manager and the policyfile above, i do not get an exception. However, I think I should because secThread is writing to a file, but it does not have java.io.FilePermission, "write" to write to any file!
Can someone please help me out here?
I am using JDK1.3
Thanks
SG
Code:
//this is saved in /home/myname/main/second/
package second;
public class secThread extends Thread{
public void run(){
FileWriter fw = new FileWriter("file.txt");
fw.close;
}
}
Code:
//this is saved in /home/myname/main/
import second.secThread;
public class mainProg{
public static void main(String args[]) {
secThread st = new secThread();
st.start();
}
}
my policyfile has the following entry"
Code:
grant codeBase "file:/home/myname/main/*"
permission java.io.FilePermission "<<ALL FILES>>";
};
---------------------------------
when i run mainProg, using the default security manager and the policyfile above, i do not get an exception. However, I think I should because secThread is writing to a file, but it does not have java.io.FilePermission, "write" to write to any file!
Can someone please help me out here?
I am using JDK1.3
Thanks
SG