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

org.molgenis.data.annotation.utils.JarRunnerImpl Maven / Gradle / Ivy

There is a newer version: 6.1.0
Show newest version
package org.molgenis.data.annotation.utils;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class JarRunnerImpl implements JarRunner
{

	@Override
	public File runJar(String outputFile, List params, File inputVcf) throws IOException, InterruptedException
	{
		File outputVcf = File.createTempFile(outputFile, ".vcf");

		List command = new ArrayList<>();
		command.add("java");
		command.add("-jar");
		command.addAll(params);
		command.add(inputVcf.getAbsolutePath());
		ProcessBuilder pb = new ProcessBuilder(command);
		pb.redirectOutput(outputVcf);

		// Error logging to standard logging.
		pb.redirectError(ProcessBuilder.Redirect.INHERIT);

		Process p = pb.start();
		p.waitFor();
		return outputVcf;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy