All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.blitline.image.functions.RunExecutable Maven / Gradle / Ivy

There is a newer version: 0.17.1
Show newest version
package com.blitline.image.functions;

import java.net.URI;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.Validate;

/**
 * Execute an arbitrary command inside the Blitline job container.
 * 
 * @author Christopher Smith
 * 
 */
public class RunExecutable extends AbstractScriptFunction {

	/**
	 * @param executableCommand
	 *            the command to be run, as if using {@code bash -c}
	 */
	public RunExecutable(String executableCommand) {
		params.put("executable", executableCommand);
	}

	public RunExecutable withFiles(String... urls) {
		Validate.validState(!params.containsKey("files"), "only one set of files may be specified");
		params.put("files", StringUtils.join(urls, ','));
		return this;
	}

	public RunExecutable withFiles(URI... urls) {
		Validate.validState(!params.containsKey("files"), "only one set of files may be specified");
		params.put("files", StringUtils.join(urls, ','));
		return this;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy