protected void init() { String configName = AppContext.getProperty(CUBA_REST_SERVICES_CONFIG_PROP_NAME); 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(); loadConfig(Dom4j.readDocument(stream).getRootElement()); } catch (IOException e) { throw new RuntimeException("Error on parsing rest services config", e); } finally { IOUtils.closeQuietly(stream); } } else { log.warn("Resource " + location + " not found, ignore it"); } } }
protected void init() { String configName = AppContext.getProperty(CUBA_REST_QUERIES_CONFIG_PROP_NAME); 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(); loadConfig(Dom4j.readDocument(stream).getRootElement()); } catch (IOException e) { throw new RuntimeException(e); } finally { IOUtils.closeQuietly(stream); } } else { log.warn("Resource {} not found, ignore it", location); } } }
protected void _registerAppComponents() { String configNames = AppContext.getProperty(WEB_COMPONENTS_CONFIG_XML_PROP); if (Strings.isNullOrEmpty(configNames)) { return; } log.debug("Loading UI components from {}", configNames); StringTokenizer tokenizer = new StringTokenizer(configNames); for (String location : tokenizer.getTokenArray()) { Resource resource = resources.getResource(location); if (resource.exists()) { InputStream stream = null; try { stream = resource.getInputStream(); _registerComponent(stream); } catch (ClassNotFoundException | IOException e) { throw new RuntimeException("Unable to load components config " + location, e); } finally { IOUtils.closeQuietly(stream); } } else { log.warn("Resource {} not found, ignore it", location); } } }
protected void loadScreensXml() { String configName = AppContext.getProperty(WINDOW_CONFIG_XML_PROP); StringTokenizer tokenizer = new StringTokenizer(configName); for (String location : tokenizer.getTokenArray()) { Resource resource = resources.getResource(location); if (resource.exists()) { try (InputStream stream = resource.getInputStream()) { loadConfig(Dom4j.readDocument(stream).getRootElement()); } catch (IOException e) { throw new RuntimeException("Unable to read window config from " + location, e); } } else { log.warn("Resource {} not found, ignore it", location); } } }
protected void init() { rootItems.clear(); String configName = AppContext.getProperty(MENU_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(); Element rootElement = Dom4j.readDocument(stream).getRootElement(); loadMenuItems(rootElement, null); } catch (IOException e) { throw new RuntimeException("Unable to read menu config", e); } finally { IOUtils.closeQuietly(stream); } } else { log.warn("Resource {} not found, ignore it", location); } } }
protected void init() { String configName = AppContext.getProperty(CUBA_REST_JSON_TRANSFORMATION_CONFIG_PROP_NAME); 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(); loadConfig(Dom4j.readDocument(stream).getRootElement()); } catch (IOException e) { throw new RuntimeException(e); } finally { IOUtils.closeQuietly(stream); } } else { log.warn("Resource " + location + " not found, ignore it"); } } }
protected void init() { String configName = AppContext.getProperty(CUBA_REST_SERVICES_CONFIG_PROP_NAME); 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(); loadConfig(Dom4j.readDocument(stream).getRootElement()); } catch (IOException e) { throw new RuntimeException(e); } finally { IOUtils.closeQuietly(stream); } } else { log.warn("Resource " + location + " not found, ignore it"); } } }
protected void init() { String configName = configuration.getConfig(BpmConfig.class).getFormsConfig(); StrTokenizer tokenizer = new StrTokenizer(configName); for (String location : tokenizer.getTokenArray()) { Resource resource = resources.getResource(location); if (resource.exists()) { InputStream stream = null; try { stream = resource.getInputStream(); loadConfig(Dom4j.readDocument(stream).getRootElement()); } catch (IOException e) { throw new RuntimeException(e); } finally { IOUtils.closeQuietly(stream); } } else { log.warn("Resource {} not found, ignore it", location); } } }
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); } } }
configName = "jgroups.xml"; stream = resources.getResource(configName).getInputStream();