问题
I'm curious if it's possible to restrict who can write to System.out
/System.err
using a SecurityManager
. Looking at System.java this doesn't appear to be possible out of the box, but perhaps there's another layer I haven't looked at?
If it's not possible out of the box, is there a reasonable pattern for implementing a custom security check using System.setOut()
/System.setErr()
?
来源:https://stackoverflow.com/questions/62584518/is-it-possible-to-use-securitymanager-to-control-which-classes-can-write-to-stdo