/** * Get the resource bundle * @return The resource bundle */ public ResourceBundle getResourceBundle() { return ResourceBundle.getBundle("validator", Locale.US, SecurityActions.getClassLoader(Validator.class)); }
destination = new File(SecurityActions.getSystemProperty("java.io.tmpdir"), "/tmp/"); root = extract(f, destination); allurls = urls; cl = SecurityActions.createURLClassLoader(allurls, SecurityActions.getThreadContextClassLoader()); SecurityActions.setThreadContextClassLoader(cl); SecurityActions.closeURLClassLoader(cl);
destination = new File(SecurityActions.getSystemProperty("java.io.tmpdir"), "/tmp/"); root = extract(f, destination); allurls = urls; cl = SecurityActions.createURLClassLoader(allurls, SecurityActions.getThreadContextClassLoader()); SecurityActions.setThreadContextClassLoader(cl); SecurityActions.closeURLClassLoader(cl);
/** * Get the resource bundle * @return The resource bundle */ public ResourceBundle getResourceBundle() { return ResourceBundle.getBundle("validator", Locale.US, SecurityActions.getClassLoader(Validator.class)); }
/** * @param rulesNameArray the rules name array * @return the list of {@link Rule} instances for given rules names */ private List<Rule> extractRules(String[] rulesNameArray) { List<Rule> rules = new ArrayList<Rule>(rulesNameArray.length); for (int i = 0; i < rulesNameArray.length; i++) { try { Class clz = Class.forName(rulesNameArray[i], true, SecurityActions.getClassLoader(Validator.class)); Rule rule = (Rule) clz.newInstance(); rules.add(rule); } catch (Throwable t) { throw new IllegalArgumentException(rulesNameArray[i], t); } } return rules; } }
/** * @param rulesNameArray the rules name array * @return the list of {@link Rule} instances for given rules names */ private List<Rule> extractRules(String[] rulesNameArray) { List<Rule> rules = new ArrayList<Rule>(rulesNameArray.length); for (int i = 0; i < rulesNameArray.length; i++) { try { Class clz = Class.forName(rulesNameArray[i], true, SecurityActions.getClassLoader(Validator.class)); Rule rule = (Rule) clz.newInstance(); rules.add(rule); } catch (Throwable t) { throw new IllegalArgumentException(rulesNameArray[i], t); } } return rules; } }