private Map<String, String> buildEnvironmentVariables( ExecutionContext context, ExecutionScript script) throws InterruptedException, IOException { assert script != null; Map<String, String> env = new HashMap<>(); env.putAll(getEnvironmentVariables(context, script)); env.putAll(context.getEnvironmentVariables()); env.putAll(script.getEnvironmentVariables()); return env; }
private Map<String, String> buildEnvironmentVariables( ExecutionContext context, ExecutionScript script) throws InterruptedException, IOException { assert script != null; Map<String, String> env = new HashMap<>(); env.putAll(getEnvironmentVariables(context, script)); env.putAll(context.getEnvironmentVariables()); env.putAll(script.getEnvironmentVariables()); return env; } }
private String getAsakusaHomePath( ExecutionContext context, ExecutionScript script, ExecutionScriptHandler<?> handler) throws IOException, InterruptedException { assert context != null; assert script != null; assert handler != null; String inScript = script.getEnvironmentVariables().get(ENV_ASAKUSA_HOME); if (inScript != null && inScript.equals(PLACEHOLDER_HOME) == false) { LOG.debug("Asakusa location is found in script: {} -> {}", script.getId(), inScript); return inScript; } Map<String, String> environmentVariables = handler.getEnvironmentVariables(context, script); String inHandler = environmentVariables.get(ENV_ASAKUSA_HOME); if (inHandler != null) { LOG.debug("Asakusa location is found in handler: {} -> {}", script.getId(), inHandler); return inHandler; } throw new IOException(MessageFormat.format( "{0} is not defined for \"{1}\"", ENV_ASAKUSA_HOME, handler.getHandlerId())); }
properties.setProperty(scriptPrefix + KEY_SUPPORTED_EXTENSIONS, join(script.getSupportedExtensions())); String envPrefix = scriptPrefix + KEY_ENV_PREFIX; for (Map.Entry<String, String> entry : script.getEnvironmentVariables().entrySet()) { properties.setProperty(envPrefix + entry.getKey(), entry.getValue());