You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Renato Weiner <re...@yahoo.com> on 2001/05/16 14:49:37 UTC
Overriding SecurityManager
This is what I'm trying to do.
I already wrote a very simple class that overrides the default SecurityManager. Here is a piece of the code:
....
public void checkRead(String fileName) {
if (!fileName.equals("") && fileName.endsWith(".txt")) {
throw new SecurityException("Fail to read: " + fileName);
}
super.checkRead(fileName);
}
....
Now, what I want to do is to determine what is the URL/jsp/servlet that is trying to read this file.
I want to customize the security settings based on the location of the script in my web server. ( Does java.policy can do this using codeBase ? )
Does Java have some API to do this ?
Thanks in advance
Renato - Brazil.
---------------------------------
Do You Yahoo!?
Yahoo! Auctions $2 Million Sweepstakes - Got something to sell?