@Override public Map<String, AbstractPolicy> loadPolicies(PolicyParser policyParser, boolean validate, File dir) throws IOException, ValidationException { Map<String,AbstractPolicy> policies = new HashMap<String,AbstractPolicy>(); for (File file: dir.listFiles()) { if (file.isDirectory()) { policies.putAll(loadPolicies(policyParser, validate, file)); } else { if (file.getName().endsWith(".xml")) { logger.info("Loading policy: {}", file.getPath()); InputStream policyStream = new FileInputStream(file); policies.put(file.getPath(), policyParser.parse(policyStream, validate)); } } } return policies; }
@Override public Map<String, AbstractPolicy> loadPolicies(PolicyParser policyParser, boolean validate, File dir) throws IOException, ValidationException { Map<String,AbstractPolicy> policies = new HashMap<String,AbstractPolicy>(); for (File file: dir.listFiles()) { if (file.isDirectory()) { policies.putAll(loadPolicies(policyParser, validate, file)); } else { if (file.getName().endsWith(".xml")) { logger.info("Loading policy: {}", file.getPath()); InputStream policyStream = new FileInputStream(file); policies.put(file.getPath(), policyParser.parse(policyStream, validate)); } } } return policies; }