From 409124d9a29b992503ca641b098a046e46fa7fb5 Mon Sep 17 00:00:00 2001 From: assaf Date: Thu, 14 Nov 2024 20:24:16 +0200 Subject: [PATCH] Add Copy Options for FileUtils.java --- src/main/java/org/ois/core/utils/io/FileUtils.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/ois/core/utils/io/FileUtils.java b/src/main/java/org/ois/core/utils/io/FileUtils.java index 74a9a3c..9ee2be1 100644 --- a/src/main/java/org/ois/core/utils/io/FileUtils.java +++ b/src/main/java/org/ois/core/utils/io/FileUtils.java @@ -20,9 +20,9 @@ public class FileUtils { * @return true if the file was copied successfully, false otherwise * @throws IOException if an I/O error occurs */ - public static boolean copyFile(InputStream src, Path target, boolean failIfCantCreate) throws IOException { + public static boolean copyFile(InputStream src, Path target, boolean failIfCantCreate, CopyOption... options) throws IOException { try { - Files.copy(src, target); + Files.copy(src, target, options); return true; } catch (Exception e) { if (failIfCantCreate){ @@ -41,9 +41,9 @@ public static boolean copyFile(InputStream src, Path target, boolean failIfCantC * @return true if the file was copied successfully, false otherwise * @throws IOException if an I/O error occurs */ - public static boolean copyFile(Path src, Path target, boolean failIfCantCreate) throws IOException { + public static boolean copyFile(Path src, Path target, boolean failIfCantCreate, CopyOption... options) throws IOException { try { - Files.copy(src, target); + Files.copy(src, target, options); return true; } catch (Exception e) { if (failIfCantCreate){