Code example for Subject

Methods: doAs

0
 
    public static void main(String[] args) throws Exception {
        lc = new LoginContext("CountFiles", new NullCallbackHandler());
        lc.login();
 
        Object o = Subject.doAs(lc.getSubject(), new CountFilesAction());
        System.out.println("User " + lc.getSubject() + " found " + o + " files.");
 
    } 
}