Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

AccessController.doPrivileged()
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

Report this thread to moderator Post Follow-up to this message
Old Post
John McGrath
06-03-05 09:00 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Java Security archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:43 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.