2 * Copyright (C) The Arvados Authors. All rights reserved.
4 * SPDX-License-Identifier: AGPL-3.0 OR Apache-2.0
8 package org.arvados.client.utils;
10 import java.io.BufferedOutputStream;
12 import java.io.FileOutputStream;
13 import java.io.IOException;
14 import java.nio.file.Files;
15 import java.util.Collection;
17 public class FileMerge {
19 public static void merge(Collection<File> files, File targetFile) throws IOException {
20 try (FileOutputStream fos = new FileOutputStream(targetFile); BufferedOutputStream mergingStream = new BufferedOutputStream(fos)) {
21 for (File file : files) {
22 Files.copy(file.toPath(), mergingStream);