use of nl.nn.adapterframework.senders.CommandSender in project iaf by ibissource.
the class FlowDiagram method runCommandSender.
private void runCommandSender(File dotFile, File outFile) throws SenderException, ConfigurationException, TimeOutException {
CommandSender commandSender = null;
try {
commandSender = new CommandSender();
commandSender.setCommand(url);
commandSender.setCommandWithArguments(true);
commandSender.setTimeOut(10);
Parameter p = new Parameter();
p.setName("arg1");
p.setValue("-T" + format);
commandSender.addParameter(p);
p = new Parameter();
p.setName("arg2");
p.setValue(dotFile.getPath());
commandSender.addParameter(p);
p = new Parameter();
p.setName("arg3");
p.setValue("-o");
commandSender.addParameter(p);
p = new Parameter();
p.setName("arg4");
p.setValue(outFile.getPath());
commandSender.addParameter(p);
commandSender.configure();
commandSender.open();
ParameterResolutionContext prc = new ParameterResolutionContext("dummy", new PipeLineSessionBase());
String result = commandSender.sendMessage(null, "", prc);
} finally {
if (commandSender != null) {
commandSender.close();
}
}
}
Aggregations