Skip to content

Commit 222549f

Browse files
committed
Update FileUtils.java
1 parent 0cfc1fc commit 222549f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/io/github/fvarrui/javapackager/utils/FileUtils.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
import java.io.InputStream;
1818
import java.net.URL;
1919
import java.nio.charset.StandardCharsets;
20+
import java.nio.file.CopyOption;
2021
import java.nio.file.Files;
22+
import java.nio.file.StandardCopyOption;
2123
import java.util.Arrays;
2224
import java.util.List;
2325
import java.util.function.Function;
@@ -84,7 +86,8 @@ public static void copyFileToFolder(File source, File destFolder, boolean overwr
8486
Logger.info("Copying file [" + source + "] to folder [" + destFolder + "]");
8587
if (new File(destFolder, source.getName()).exists() && !overwrite) return;
8688
try {
87-
copyFileToDirectory(source, destFolder);
89+
//copyFileToDirectory(source, destFolder);
90+
Files.copy(source.toPath(), new File(destFolder, source.getName()).toPath(), StandardCopyOption.COPY_ATTRIBUTES);
8891
} catch (IOException e) {
8992
throw new Exception(e.getMessage(), e);
9093
}

0 commit comments

Comments
 (0)