public Object run() throws Exception { LinkedList l = new LinkedList(); for (int i = 1;; i++) { String s = Security.getProperty("policy.file." + i); debug("policy.file." + i + "=" + s); if (s == null) break; l.add(new URL(s)); } String s = System .getProperty("java.security.policy"); debug("java.security.policy=" + s); if (s != null) l.add(new URL(s)); return l; } })); } catch (PrivilegedActionException pae) { error(pae.getException());
AccessController.doPrivileged( new PrivilegedExceptionAction() { public Object run() throws Exception { String allow = Security.getProperty ("policy.allowSystemProperty"); if (allow == null || Boolean.getBoolean (allow)) { String s = SystemProperties.getProperty ("java.security.policy"); logger.log (Component.POLICY, "java.security.policy={0}", s); if (s != null) { boolean only = s.startsWith ("="); if (only) s = s.substring (1); policyFiles.clear (); policyFiles.add (new URL (s)); if (only) return null; } } for (int i = 1; ; i++) { String pname = "policy.url." + i; String s = Security.getProperty (pname); logger.log (Component.POLICY, "{0}={1}", new Object [] { pname, s }); if (s == null) break; policyFiles.add (new URL (s)); } return null; } });
    public void refresh() {        cs2pc.clear();        final List policyFiles = new ArrayList();        try {            policyFiles.add(defaultPolicy);            policyFiles.addAll((List) AccessController                    .doPrivileged(new PrivilegedExceptionAction() {                        public Object run() throws Exception {                            LinkedList l = new LinkedList();                            for (int i = 1;; i++) {                                String s = Security.getProperty("policy.file."                                        + i);                                debug("policy.file." + i + "=" + s);                                if (s == null) break;                                l.add(new URL(s));                            }                            String s = System                                    .getProperty("java.security.policy");                            debug("java.security.policy=" + s);                            if (s != null) l.add(new URL(s));                            return l;                        }                    }));        } catch (PrivilegedActionException pae) {            error(pae.getException());        }        for (Iterator it = policyFiles.iterator(); it.hasNext();) {            try {                URL url = (URL) it.next();                parse(url);            } catch (IOException ioe) {                error(ioe);            }        }    }