From 52477290366f074eb7563234489147f2a4abccb9 Mon Sep 17 00:00:00 2001 From: David Kocher Date: Mon, 25 Nov 2024 22:22:46 +0100 Subject: [PATCH] Remove unused parameter. --- .../java/ch/cyberduck/core/transfer/CopyTransfer.java | 2 +- .../java/ch/cyberduck/core/transfer/DownloadTransfer.java | 2 +- .../java/ch/cyberduck/core/transfer/SyncTransfer.java | 6 +++--- .../main/java/ch/cyberduck/core/transfer/Transfer.java | 5 ++--- .../java/ch/cyberduck/core/transfer/UploadTransfer.java | 2 +- .../core/transfer/download/AbstractDownloadFilter.java | 1 + .../ch/cyberduck/core/worker/AbstractTransferWorker.java | 8 +++++++- .../ch/cyberduck/core/transfer/UploadTransferTest.java | 6 +++--- .../core/worker/ConcurrentTransferWorkerTest.java | 2 +- .../cyberduck/core/worker/SingleTransferWorkerTest.java | 6 +++--- 10 files changed, 23 insertions(+), 17 deletions(-) diff --git a/core/src/main/java/ch/cyberduck/core/transfer/CopyTransfer.java b/core/src/main/java/ch/cyberduck/core/transfer/CopyTransfer.java index d0e39abf5f3..2365f8f8c65 100644 --- a/core/src/main/java/ch/cyberduck/core/transfer/CopyTransfer.java +++ b/core/src/main/java/ch/cyberduck/core/transfer/CopyTransfer.java @@ -232,7 +232,7 @@ public void post(final Session source, final Session destination, final Ma @Override public void transfer(final Session session, final Session destination, final Path source, final Local n, - final TransferOptions options, final TransferStatus overall, final TransferStatus segment, + final TransferOptions options, final TransferStatus segment, final ConnectionCallback prompt, final ProgressListener progress, final StreamListener listener) throws BackgroundException { log.debug("Transfer file {} with options {}", source, options); diff --git a/core/src/main/java/ch/cyberduck/core/transfer/DownloadTransfer.java b/core/src/main/java/ch/cyberduck/core/transfer/DownloadTransfer.java index 6a50f07b9d3..cd71cdacb18 100644 --- a/core/src/main/java/ch/cyberduck/core/transfer/DownloadTransfer.java +++ b/core/src/main/java/ch/cyberduck/core/transfer/DownloadTransfer.java @@ -281,7 +281,7 @@ public void post(final Session source, final Session destination, final Ma @Override public void transfer(final Session source, final Session destination, final Path file, final Local local, final TransferOptions options, - final TransferStatus overall, final TransferStatus segment, final ConnectionCallback prompt, + final TransferStatus segment, final ConnectionCallback prompt, final ProgressListener progress, final StreamListener listener) throws BackgroundException { log.debug("Transfer file {} with options {} and status {}", file, options, segment); if(file.isSymbolicLink()) { diff --git a/core/src/main/java/ch/cyberduck/core/transfer/SyncTransfer.java b/core/src/main/java/ch/cyberduck/core/transfer/SyncTransfer.java index 660dd63a433..89b077651d6 100644 --- a/core/src/main/java/ch/cyberduck/core/transfer/SyncTransfer.java +++ b/core/src/main/java/ch/cyberduck/core/transfer/SyncTransfer.java @@ -210,15 +210,15 @@ public TransferAction action(final Session source, final Session destinati @Override public void transfer(final Session source, final Session destination, final Path file, final Local local, - final TransferOptions options, final TransferStatus overall, final TransferStatus segment, final ConnectionCallback prompt, + final TransferOptions options, final TransferStatus segment, final ConnectionCallback prompt, final ProgressListener progress, final StreamListener listener) throws BackgroundException { log.debug("Transfer file {} with options {}", file, options); switch(comparison.compare(file, local, progress)) { case remote: - download.transfer(source, destination, file, local, options, overall, segment, prompt, progress, listener); + download.transfer(source, destination, file, local, options, segment, prompt, progress, listener); break; case local: - upload.transfer(source, destination, file, local, options, overall, segment, prompt, progress, listener); + upload.transfer(source, destination, file, local, options, segment, prompt, progress, listener); break; } } diff --git a/core/src/main/java/ch/cyberduck/core/transfer/Transfer.java b/core/src/main/java/ch/cyberduck/core/transfer/Transfer.java index 4970f36f431..212975a909d 100644 --- a/core/src/main/java/ch/cyberduck/core/transfer/Transfer.java +++ b/core/src/main/java/ch/cyberduck/core/transfer/Transfer.java @@ -364,14 +364,13 @@ public void post(final Session source, final Session destination, final Ma * @param file Remote file path * @param local Local file reference * @param options Quarantine option - * @param overall Overall transfer status * @param segment Segment transfer status * @param prompt Prompt for alerts to user * @param progress Progress messages listener - * @param listener Byte count listener + * @param listener Byte count listener */ public abstract void transfer(Session source, Session destination, Path file, Local local, - TransferOptions options, TransferStatus overall, TransferStatus segment, + TransferOptions options, TransferStatus segment, ConnectionCallback prompt, ProgressListener progress, StreamListener listener) throws BackgroundException; public void start() { diff --git a/core/src/main/java/ch/cyberduck/core/transfer/UploadTransfer.java b/core/src/main/java/ch/cyberduck/core/transfer/UploadTransfer.java index f690d00379d..a80db4aa006 100644 --- a/core/src/main/java/ch/cyberduck/core/transfer/UploadTransfer.java +++ b/core/src/main/java/ch/cyberduck/core/transfer/UploadTransfer.java @@ -312,7 +312,7 @@ public void post(final Session source, final Session destination, final Ma @Override public void transfer(final Session source, final Session destination, final Path file, final Local local, final TransferOptions options, - final TransferStatus overall, final TransferStatus segment, final ConnectionCallback prompt, + final TransferStatus segment, final ConnectionCallback prompt, final ProgressListener progress, final StreamListener listener) throws BackgroundException { log.debug("Transfer file {} with options {} and status {}", file, options, segment); if(local.isSymbolicLink()) { diff --git a/core/src/main/java/ch/cyberduck/core/transfer/download/AbstractDownloadFilter.java b/core/src/main/java/ch/cyberduck/core/transfer/download/AbstractDownloadFilter.java index 3320c1737fa..855f481fb60 100644 --- a/core/src/main/java/ch/cyberduck/core/transfer/download/AbstractDownloadFilter.java +++ b/core/src/main/java/ch/cyberduck/core/transfer/download/AbstractDownloadFilter.java @@ -277,6 +277,7 @@ public void complete(final Path file, final Local local, // Bounce Downloads folder dock icon by sending download finished notification launcher.bounce(local); if(options.quarantine || options.wherefrom) { + //todo final DescriptiveUrlBag provider = session.getFeature(UrlProvider.class).toUrl(file).filter(DescriptiveUrl.Type.provider, DescriptiveUrl.Type.http); for(DescriptiveUrl url : provider) { try { diff --git a/core/src/main/java/ch/cyberduck/core/worker/AbstractTransferWorker.java b/core/src/main/java/ch/cyberduck/core/worker/AbstractTransferWorker.java index 864c9ba14f9..e2f56dad6a6 100644 --- a/core/src/main/java/ch/cyberduck/core/worker/AbstractTransferWorker.java +++ b/core/src/main/java/ch/cyberduck/core/worker/AbstractTransferWorker.java @@ -24,6 +24,8 @@ import ch.cyberduck.core.exception.TransferCanceledException; import ch.cyberduck.core.exception.TransferStatusCanceledException; import ch.cyberduck.core.io.StreamListener; +import ch.cyberduck.core.local.IconService; +import ch.cyberduck.core.local.IconServiceFactory; import ch.cyberduck.core.notification.NotificationService; import ch.cyberduck.core.preferences.PreferencesFactory; import ch.cyberduck.core.threading.TransferBackgroundActionState; @@ -333,6 +335,7 @@ public Future transfer(final TransferItem item, final TransferAc if(table.containsKey(item)) { // Overall transfer status final TransferStatus status = table.get(item); + final IconService.Icon icon = IconServiceFactory.iconFor(item.local); // Handle submit of one or more segments final List segments = status.getSegments(); for(final TransferStatus segment : segments) { @@ -385,7 +388,7 @@ private void transferSegment(final TransferStatus segment) throws BackgroundExce transfer.transfer(s, d, segment.getRename().remote != null ? segment.getRename().remote : item.remote, segment.getRename().local != null ? segment.getRename().local : item.local, - options, status, segment, connect, progress, counter); + options, segment, connect, progress, counter); } catch(BackgroundException e) { release(s, Connection.source, e); @@ -500,6 +503,9 @@ public TransferStatus call() throws BackgroundException { status.setFailure(new ConnectionCanceledException()); } } + if(status.isComplete()) { + icon.remove(); + } return status; } diff --git a/core/src/test/java/ch/cyberduck/core/transfer/UploadTransferTest.java b/core/src/test/java/ch/cyberduck/core/transfer/UploadTransferTest.java index 5e3b388e98d..03395c1b90d 100755 --- a/core/src/test/java/ch/cyberduck/core/transfer/UploadTransferTest.java +++ b/core/src/test/java/ch/cyberduck/core/transfer/UploadTransferTest.java @@ -159,7 +159,7 @@ public AttributedList list(final Path folder, final ListProgressListener l final Transfer t = new UploadTransfer(new Host(new TestProtocol()), root, local) { @Override public void transfer(final Session source, final Session destination, final Path file, Local local, - final TransferOptions options, final TransferStatus overall, final TransferStatus segment, + final TransferOptions options, final TransferStatus segment, final ConnectionCallback prompt, final ProgressListener progress, final StreamListener listener) { assertTrue(options.resumeRequested); @@ -245,7 +245,7 @@ public AttributedList list(final Path folder, final ListProgressListener l final Transfer t = new UploadTransfer(new Host(new TestProtocol()), root, local) { @Override public void transfer(final Session source, final Session destination, final Path file, Local local, - final TransferOptions options, final TransferStatus overall, final TransferStatus segment, + final TransferOptions options, final TransferStatus segment, final ConnectionCallback prompt, final ProgressListener progress, final StreamListener listener) { // @@ -414,7 +414,7 @@ public StatusOutputStream write(final Path file, final TransferStatus status, fi final Transfer transfer = new UploadTransfer(host, test, local) { @Override public void transfer(final Session source, final Session destination, final Path file, Local local, - final TransferOptions options, final TransferStatus overall, final TransferStatus segment, + final TransferOptions options, final TransferStatus segment, final ConnectionCallback prompt, final ProgressListener progress, final StreamListener listener) { segment.setComplete(); set.set(true); diff --git a/core/src/test/java/ch/cyberduck/core/worker/ConcurrentTransferWorkerTest.java b/core/src/test/java/ch/cyberduck/core/worker/ConcurrentTransferWorkerTest.java index 7b5fc2cae64..a2eea07d650 100644 --- a/core/src/test/java/ch/cyberduck/core/worker/ConcurrentTransferWorkerTest.java +++ b/core/src/test/java/ch/cyberduck/core/worker/ConcurrentTransferWorkerTest.java @@ -152,7 +152,7 @@ public void testConcurrentSessions() throws Exception { @Override public void transfer(final Session source, final Session destination, final Path file, final Local local, - final TransferOptions options, final TransferStatus overall, final TransferStatus segment, + final TransferOptions options, final TransferStatus segment, final ConnectionCallback prompt, final ProgressListener progress, final StreamListener listener) { assertNotNull(source); diff --git a/core/src/test/java/ch/cyberduck/core/worker/SingleTransferWorkerTest.java b/core/src/test/java/ch/cyberduck/core/worker/SingleTransferWorkerTest.java index 074c7f728bd..35ee3185007 100644 --- a/core/src/test/java/ch/cyberduck/core/worker/SingleTransferWorkerTest.java +++ b/core/src/test/java/ch/cyberduck/core/worker/SingleTransferWorkerTest.java @@ -70,7 +70,7 @@ public boolean exists() { final Transfer t = new UploadTransfer(new Host(new TestProtocol()), root, local) { @Override public void transfer(final Session source, final Session destination, final Path file, Local local, - final TransferOptions options, final TransferStatus overall, final TransferStatus segment, + final TransferOptions options, final TransferStatus segment, final ConnectionCallback prompt, final ProgressListener progress, final StreamListener listener) { // @@ -130,7 +130,7 @@ public boolean exists() { final Transfer t = new UploadTransfer(new Host(new TestProtocol()), root, local) { @Override public void transfer(final Session source, final Session destination, final Path file, Local local, - final TransferOptions options, final TransferStatus overall, final TransferStatus segment, + final TransferOptions options, final TransferStatus segment, final ConnectionCallback prompt, final ProgressListener progress, final StreamListener listener) { if(file.equals(root)) { @@ -200,7 +200,7 @@ public AttributedList list() { final Transfer t = new DownloadTransfer(new Host(new TestProtocol()), root, local) { @Override public void transfer(final Session source, final Session destination, final Path file, Local local, - final TransferOptions options, final TransferStatus overall, final TransferStatus segment, + final TransferOptions options, final TransferStatus segment, final ConnectionCallback prompt, final ProgressListener progress, final StreamListener listener) { if(file.equals(root)) {