From 99999eeaec4aa7619bf48210928b6bf5ca08d714 Mon Sep 17 00:00:00 2001 From: crschnick Date: Thu, 10 Oct 2024 04:08:36 +0000 Subject: [PATCH] Add way to duplicate files --- .../xpipe/app/browser/file/BrowserFileTransferOperation.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileTransferOperation.java b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileTransferOperation.java index 113afb304..8662924f4 100644 --- a/app/src/main/java/io/xpipe/app/browser/file/BrowserFileTransferOperation.java +++ b/app/src/main/java/io/xpipe/app/browser/file/BrowserFileTransferOperation.java @@ -157,7 +157,8 @@ public class BrowserFileTransferOperation { var targetFile = FileNames.join(target.getPath(), FileNames.getFileName(sourceFile)); if (sourceFile.equals(targetFile)) { - return; + // Duplicate file by renaming it + targetFile = renameFileLoop(target.getFileSystem(), targetFile, source.getKind() == FileKind.DIRECTORY); } if (source.getKind() == FileKind.DIRECTORY && target.getFileSystem().directoryExists(targetFile)) {