Code Comments
Programming Forum and web based access to our favorite programming groups.I have an idea how the AccessController class is supposed to be used, but I have not written much code that needs to worry about security and I want to be sure on this. Typically, I would have just used the System.getProperty() method to get the value of a System property, but I recently came across some code that used doPrivileged() with a GetPropertyAction to get the "line.separator" system property: String separator = (String) AccessController.doPrivileged( new GetPropertyAction( "line.separator" ) ); As I understand it, this would make sense if the code that needs to get the property has PropertyPermission for this property, but the code that calls it does not. Is that correct? Assuming that is the case, do you think such as scenario would be at all common? Under what circumstances would it make sense to use a GetPropertyAction? -- Regards, John McGrath
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.