/** * Method that takes an inputstream, read it preserving the end lines, and subtitute using commons-lang-3 calls * the variables, first searching as system properties vars and then in environment var list. * In case of missing the property is replaced by white space. * @param stream * @return */ public static String replaceParameters(final InputStream stream) { String content = IOUtil.asStringPreservingNewLines(stream); return resolvePlaceholders(content); }
private String resolveCommand(String command, int port) { Map<String, String> values = new HashMap<String, String>(); values.put("port", Integer.toString(port)); String templateContent = IOUtil.asStringPreservingNewLines(PollingAwaitStrategy.class.getResourceAsStream(command + ".sh")); return IOUtil.replacePlaceholders(templateContent, values); } }
/** * Method that takes an inputstream, read it preserving the end lines, and subtitute using commons-lang-3 calls * the variables, first searching as system properties vars and then in environment var list. * In case of missing the property is replaced by white space. * @param stream * @return */ public static String replaceParameters(final InputStream stream) { String content = IOUtil.asStringPreservingNewLines(stream); return resolvePlaceholders(content); }
private String resolveCommand(String command, int port) { Map<String, String> values = new HashMap<String, String>(); values.put("port", Integer.toString(port)); String templateContent = IOUtil.asStringPreservingNewLines(PollingAwaitStrategy.class.getResourceAsStream(command + ".sh")); return IOUtil.replacePlaceholders(templateContent, values); } }
private static DockerCompositions convert(URI uri, DefinitionFormat definitionFormat) throws IOException { try { Path definitionFilePath = Paths.get(uri); return convert(definitionFilePath, definitionFormat); } catch (FileSystemNotFoundException e) { String content = ""; if (uri.isAbsolute()) { content = IOUtil.asStringPreservingNewLines(uri.toURL().openStream()); } else { String fileContent = uri.toString(); content = IOUtil.asStringPreservingNewLines(new FileInputStream(fileContent)); } return convert(content, definitionFormat); } catch (IllegalArgumentException e) { String content = ""; if (uri.isAbsolute()) { content = IOUtil.asStringPreservingNewLines(uri.toURL().openStream()); } else { String fileContent = uri.toString(); content = IOUtil.asStringPreservingNewLines(new FileInputStream(fileContent)); } return convert(content, definitionFormat); } }
private static DockerCompositions convert(URI uri, DefinitionFormat definitionFormat) throws IOException { try { Path definitionFilePath = Paths.get(uri); return convert(definitionFilePath, definitionFormat); } catch (FileSystemNotFoundException e) { String content = ""; if (uri.isAbsolute()) { content = IOUtil.asStringPreservingNewLines(uri.toURL().openStream()); } else { String fileContent = uri.toString(); content = IOUtil.asStringPreservingNewLines(new FileInputStream(fileContent)); } return convert(content, definitionFormat); } catch (IllegalArgumentException e) { String content = ""; if (uri.isAbsolute()) { content = IOUtil.asStringPreservingNewLines(uri.toURL().openStream()); } else { String fileContent = uri.toString(); content = IOUtil.asStringPreservingNewLines(new FileInputStream(fileContent)); } return convert(content, definitionFormat); } }
cubeConfiguration.dockerContainersContent = DockerContainerDefinitionParser.convert( IOUtil.asStringPreservingNewLines(stream), cubeConfiguration.definitionFormat); } else {
cubeConfiguration.dockerContainersContent = DockerContainerDefinitionParser.convert( IOUtil.asStringPreservingNewLines(stream), cubeConfiguration.definitionFormat); } else {