@Override
public PluginResult run(PipelinePluginInput input,
PipelinePluginOutput output, PipelinePluginContext context) throws Exception {
// Get required data elements:
DataElements dataElements = context.getDataElements();
if ( dataElements == null || dataElements.isEmpty() )
throw new Exception("No data elements were passed to this plugin.");
DataElement<String> deCommand = dataElements.get("Command", DataType.STRING);
if ( deCommand == null || deCommand.isNull() )
throw new Exception("No command was specified.");
DataElement<String> deArg = dataElements.get("CommandArg", DataType.STRING);
if ( deArg == null || deArg.isNull() )
throw new Exception("No command arguments were specified.");
String command = deCommand.getValueAsString();
String arg = deArg.getValueAsString();
// Get optional data elements:
String outputExtension = null;
if ( dataElements.contains("OutputExtension", DataType.STRING) ) {
outputExtension = dataElements.get("OutputExtension", DataType.STRING).getValueAsString();
}
InputFiles inputFiles = input.getInputFiles();
OutputFiles outputFiles = output.getOutputFiles();
for( InputFile inputFile : inputFiles.getFiles() ) {