mirror of
https://github.com/arduino/Arduino.git
synced 2024-12-01 12:24:14 +01:00
FileUtils.copy now filters out source control folders. Also, dir is checked for existence before creating it. Fixes #4034
This commit is contained in:
parent
f5c3136b34
commit
67e32ff8fa
@ -58,12 +58,12 @@ public class FileUtils {
|
||||
public static void copy(File sourceFolder, File destFolder) throws IOException {
|
||||
for (File file : sourceFolder.listFiles()) {
|
||||
File destFile = new File(destFolder, file.getName());
|
||||
if (file.isDirectory()) {
|
||||
if (!destFile.mkdir()) {
|
||||
if (file.isDirectory() && !SOURCE_CONTROL_FOLDERS.contains(file.getName())) {
|
||||
if (!destFile.exists() && !destFile.mkdir()) {
|
||||
throw new IOException("Unable to create folder: " + destFile);
|
||||
}
|
||||
copy(file, destFile);
|
||||
} else {
|
||||
} else if (!file.isDirectory()) {
|
||||
copyFile(file, destFile);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user