From 94b56735650ed6ce86be337ab922f289a8c4df13 Mon Sep 17 00:00:00 2001 From: crschnick Date: Thu, 12 Sep 2024 21:05:38 +0000 Subject: [PATCH] Fix transfer move^ --- .../java/io/xpipe/app/browser/BrowserTransferModel.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/xpipe/app/browser/BrowserTransferModel.java b/app/src/main/java/io/xpipe/app/browser/BrowserTransferModel.java index a2ce2b029..5e5e0c24a 100644 --- a/app/src/main/java/io/xpipe/app/browser/BrowserTransferModel.java +++ b/app/src/main/java/io/xpipe/app/browser/BrowserTransferModel.java @@ -166,7 +166,11 @@ public class BrowserTransferModel { if (Files.exists(target) && Files.isDirectory(target)) { FileUtils.deleteDirectory(target.toFile()); } - FileUtils.moveDirectory(file.toFile(),target.toFile()); + if (Files.isDirectory(file)) { + FileUtils.moveDirectory(file.toFile(), target.toFile()); + } else { + FileUtils.moveFile(file.toFile(), target.toFile()); + } } DesktopHelper.browseFileInDirectory(downloads.resolve(files.getFirst().getFileName())); }