}
private void mergeInputFiles(PipelinePluginInput input, PipelinePluginOutput output) throws IOException {
output.getOutputFiles().clear();
File targetFile = null;
OutputFile outputFile = null;
BufferedWriter outputWriter = null;
try {
List<InputFile> inputFiles = getInputFilesInAlphabeticalOrder(input);
for (InputFile inputFile : inputFiles) {
if (targetFile == null) {
targetFile = createTargetFile(inputFile);
outputFile = OutputFileFactory.newOutputFile(targetFile);
outputWriter = new BufferedWriter(new FileWriter(targetFile));
}
copyFile(inputFile, outputWriter);
assert outputFile != null;
outputFile.addOriginFile(inputFile);
}
if (outputFile != null) {
output.getOutputFiles().add(outputFile);
}
} finally {