in tomee-patch-plugin/src/main/java/org/apache/tomee/patch/plugin/PatchMojo.java [679:696]
private void copySource(final File src, final File dest) {
for (final File file : src.listFiles()) {
if (file.isDirectory()) {
final File dir = new File(dest, file.getName());
Files.mkdir(dir);
copySource(file, dir);
} else if (file.isFile()) {
try (InputStream in = IO.read(file)) {
IO.copy(in, new File(dest, file.getName()));
} catch (IOException e) {
throw new UncheckedIOException("Cannot copy file " + file.getAbsolutePath(), e);
}
}
}
}