private void compileSpecific() {
Node<BasicPermissionTarget> root = new Node<>(
new BasicPermissionTarget("category:specific", getMessage("permissionConfig.specificRoot"), null));
specific = new Tree<>(root);
final String configName = AppContext.getProperty(PERMISSION_CONFIG_XML_PROP);
StringTokenizer tokenizer = new StringTokenizer(configName);
for (String location : tokenizer.getTokenArray()) {
Resource resource = resources.getResource(location);
if (resource.exists()) {
InputStream stream = null;
try {
stream = resource.getInputStream();
String xml = IOUtils.toString(stream, StandardCharsets.UTF_8);
compileSpecific(xml, root);
} catch (IOException e) {
throw new RuntimeException("Unable to read permission config", e);
} finally {
IOUtils.closeQuietly(stream);
}
} else {
log.warn("Resource {} not found, ignore it", location);
}
}
}