diff --git a/backblaze/src/main/java/ch/cyberduck/core/b2/B2LargeUploadService.java b/backblaze/src/main/java/ch/cyberduck/core/b2/B2LargeUploadService.java index f61b97f04a2..56393f3bf1f 100644 --- a/backblaze/src/main/java/ch/cyberduck/core/b2/B2LargeUploadService.java +++ b/backblaze/src/main/java/ch/cyberduck/core/b2/B2LargeUploadService.java @@ -19,8 +19,10 @@ import ch.cyberduck.core.ConnectionCallback; import ch.cyberduck.core.DefaultIOExceptionMappingService; import ch.cyberduck.core.Local; +import ch.cyberduck.core.LocaleFactory; import ch.cyberduck.core.Path; import ch.cyberduck.core.PathContainerService; +import ch.cyberduck.core.ProgressListener; import ch.cyberduck.core.concurrency.Interruptibles; import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.features.Upload; @@ -42,6 +44,7 @@ import java.io.IOException; import java.security.MessageDigest; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.Comparator; import java.util.HashMap; @@ -94,7 +97,7 @@ public B2LargeUploadService(final B2Session session, final B2VersionIdProvider f @Override public BaseB2Response upload(final Path file, final Local local, final BandwidthThrottle throttle, - final StreamListener listener, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException { + final ProgressListener progress, final StreamListener streamListener, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException { final long partSize; if(file.getType().contains(Path.Type.encrypted)) { // For uploads to vault part size must be a multiple of 32 * 1024. Recommended partsize from B2 API may not meet that requirement. @@ -103,12 +106,12 @@ public BaseB2Response upload(final Path file, final Local local, final Bandwidth else { partSize = this.partSize; } - return this.upload(file, local, throttle, listener, status, callback, + return this.upload(file, local, throttle, progress, streamListener, status, callback, partSize < status.getLength() ? partSize : PreferencesFactory.get().getLong("b2.upload.largeobject.size.minimum")); } public BaseB2Response upload(final Path file, final Local local, - final BandwidthThrottle throttle, final StreamListener listener, final TransferStatus status, + final BandwidthThrottle throttle, final ProgressListener progress, final StreamListener streamListener, final TransferStatus status, final ConnectionCallback callback, final Long partSize) throws BackgroundException { final ThreadPool pool = ThreadPoolFactory.get("largeupload", concurrency); try { @@ -171,7 +174,7 @@ public BaseB2Response upload(final Path file, final Local local, if(!skip) { final long length = Math.min(Math.max((size / B2LargeUploadService.MAXIMUM_UPLOAD_PARTS), partSize), remaining); // Submit to queue - parts.add(this.submit(pool, file, local, throttle, listener, status, fileId, partNumber, offset, length, callback)); + parts.add(this.submit(pool, file, local, throttle, streamListener, status, fileId, partNumber, offset, length, callback)); log.debug("Part {} submitted with size {} and offset {}", partNumber, length, offset); remaining -= length; offset += length; @@ -188,6 +191,8 @@ public int compare(final B2UploadPartResponse o1, final B2UploadPartResponse o2) for(B2UploadPartResponse part : completed) { checksums.add(part.getContentSha1()); } + progress.message(MessageFormat.format(LocaleFactory.localizedString("Finalize {0}", "Status"), + file.getName())); final B2FinishLargeFileResponse response = session.getClient().finishLargeFileUpload(fileId, checksums.toArray(new String[checksums.size()])); log.info("Finished large file upload {} with {} parts", file, completed.size()); fileid.cache(file, response.getFileId()); diff --git a/backblaze/src/main/java/ch/cyberduck/core/b2/B2ThresholdUploadService.java b/backblaze/src/main/java/ch/cyberduck/core/b2/B2ThresholdUploadService.java index baf12517343..430fd6a00bd 100644 --- a/backblaze/src/main/java/ch/cyberduck/core/b2/B2ThresholdUploadService.java +++ b/backblaze/src/main/java/ch/cyberduck/core/b2/B2ThresholdUploadService.java @@ -18,6 +18,7 @@ import ch.cyberduck.core.ConnectionCallback; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; +import ch.cyberduck.core.ProgressListener; import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.features.Upload; import ch.cyberduck.core.features.Write; @@ -59,13 +60,13 @@ public Write.Append append(final Path file, final TransferStatus status) throws } @Override - public BaseB2Response upload(final Path file, final Local local, final BandwidthThrottle throttle, final StreamListener listener, + public BaseB2Response upload(final Path file, final Local local, final BandwidthThrottle throttle, final ProgressListener progress, final StreamListener streamListener, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException { if(this.threshold(status)) { - return new B2LargeUploadService(session, fileid, writer).upload(file, local, throttle, listener, status, callback); + return new B2LargeUploadService(session, fileid, writer).upload(file, local, throttle, progress, streamListener, status, callback); } else { - return new B2SingleUploadService(session, writer).upload(file, local, throttle, listener, status, callback); + return new B2SingleUploadService(session, writer).upload(file, local, throttle, progress, streamListener, status, callback); } } diff --git a/backblaze/src/test/java/ch/cyberduck/core/b2/B2LargeUploadServiceTest.java b/backblaze/src/test/java/ch/cyberduck/core/b2/B2LargeUploadServiceTest.java index 4f317994ffe..22e5838c258 100644 --- a/backblaze/src/test/java/ch/cyberduck/core/b2/B2LargeUploadServiceTest.java +++ b/backblaze/src/test/java/ch/cyberduck/core/b2/B2LargeUploadServiceTest.java @@ -20,6 +20,7 @@ import ch.cyberduck.core.ConnectionCallback; import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.PathAttributes; @@ -82,7 +83,7 @@ public void testUpload() throws Exception { final B2LargeUploadService upload = new B2LargeUploadService(session, fileid, new B2WriteFeature(session, fileid), 5 * 1000L * 1000L, 5); - upload.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), + upload.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledConnectionCallback()); final PathAttributes attr = new B2AttributesFinderFeature(session, fileid).find(test); assertNotEquals(Checksum.NONE, attr.getChecksum()); @@ -127,7 +128,7 @@ public BaseB2Response upload(final Path file, final Local local, final Bandwidth } }; try { - service.upload(test, new Local(System.getProperty("java.io.tmpdir"), name), new BandwidthThrottle(BandwidthThrottle.UNLIMITED), count, status, new DisabledLoginCallback()); + service.upload(test, new Local(System.getProperty("java.io.tmpdir"), name), new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, status, new DisabledLoginCallback()); } catch(BackgroundException e) { // Expected @@ -142,7 +143,7 @@ public BaseB2Response upload(final Path file, final Local local, final Bandwidth assertEquals(0L, resume.offset, 0L); final TransferStatus append = new TransferStatus().append(true).withLength(content.length); service.upload(test, local, - new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), append, + new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), append, new DisabledLoginCallback()); assertEquals(content.length, append.getResponse().getSize()); assertTrue(new B2FindFeature(session, fileid).find(test)); @@ -184,7 +185,7 @@ public BaseB2Response upload(final Path file, final Local local, final Bandwidth }; final BytecountStreamListener count = new BytecountStreamListener(); try { - feature.upload(test, new Local(System.getProperty("java.io.tmpdir"), name), new BandwidthThrottle(BandwidthThrottle.UNLIMITED), count, status, new DisabledLoginCallback()); + feature.upload(test, new Local(System.getProperty("java.io.tmpdir"), name), new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, status, new DisabledLoginCallback()); } catch(BackgroundException e) { // Expected @@ -202,7 +203,7 @@ public BaseB2Response upload(final Path file, final Local local, final Bandwidth assertEquals(5 * 1000L * 1000L, new B2AttributesFinderFeature(session, fileid).find(upload).getSize(), 0L); final TransferStatus append = new TransferStatus().append(true).withLength(2L * 1000L * 1000L).withOffset(5 * 1000L * 1000L); feature.upload(test, local, - new BandwidthThrottle(BandwidthThrottle.UNLIMITED), count, append, + new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, append, new DisabledLoginCallback()); assertEquals(6 * 1000L * 1000L, count.getSent()); assertTrue(append.isComplete()); diff --git a/backblaze/src/test/java/ch/cyberduck/core/b2/B2ReadFeatureTest.java b/backblaze/src/test/java/ch/cyberduck/core/b2/B2ReadFeatureTest.java index 56f05ddc2c1..7cb392f50bc 100644 --- a/backblaze/src/test/java/ch/cyberduck/core/b2/B2ReadFeatureTest.java +++ b/backblaze/src/test/java/ch/cyberduck/core/b2/B2ReadFeatureTest.java @@ -19,6 +19,7 @@ import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledListProgressListener; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.exception.NotfoundException; @@ -127,7 +128,7 @@ public void testReadRange() throws Exception { IOUtils.write(content, out); out.close(); final BaseB2Response reply = new B2SingleUploadService(session, new B2WriteFeature(session, fileid)).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), new TransferStatus().withLength(content.length), new DisabledConnectionCallback()); final TransferStatus status = new TransferStatus(); @@ -159,7 +160,7 @@ public void testReadRangeUnknownLength() throws Exception { IOUtils.write(content, out); out.close(); new B2SingleUploadService(session, new B2WriteFeature(session, fileid)).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), new TransferStatus().withLength(content.length), new DisabledConnectionCallback()); final TransferStatus status = new TransferStatus(); diff --git a/backblaze/src/test/java/ch/cyberduck/core/b2/B2SingleUploadServiceTest.java b/backblaze/src/test/java/ch/cyberduck/core/b2/B2SingleUploadServiceTest.java index 59ddc54a4d1..7b05c43cff6 100644 --- a/backblaze/src/test/java/ch/cyberduck/core/b2/B2SingleUploadServiceTest.java +++ b/backblaze/src/test/java/ch/cyberduck/core/b2/B2SingleUploadServiceTest.java @@ -18,6 +18,7 @@ import ch.cyberduck.core.AlphanumericRandomStringService; import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.features.Delete; @@ -61,7 +62,7 @@ public void testUpload() throws Exception { status.setChecksum(checksum); final B2VersionIdProvider fileid = new B2VersionIdProvider(session); final B2SingleUploadService upload = new B2SingleUploadService(session, new B2WriteFeature(session, fileid)); - upload.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), + upload.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledConnectionCallback()); assertEquals(checksum, new B2AttributesFinderFeature(session, fileid).find(test).getChecksum()); status.validate(); diff --git a/backblaze/src/test/java/ch/cyberduck/core/cryptomator/B2LargeUploadServiceTest.java b/backblaze/src/test/java/ch/cyberduck/core/cryptomator/B2LargeUploadServiceTest.java index c740bc99a06..253dd87745a 100644 --- a/backblaze/src/test/java/ch/cyberduck/core/cryptomator/B2LargeUploadServiceTest.java +++ b/backblaze/src/test/java/ch/cyberduck/core/cryptomator/B2LargeUploadServiceTest.java @@ -21,6 +21,7 @@ import ch.cyberduck.core.DisabledLoginCallback; import ch.cyberduck.core.DisabledPasswordCallback; import ch.cyberduck.core.DisabledPasswordStore; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.b2.AbstractB2Test; @@ -90,7 +91,7 @@ public void testWrite() throws Exception { writeStatus.setLength(content.length); final Path test = new Path(vault, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)); final BytecountStreamListener counter = new BytecountStreamListener(); - service.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), counter, writeStatus, new DisabledConnectionCallback()); + service.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), counter, writeStatus, new DisabledConnectionCallback()); assertEquals(content.length, counter.getSent()); assertTrue(writeStatus.isComplete()); assertTrue(cryptomator.getFeature(session, Find.class, new B2FindFeature(session, fileid)).find(test)); @@ -126,7 +127,7 @@ public void testUploadWithBulk() throws Exception { final Local local = new Local(System.getProperty("java.io.tmpdir"), UUID.randomUUID().toString()); IOUtils.write(content, local.getOutputStream(false)); final BytecountStreamListener counter = new BytecountStreamListener(); - service.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), counter, writeStatus, new DisabledConnectionCallback()); + service.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), counter, writeStatus, new DisabledConnectionCallback()); assertEquals(content.length, counter.getSent()); assertTrue(writeStatus.isComplete()); assertTrue(cryptomator.getFeature(session, Find.class, new B2FindFeature(session, fileid)).find(test)); diff --git a/box/src/main/java/ch/cyberduck/core/box/BoxLargeUploadService.java b/box/src/main/java/ch/cyberduck/core/box/BoxLargeUploadService.java index 416722909f4..31d01f0163a 100644 --- a/box/src/main/java/ch/cyberduck/core/box/BoxLargeUploadService.java +++ b/box/src/main/java/ch/cyberduck/core/box/BoxLargeUploadService.java @@ -18,7 +18,9 @@ import ch.cyberduck.core.BytecountStreamListener; import ch.cyberduck.core.ConnectionCallback; import ch.cyberduck.core.Local; +import ch.cyberduck.core.LocaleFactory; import ch.cyberduck.core.Path; +import ch.cyberduck.core.ProgressListener; import ch.cyberduck.core.box.io.swagger.client.model.File; import ch.cyberduck.core.box.io.swagger.client.model.Files; import ch.cyberduck.core.box.io.swagger.client.model.UploadPart; @@ -44,6 +46,7 @@ import org.apache.logging.log4j.Logger; import java.security.MessageDigest; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -78,7 +81,7 @@ public BoxLargeUploadService(final BoxSession session, final BoxFileidProvider f } @Override - public File upload(final Path file, final Local local, final BandwidthThrottle throttle, final StreamListener listener, + public File upload(final Path file, final Local local, final BandwidthThrottle throttle, final ProgressListener progress, final StreamListener streamListener, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException { final ThreadPool pool = ThreadPoolFactory.get("multipart", concurrency); try { @@ -92,13 +95,15 @@ public File upload(final Path file, final Local local, final BandwidthThrottle t final UploadSession uploadSession = helper.createUploadSession(status, file); for(int partNumber = 1; remaining > 0; partNumber++) { final long length = Math.min(uploadSession.getPartSize(), remaining); - parts.add(this.submit(pool, file, local, throttle, listener, status, + parts.add(this.submit(pool, file, local, throttle, streamListener, status, uploadSession.getId(), partNumber, offset, length, callback)); remaining -= length; offset += length; } // Checksums for uploaded segments final List chunks = Interruptibles.awaitAll(parts); + progress.message(MessageFormat.format(LocaleFactory.localizedString("Finalize {0}", "Status"), + file.getName())); final Files files = helper.commitUploadSession(file, uploadSession.getId(), status, chunks.stream().map(f -> new UploadPart().sha1(f.part.getSha1()) .size(f.status.getLength()).offset(f.status.getOffset()).partId(f.part.getId())).collect(Collectors.toList())); diff --git a/box/src/main/java/ch/cyberduck/core/box/BoxThresholdUploadService.java b/box/src/main/java/ch/cyberduck/core/box/BoxThresholdUploadService.java index 028fb20c87b..e0b3be1d062 100644 --- a/box/src/main/java/ch/cyberduck/core/box/BoxThresholdUploadService.java +++ b/box/src/main/java/ch/cyberduck/core/box/BoxThresholdUploadService.java @@ -18,6 +18,7 @@ import ch.cyberduck.core.ConnectionCallback; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; +import ch.cyberduck.core.ProgressListener; import ch.cyberduck.core.box.io.swagger.client.model.File; import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.features.Upload; @@ -45,15 +46,15 @@ public BoxThresholdUploadService(final BoxSession session, final BoxFileidProvid } @Override - public File upload(final Path file, final Local local, final BandwidthThrottle throttle, final StreamListener listener, + public File upload(final Path file, final Local local, final BandwidthThrottle throttle, final ProgressListener progress, final StreamListener streamListener, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException { if(this.threshold(status.getLength())) { if(Vault.DISABLED == registry.find(session, file)) { - return new BoxLargeUploadService(session, fileid, new BoxChunkedWriteFeature(session, fileid)).upload(file, local, throttle, listener, status, callback); + return new BoxLargeUploadService(session, fileid, new BoxChunkedWriteFeature(session, fileid)).upload(file, local, throttle, progress, streamListener, status, callback); } // Cannot comply with chunk size requirement from server } - return new BoxSmallUploadService(session, fileid, writer).upload(file, local, throttle, listener, status, callback); + return new BoxSmallUploadService(session, fileid, writer).upload(file, local, throttle, progress, streamListener, status, callback); } @Override diff --git a/box/src/test/java/ch/cyberduck/core/box/BoxLargeUploadServiceTest.java b/box/src/test/java/ch/cyberduck/core/box/BoxLargeUploadServiceTest.java index 643f3b71584..37217e1ec56 100644 --- a/box/src/test/java/ch/cyberduck/core/box/BoxLargeUploadServiceTest.java +++ b/box/src/test/java/ch/cyberduck/core/box/BoxLargeUploadServiceTest.java @@ -20,6 +20,7 @@ import ch.cyberduck.core.BytecountStreamListener; import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.box.io.swagger.client.model.File; @@ -57,7 +58,7 @@ public void testUploadLargeFileInChunks() throws Exception { status.setChecksum(new SHA1ChecksumCompute().compute(local.getInputStream(), new TransferStatus())); status.setLength(content.length); final BytecountStreamListener count = new BytecountStreamListener(); - final File response = s.upload(file, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), count, status, new DisabledConnectionCallback()); + final File response = s.upload(file, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, status, new DisabledConnectionCallback()); assertTrue(status.isComplete()); assertNotNull(response.getSha1()); assertEquals(content.length, count.getSent()); diff --git a/box/src/test/java/ch/cyberduck/core/cryptomator/BoxThresholdUploadServiceTest.java b/box/src/test/java/ch/cyberduck/core/cryptomator/BoxThresholdUploadServiceTest.java index 6e9aeb63a46..861ac688623 100644 --- a/box/src/test/java/ch/cyberduck/core/cryptomator/BoxThresholdUploadServiceTest.java +++ b/box/src/test/java/ch/cyberduck/core/cryptomator/BoxThresholdUploadServiceTest.java @@ -22,6 +22,7 @@ import ch.cyberduck.core.DisabledLoginCallback; import ch.cyberduck.core.DisabledPasswordCallback; import ch.cyberduck.core.DisabledPasswordStore; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.box.AbstractBoxTest; @@ -94,7 +95,7 @@ public void testUploadVaultWithBulkFeature() throws Exception { final CryptoUploadFeature feature = new CryptoUploadFeature<>(session, new BoxThresholdUploadService(session, fileid, registry), new BoxWriteFeature(session, fileid), cryptomator); - feature.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), count, writeStatus, new DisabledConnectionCallback()); + feature.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, writeStatus, new DisabledConnectionCallback()); assertEquals(content.length, count.getSent()); assertTrue(writeStatus.isComplete()); assertTrue(cryptomator.getFeature(session, Find.class, new BoxFindFeature(session, fileid)).find(test)); diff --git a/brick/src/main/java/ch/cyberduck/core/brick/BrickThresholdUploadFeature.java b/brick/src/main/java/ch/cyberduck/core/brick/BrickThresholdUploadFeature.java index b2ed5ca2250..7a81b0adf09 100644 --- a/brick/src/main/java/ch/cyberduck/core/brick/BrickThresholdUploadFeature.java +++ b/brick/src/main/java/ch/cyberduck/core/brick/BrickThresholdUploadFeature.java @@ -18,6 +18,7 @@ import ch.cyberduck.core.ConnectionCallback; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; +import ch.cyberduck.core.ProgressListener; import ch.cyberduck.core.brick.io.swagger.client.model.FileEntity; import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.features.Upload; @@ -38,9 +39,9 @@ public BrickThresholdUploadFeature(final BrickSession session) { } @Override - public FileEntity upload(final Path file, final Local local, final BandwidthThrottle throttle, final StreamListener listener, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException { + public FileEntity upload(final Path file, final Local local, final BandwidthThrottle throttle, final ProgressListener progress, final StreamListener streamListener, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException { if(status.getLength() > 0) { - return new BrickUploadFeature(session, writer).upload(file, local, throttle, listener, status, callback); + return new BrickUploadFeature(session, writer).upload(file, local, throttle, progress, streamListener, status, callback); } else { new BrickTouchFeature(session).touch(file, status); diff --git a/brick/src/main/java/ch/cyberduck/core/brick/BrickUploadFeature.java b/brick/src/main/java/ch/cyberduck/core/brick/BrickUploadFeature.java index 990354bd84c..46d4fabab62 100644 --- a/brick/src/main/java/ch/cyberduck/core/brick/BrickUploadFeature.java +++ b/brick/src/main/java/ch/cyberduck/core/brick/BrickUploadFeature.java @@ -19,6 +19,7 @@ import ch.cyberduck.core.ConnectionCallback; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; +import ch.cyberduck.core.ProgressListener; import ch.cyberduck.core.brick.io.swagger.client.ApiException; import ch.cyberduck.core.brick.io.swagger.client.api.FileActionsApi; import ch.cyberduck.core.brick.io.swagger.client.api.FilesApi; @@ -79,7 +80,7 @@ public BrickUploadFeature(final BrickSession session, final Write wr } @Override - public FileEntity upload(final Path file, final Local local, final BandwidthThrottle throttle, final StreamListener listener, + public FileEntity upload(final Path file, final Local local, final BandwidthThrottle throttle, final ProgressListener progress, final StreamListener streamListener, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException { final ThreadPool pool = ThreadPoolFactory.get("multipart", concurrency); try { @@ -98,7 +99,7 @@ public FileEntity upload(final Path file, final Local local, final BandwidthThro else { length = remaining; } - parts.add(this.submit(pool, file, local, throttle, listener, status, + parts.add(this.submit(pool, file, local, throttle, streamListener, status, uploadPartEntity.getUploadUri(), partNumber, offset, length, callback)); remaining -= length; offset += length; diff --git a/brick/src/test/java/ch/cyberduck/core/brick/BrickCopyFeatureTest.java b/brick/src/test/java/ch/cyberduck/core/brick/BrickCopyFeatureTest.java index 9c4444b5f8e..d6898879b70 100644 --- a/brick/src/test/java/ch/cyberduck/core/brick/BrickCopyFeatureTest.java +++ b/brick/src/test/java/ch/cyberduck/core/brick/BrickCopyFeatureTest.java @@ -18,6 +18,7 @@ import ch.cyberduck.core.AlphanumericRandomStringService; import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.features.Delete; @@ -63,7 +64,7 @@ public void testCopyFile() throws Exception { IOUtils.write(random, local.getOutputStream(false)); final TransferStatus status = new TransferStatus().withLength(random.length); new BrickUploadFeature(session, new BrickWriteFeature(session)).upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - new DisabledStreamListener(), status, new DisabledLoginCallback()); + new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledLoginCallback()); local.delete(); assertTrue(new BrickFindFeature(session).find(test)); final Path copy = new Path(new DefaultHomeFinderService(session).find(), new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)); @@ -84,7 +85,7 @@ public void testCopyToExistingFile() throws Exception { IOUtils.write(random, local.getOutputStream(false)); final TransferStatus status = new TransferStatus().withLength(random.length); new BrickUploadFeature(session, new BrickWriteFeature(session)).upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - new DisabledStreamListener(), status, new DisabledLoginCallback()); + new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledLoginCallback()); local.delete(); assertTrue(new BrickFindFeature(session).find(test)); final Path copy = new Path(folder, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)); @@ -107,7 +108,7 @@ public void testCopyDirectory() throws Exception { IOUtils.write(random, local.getOutputStream(false)); final TransferStatus status = new TransferStatus().withLength(random.length); new BrickUploadFeature(session, new BrickWriteFeature(session)).upload(file, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - new DisabledStreamListener(), status, new DisabledLoginCallback()); + new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledLoginCallback()); local.delete(); assertTrue(new BrickFindFeature(session).find(file)); final Path copy = new Path(new DefaultHomeFinderService(session).find(), new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)); diff --git a/brick/src/test/java/ch/cyberduck/core/brick/BrickDeleteFeatureTest.java b/brick/src/test/java/ch/cyberduck/core/brick/BrickDeleteFeatureTest.java index 23559486512..2955c5eb18b 100644 --- a/brick/src/test/java/ch/cyberduck/core/brick/BrickDeleteFeatureTest.java +++ b/brick/src/test/java/ch/cyberduck/core/brick/BrickDeleteFeatureTest.java @@ -17,6 +17,7 @@ import ch.cyberduck.core.AlphanumericRandomStringService; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.features.Delete; @@ -50,7 +51,7 @@ public void testDeleteWithLock() throws Exception { IOUtils.write(random, local.getOutputStream(false)); final TransferStatus status = new TransferStatus().withLength(random.length); new BrickUploadFeature(session, new BrickWriteFeature(session)).upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - new DisabledStreamListener(), status, new DisabledLoginCallback()); + new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledLoginCallback()); local.delete(); final String lock = new BrickLockFeature(session).lock(test); assertNotNull(lock); diff --git a/brick/src/test/java/ch/cyberduck/core/brick/BrickLockFeatureTest.java b/brick/src/test/java/ch/cyberduck/core/brick/BrickLockFeatureTest.java index 08b421bbd7c..b0df3dd3c28 100644 --- a/brick/src/test/java/ch/cyberduck/core/brick/BrickLockFeatureTest.java +++ b/brick/src/test/java/ch/cyberduck/core/brick/BrickLockFeatureTest.java @@ -18,6 +18,7 @@ import ch.cyberduck.core.AlphanumericRandomStringService; import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledPasswordCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.exception.LockedException; @@ -55,7 +56,7 @@ public void testLock() throws Exception { final Path test = new Path(new DefaultHomeFinderService(session).find(), new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)); final BrickUploadFeature upload = new BrickUploadFeature(session, new BrickWriteFeature(session)); upload.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - new DisabledStreamListener(), status, new DisabledConnectionCallback()); + new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledConnectionCallback()); assertTrue(new BrickFindFeature(session).find(test)); final BrickLockFeature feature = new BrickLockFeature(session); final String lockid = feature.lock(test); diff --git a/brick/src/test/java/ch/cyberduck/core/brick/BrickMoveFeatureTest.java b/brick/src/test/java/ch/cyberduck/core/brick/BrickMoveFeatureTest.java index be94de9fdba..267a9f00e6c 100644 --- a/brick/src/test/java/ch/cyberduck/core/brick/BrickMoveFeatureTest.java +++ b/brick/src/test/java/ch/cyberduck/core/brick/BrickMoveFeatureTest.java @@ -18,6 +18,7 @@ import ch.cyberduck.core.AlphanumericRandomStringService; import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.PathAttributes; @@ -94,7 +95,7 @@ public void testMoveWithLock() throws Exception { IOUtils.write(random, local.getOutputStream(false)); final TransferStatus status = new TransferStatus().withLength(random.length); new BrickUploadFeature(session, new BrickWriteFeature(session)).upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - new DisabledStreamListener(), status, new DisabledLoginCallback()); + new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledLoginCallback()); local.delete(); final String lock = new BrickLockFeature(session).lock(test); final Path target = new BrickMoveFeature(session).move(test, diff --git a/brick/src/test/java/ch/cyberduck/core/brick/BrickReadFeatureTest.java b/brick/src/test/java/ch/cyberduck/core/brick/BrickReadFeatureTest.java index f52ec01b866..9802c8b2835 100644 --- a/brick/src/test/java/ch/cyberduck/core/brick/BrickReadFeatureTest.java +++ b/brick/src/test/java/ch/cyberduck/core/brick/BrickReadFeatureTest.java @@ -18,6 +18,7 @@ import ch.cyberduck.core.AlphanumericRandomStringService; import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.brick.io.swagger.client.model.FileEntity; @@ -104,7 +105,7 @@ public void testReadRange() throws Exception { final TransferStatus upload = new TransferStatus().withLength(content.length); upload.setExists(true); new BrickUploadFeature(session, new BrickWriteFeature(session)).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), upload, + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), upload, new DisabledConnectionCallback()); final TransferStatus status = new TransferStatus(); status.setLength(content.length); @@ -136,7 +137,7 @@ public void testReadRangeUnknownLength() throws Exception { final TransferStatus upload = new TransferStatus().withLength(content.length); upload.setExists(true); new BrickUploadFeature(session, new BrickWriteFeature(session)).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), upload, + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), upload, new DisabledConnectionCallback()); final TransferStatus status = new TransferStatus(); status.setLength(-1L); diff --git a/brick/src/test/java/ch/cyberduck/core/brick/BrickThresholdUploadFeatureTest.java b/brick/src/test/java/ch/cyberduck/core/brick/BrickThresholdUploadFeatureTest.java index 45bf247682e..9b6915ca2cb 100644 --- a/brick/src/test/java/ch/cyberduck/core/brick/BrickThresholdUploadFeatureTest.java +++ b/brick/src/test/java/ch/cyberduck/core/brick/BrickThresholdUploadFeatureTest.java @@ -19,6 +19,7 @@ import ch.cyberduck.core.BytecountStreamListener; import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.PathAttributes; @@ -54,7 +55,7 @@ public void testUploadZeroLength() throws Exception { status.setLength(content.length); final BytecountStreamListener count = new BytecountStreamListener(); feature.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - count, status, new DisabledLoginCallback()); + new DisabledProgressListener(), count, status, new DisabledLoginCallback()); assertEquals(content.length, count.getSent()); assertTrue(new BrickFindFeature(session).find(test)); final PathAttributes attributes = new BrickAttributesFinderFeature(session).find(test); @@ -80,7 +81,7 @@ public void testUpload() throws Exception { status.setLength(content.length); final BytecountStreamListener count = new BytecountStreamListener(); feature.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - count, status, new DisabledLoginCallback()); + new DisabledProgressListener(), count, status, new DisabledLoginCallback()); assertEquals(content.length, count.getSent()); assertTrue(status.isComplete()); assertTrue(new BrickFindFeature(session).find(test)); diff --git a/brick/src/test/java/ch/cyberduck/core/brick/BrickUploadFeatureTest.java b/brick/src/test/java/ch/cyberduck/core/brick/BrickUploadFeatureTest.java index 8cbeddd2216..e7db1d6f8ac 100644 --- a/brick/src/test/java/ch/cyberduck/core/brick/BrickUploadFeatureTest.java +++ b/brick/src/test/java/ch/cyberduck/core/brick/BrickUploadFeatureTest.java @@ -19,6 +19,7 @@ import ch.cyberduck.core.BytecountStreamListener; import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.PathAttributes; @@ -56,7 +57,7 @@ public void testUploadSmallPart() throws Exception { status.setMime("text/plain"); final BytecountStreamListener count = new BytecountStreamListener(); feature.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - count, status, new DisabledLoginCallback()); + new DisabledProgressListener(), count, status, new DisabledLoginCallback()); assertEquals(content.length, count.getSent()); assertTrue(status.isComplete()); assertNotSame(PathAttributes.EMPTY, status.getResponse()); @@ -85,7 +86,7 @@ public void testUploadSinglePart() throws Exception { status.setMime("text/plain"); final BytecountStreamListener count = new BytecountStreamListener(); feature.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - count, status, new DisabledLoginCallback()); + new DisabledProgressListener(), count, status, new DisabledLoginCallback()); assertEquals(content.length, count.getSent()); assertTrue(status.isComplete()); assertNotSame(PathAttributes.EMPTY, status.getResponse()); @@ -112,7 +113,7 @@ public void testUploadMultipleParts() throws Exception { final TransferStatus status = new TransferStatus(); status.setLength(content.length); final BytecountStreamListener count = new BytecountStreamListener(); - feature.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), count, status, new DisabledConnectionCallback()); + feature.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, status, new DisabledConnectionCallback()); assertEquals(content.length, count.getSent()); assertTrue(status.isComplete()); assertNotSame(PathAttributes.EMPTY, status.getResponse()); diff --git a/brick/src/test/java/ch/cyberduck/core/worker/CopyWorkerTest.java b/brick/src/test/java/ch/cyberduck/core/worker/CopyWorkerTest.java index 32842d4111e..3e73c7c16b3 100644 --- a/brick/src/test/java/ch/cyberduck/core/worker/CopyWorkerTest.java +++ b/brick/src/test/java/ch/cyberduck/core/worker/CopyWorkerTest.java @@ -59,7 +59,7 @@ public void testCopyFile() throws Exception { IOUtils.write(random, local.getOutputStream(false)); final TransferStatus status = new TransferStatus().withLength(random.length); new BrickUploadFeature(session, new BrickWriteFeature(session)).upload(source, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - new DisabledStreamListener(), status, new DisabledLoginCallback()); + new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledLoginCallback()); assertTrue(new BrickFindFeature(session).find(source)); final CopyWorker worker = new CopyWorker(Collections.singletonMap(source, target), new SessionPool.SingleSessionPool(session), PathCache.empty(), new DisabledProgressListener(), new DisabledConnectionCallback()); worker.run(session); @@ -79,7 +79,7 @@ public void testCopyFileToDirectory() throws Exception { IOUtils.write(random, local.getOutputStream(false)); final TransferStatus status = new TransferStatus().withLength(random.length); new BrickUploadFeature(session, new BrickWriteFeature(session)).upload(sourceFile, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - new DisabledStreamListener(), status, new DisabledLoginCallback()); + new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledLoginCallback()); assertTrue(new BrickFindFeature(session).find(sourceFile)); final Path targetFolder = new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)); final Path targetFile = new Path(targetFolder, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)); @@ -105,7 +105,7 @@ public void testCopyDirectory() throws Exception { IOUtils.write(random, local.getOutputStream(false)); final TransferStatus status = new TransferStatus().withLength(random.length); new BrickUploadFeature(session, new BrickWriteFeature(session)).upload(sourceFile, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - new DisabledStreamListener(), status, new DisabledLoginCallback()); + new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledLoginCallback()); assertTrue(new BrickFindFeature(session).find(folder)); assertTrue(new BrickFindFeature(session).find(sourceFile)); final Path targetFolder = new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)); diff --git a/core/src/main/java/ch/cyberduck/core/features/Upload.java b/core/src/main/java/ch/cyberduck/core/features/Upload.java index 3e6c74c122d..61de4e03d14 100644 --- a/core/src/main/java/ch/cyberduck/core/features/Upload.java +++ b/core/src/main/java/ch/cyberduck/core/features/Upload.java @@ -18,6 +18,7 @@ import ch.cyberduck.core.ConnectionCallback; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; +import ch.cyberduck.core.ProgressListener; import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.io.BandwidthThrottle; import ch.cyberduck.core.io.StreamListener; @@ -29,15 +30,16 @@ public interface Upload { /** * Copy file on disk to server * - * @param file File on server - * @param local File on local disk - * @param throttle Bandwidth management - * @param listener Progress callback - * @param status Transfer status holder - * @param callback Prompt + * @param file File on server + * @param local File on local disk + * @param throttle Bandwidth management + * @param progress + * @param streamListener Progress callback + * @param status Transfer status holder + * @param callback Prompt * @see AttributesAdapter#toAttributes(Reply) */ - Reply upload(Path file, Local local, BandwidthThrottle throttle, StreamListener listener, + Reply upload(Path file, Local local, BandwidthThrottle throttle, final ProgressListener progress, StreamListener streamListener, TransferStatus status, ConnectionCallback callback) throws BackgroundException; /** diff --git a/core/src/main/java/ch/cyberduck/core/http/HttpUploadFeature.java b/core/src/main/java/ch/cyberduck/core/http/HttpUploadFeature.java index 9c72256ef86..67160171123 100644 --- a/core/src/main/java/ch/cyberduck/core/http/HttpUploadFeature.java +++ b/core/src/main/java/ch/cyberduck/core/http/HttpUploadFeature.java @@ -21,6 +21,7 @@ import ch.cyberduck.core.Local; import ch.cyberduck.core.LocaleFactory; import ch.cyberduck.core.Path; +import ch.cyberduck.core.ProgressListener; import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.exception.ChecksumException; import ch.cyberduck.core.features.Upload; @@ -57,8 +58,8 @@ public HttpUploadFeature(final Write writer) { @Override public Reply upload(final Path file, final Local local, final BandwidthThrottle throttle, - final StreamListener listener, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException { - final Reply response = this.upload(file, local, throttle, listener, status, status, status, callback); + final ProgressListener progress, final StreamListener streamListener, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException { + final Reply response = this.upload(file, local, throttle, streamListener, status, status, status, callback); log.debug("Received response {}", response); return response; } diff --git a/core/src/main/java/ch/cyberduck/core/shared/DefaultUploadFeature.java b/core/src/main/java/ch/cyberduck/core/shared/DefaultUploadFeature.java index 02d48885c91..4ab897db737 100644 --- a/core/src/main/java/ch/cyberduck/core/shared/DefaultUploadFeature.java +++ b/core/src/main/java/ch/cyberduck/core/shared/DefaultUploadFeature.java @@ -21,6 +21,7 @@ import ch.cyberduck.core.ConnectionCallback; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; +import ch.cyberduck.core.ProgressListener; import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.features.Upload; import ch.cyberduck.core.features.Write; @@ -43,14 +44,14 @@ public DefaultUploadFeature(final Write writer) { @Override public Reply upload(final Path file, final Local local, final BandwidthThrottle throttle, - final StreamListener listener, final TransferStatus status, + final ProgressListener progress, final StreamListener streamListener, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException { final InputStream in = local.getInputStream(); final StatusOutputStream out = writer.write(file, status, callback); new StreamCopier(status, status) .withOffset(status.getOffset()) .withLimit(status.getLength()) - .withListener(listener) + .withListener(streamListener) .transfer(in, new ThrottledOutputStream(out, throttle)); return out.getStatus(); } 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 a80db4aa006..fa3d9e80120 100644 --- a/core/src/main/java/ch/cyberduck/core/transfer/UploadTransfer.java +++ b/core/src/main/java/ch/cyberduck/core/transfer/UploadTransfer.java @@ -333,7 +333,7 @@ public void transfer(final Session source, final Session destination, fina file.getName())); // Transfer final Upload upload = source.getFeature(Upload.class); - final Object reply = upload.upload(file, local, bandwidth, listener, segment, prompt); + final Object reply = upload.upload(file, local, bandwidth, progress, listener, segment, prompt); } } 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 f1095032093..f7760e68cd5 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 @@ -46,6 +46,7 @@ import ch.cyberduck.core.preferences.HostPreferences; import ch.cyberduck.core.preferences.PreferencesReader; import ch.cyberduck.core.transfer.AutoTransferConnectionLimiter; +import ch.cyberduck.core.transfer.Speedometer; import ch.cyberduck.core.transfer.TransferPathFilter; import ch.cyberduck.core.transfer.TransferStatus; import ch.cyberduck.core.transfer.symlink.SymlinkResolver; @@ -258,8 +259,13 @@ public void complete(final Path file, final Local local, if(local.exists()) { local.delete(); } + final Speedometer meter = new Speedometer(); + long concatLength = 0L; for(Iterator iterator = segments.iterator(); iterator.hasNext(); ) { final TransferStatus segmentStatus = iterator.next(); + concatLength += segmentStatus.getLength(); + listener.message(String.format("%s (%s)", MessageFormat.format(LocaleFactory.localizedString("Finalize {0}", "Status"), + file.getName()), meter.getProgress(false, status.getLength(), concatLength))); // Segment final Local segmentFile = segmentStatus.getRename().local; log.info("Append segment {} to {}", segmentFile, local); diff --git a/core/src/main/java/ch/cyberduck/core/vault/registry/VaultRegistryUploadFeature.java b/core/src/main/java/ch/cyberduck/core/vault/registry/VaultRegistryUploadFeature.java index dbd22a8c6f7..a5f94cccc96 100644 --- a/core/src/main/java/ch/cyberduck/core/vault/registry/VaultRegistryUploadFeature.java +++ b/core/src/main/java/ch/cyberduck/core/vault/registry/VaultRegistryUploadFeature.java @@ -18,6 +18,7 @@ import ch.cyberduck.core.ConnectionCallback; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; +import ch.cyberduck.core.ProgressListener; import ch.cyberduck.core.Session; import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.features.Upload; @@ -41,8 +42,8 @@ public VaultRegistryUploadFeature(final Session session, final Upload @Override @SuppressWarnings("unchecked") - public Output upload(final Path file, final Local local, final BandwidthThrottle throttle, final StreamListener listener, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException { - return (Output) registry.find(session, file).getFeature(session, Upload.class, proxy).upload(file, local, throttle, listener, status, callback); + public Output upload(final Path file, final Local local, final BandwidthThrottle throttle, final ProgressListener progress, final StreamListener streamListener, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException { + return (Output) registry.find(session, file).getFeature(session, Upload.class, proxy).upload(file, local, throttle, progress, streamListener, status, callback); } @Override diff --git a/core/src/test/java/ch/cyberduck/core/NullUploadFeature.java b/core/src/test/java/ch/cyberduck/core/NullUploadFeature.java index b48506153ee..fe77e311871 100644 --- a/core/src/test/java/ch/cyberduck/core/NullUploadFeature.java +++ b/core/src/test/java/ch/cyberduck/core/NullUploadFeature.java @@ -23,7 +23,7 @@ public class NullUploadFeature implements Upload { @Override - public Void upload(final Path file, final Local local, final BandwidthThrottle throttle, final StreamListener listener, + public Void upload(final Path file, final Local local, final BandwidthThrottle throttle, final ProgressListener progress, final StreamListener streamListener, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException { return null; } diff --git a/cryptomator/src/main/java/ch/cyberduck/core/cryptomator/features/CryptoUploadFeature.java b/cryptomator/src/main/java/ch/cyberduck/core/cryptomator/features/CryptoUploadFeature.java index 5f85471ad6b..4c677786be3 100644 --- a/cryptomator/src/main/java/ch/cyberduck/core/cryptomator/features/CryptoUploadFeature.java +++ b/cryptomator/src/main/java/ch/cyberduck/core/cryptomator/features/CryptoUploadFeature.java @@ -18,6 +18,7 @@ import ch.cyberduck.core.ConnectionCallback; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; +import ch.cyberduck.core.ProgressListener; import ch.cyberduck.core.Session; import ch.cyberduck.core.cryptomator.CryptoTransferStatus; import ch.cyberduck.core.cryptomator.CryptoVault; @@ -41,8 +42,8 @@ public CryptoUploadFeature(final Session session, final Upload delegat } @Override - public Reply upload(final Path file, final Local local, final BandwidthThrottle throttle, final StreamListener listener, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException { - return proxy.upload(vault.encrypt(session, file), local, throttle, listener, status.withDestinationLength(new CryptoTransferStatus(vault, status).getLength()), callback); + public Reply upload(final Path file, final Local local, final BandwidthThrottle throttle, final ProgressListener progress, final StreamListener streamListener, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException { + return proxy.upload(vault.encrypt(session, file), local, throttle, progress, streamListener, status.withDestinationLength(new CryptoTransferStatus(vault, status).getLength()), callback); } @Override diff --git a/ctera/src/test/java/ch/cyberduck/core/ctera/CteraReadFeatureTest.java b/ctera/src/test/java/ch/cyberduck/core/ctera/CteraReadFeatureTest.java index 9f576c91d6b..14521ef5a22 100644 --- a/ctera/src/test/java/ch/cyberduck/core/ctera/CteraReadFeatureTest.java +++ b/ctera/src/test/java/ch/cyberduck/core/ctera/CteraReadFeatureTest.java @@ -19,6 +19,7 @@ import ch.cyberduck.core.AlphanumericRandomStringService; import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.dav.DAVUploadFeature; @@ -76,7 +77,7 @@ public void testReadChunkedTransfer() throws Exception { IOUtils.write(content, out); out.close(); new DAVUploadFeature(session).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), new TransferStatus().withLength(content.length), new DisabledConnectionCallback()); // Unknown length in status @@ -123,7 +124,7 @@ public void testReadRange() throws Exception { IOUtils.write(content, out); out.close(); new DAVUploadFeature(session).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), new TransferStatus().withLength(content.length), new DisabledConnectionCallback()); final TransferStatus status = new TransferStatus(); @@ -151,7 +152,7 @@ public void testReadRangeUnknownLength() throws Exception { IOUtils.write(content, out); out.close(); new DAVUploadFeature(session).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), new TransferStatus().withLength(content.length), new DisabledConnectionCallback()); final TransferStatus status = new TransferStatus(); diff --git a/ctera/src/test/java/ch/cyberduck/core/ctera/CteraWriteFeatureTest.java b/ctera/src/test/java/ch/cyberduck/core/ctera/CteraWriteFeatureTest.java index dd4c3f3ff8c..ccb566b2075 100644 --- a/ctera/src/test/java/ch/cyberduck/core/ctera/CteraWriteFeatureTest.java +++ b/ctera/src/test/java/ch/cyberduck/core/ctera/CteraWriteFeatureTest.java @@ -5,6 +5,7 @@ import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledListProgressListener; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.PathAttributes; @@ -58,7 +59,7 @@ public void testReadWrite() throws Exception { final Path test = new Path(folder, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)); final HttpUploadFeature upload = new DAVUploadFeature(session); upload.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - new DisabledStreamListener(), status, new DisabledConnectionCallback()); + new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledConnectionCallback()); assertTrue(session.getFeature(Find.class).find(test)); assertEquals(content.length, new CteraListService(session).list(test.getParent(), new DisabledListProgressListener()) .find(new SimplePathPredicate(test)).attributes().getSize(), 0L); @@ -98,7 +99,7 @@ public void testReplaceContent() throws Exception { final TransferStatus status = new TransferStatus(); status.setLength(content.length); upload.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - new DisabledStreamListener(), status, new DisabledConnectionCallback()); + new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledConnectionCallback()); } final PathAttributes attr1 = new CteraAttributesFinderFeature(session).find(test); Thread.sleep(1000L); @@ -110,7 +111,7 @@ public void testReplaceContent() throws Exception { final TransferStatus status = new TransferStatus(); status.setLength(content.length); upload.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - new DisabledStreamListener(), status, new DisabledConnectionCallback()); + new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledConnectionCallback()); } final PathAttributes attr2 = new CteraAttributesFinderFeature(session).find(test); assertEquals(101L, attr2.getSize()); diff --git a/dracoon/src/main/java/ch/cyberduck/core/sds/SDSDirectS3UploadFeature.java b/dracoon/src/main/java/ch/cyberduck/core/sds/SDSDirectS3UploadFeature.java index 7d796c1322b..0145fe5ab5f 100644 --- a/dracoon/src/main/java/ch/cyberduck/core/sds/SDSDirectS3UploadFeature.java +++ b/dracoon/src/main/java/ch/cyberduck/core/sds/SDSDirectS3UploadFeature.java @@ -21,6 +21,7 @@ import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.PathContainerService; +import ch.cyberduck.core.ProgressListener; import ch.cyberduck.core.UUIDRandomStringService; import ch.cyberduck.core.concurrency.Interruptibles; import ch.cyberduck.core.exception.BackgroundException; @@ -109,7 +110,7 @@ public SDSDirectS3UploadFeature(final SDSSession session, final SDSNodeIdProvide } @Override - public Node upload(final Path file, final Local local, final BandwidthThrottle throttle, final StreamListener listener, + public Node upload(final Path file, final Local local, final BandwidthThrottle throttle, final ProgressListener progress, final StreamListener streamListener, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException { final ThreadPool pool = ThreadPoolFactory.get("multipart", concurrency); try { @@ -148,11 +149,11 @@ public Node upload(final Path file, final Local local, final BandwidthThrottle t final FileBuffer buffer = new FileBuffer(temporary); new StreamCopier(status, StreamProgress.noop).withAutoclose(false).withLimit(length) .transfer(in, new BufferOutputStream(buffer)); - parts.add(this.submit(pool, file, temporary, buffer, throttle, listener, status, + parts.add(this.submit(pool, file, temporary, buffer, throttle, streamListener, status, presignedUrl.getUrl(), presignedUrl.getPartNumber(), 0L, length, callback)); } else { - parts.add(this.submit(pool, file, local, Buffer.noop, throttle, listener, status, + parts.add(this.submit(pool, file, local, Buffer.noop, throttle, streamListener, status, presignedUrl.getUrl(), presignedUrl.getPartNumber(), offset, length, callback)); } remaining -= length; diff --git a/dracoon/src/test/java/ch/cyberduck/core/sds/SDSDeleteFeatureTest.java b/dracoon/src/test/java/ch/cyberduck/core/sds/SDSDeleteFeatureTest.java index eac9afe3ed6..8e15fc59b00 100644 --- a/dracoon/src/test/java/ch/cyberduck/core/sds/SDSDeleteFeatureTest.java +++ b/dracoon/src/test/java/ch/cyberduck/core/sds/SDSDeleteFeatureTest.java @@ -18,6 +18,7 @@ import ch.cyberduck.core.AbstractPath; import ch.cyberduck.core.AlphanumericRandomStringService; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.PathAttributes; @@ -150,7 +151,7 @@ public void testDeleteEicar() throws Exception { status.setLength(eicar.length); final SDSDirectS3UploadFeature feature = new SDSDirectS3UploadFeature(session, nodeid, new SDSDelegatingWriteFeature(session, nodeid, new SDSDirectS3WriteFeature(session, nodeid))); final Node node = feature.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - new DisabledStreamListener(), status, new DisabledLoginCallback()); + new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledLoginCallback()); assertTrue(new SDSFindFeature(session, nodeid).find(test)); final PathAttributes attributes = new SDSAttributesFinderFeature(session, nodeid).find(test); assertEquals(eicar.length, attributes.getSize()); diff --git a/dracoon/src/test/java/ch/cyberduck/core/sds/SDSDirectS3UploadFeatureTest.java b/dracoon/src/test/java/ch/cyberduck/core/sds/SDSDirectS3UploadFeatureTest.java index 84c20cdf3c8..c3e49aec597 100644 --- a/dracoon/src/test/java/ch/cyberduck/core/sds/SDSDirectS3UploadFeatureTest.java +++ b/dracoon/src/test/java/ch/cyberduck/core/sds/SDSDirectS3UploadFeatureTest.java @@ -20,6 +20,7 @@ import ch.cyberduck.core.Credentials; import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Host; import ch.cyberduck.core.Local; import ch.cyberduck.core.LoginOptions; @@ -81,7 +82,7 @@ public HttpResponseOutputStream write(final Path file, final TransferStatu status.setLength(random.length); try { feature.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - new DisabledStreamListener(), status, new DisabledLoginCallback()); + new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledLoginCallback()); fail(); } catch(ConnectionCanceledException e) { @@ -109,7 +110,7 @@ public void testUploadZeroByteFile() throws Exception { final TransferStatus status = new TransferStatus(); status.setLength(random.length); feature.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - new DisabledStreamListener(), status, new DisabledLoginCallback()); + new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledLoginCallback()); assertTrue(new SDSFindFeature(session, nodeid).find(test)); final PathAttributes attributes = new SDSAttributesFinderFeature(session, nodeid).find(test); assertEquals(random.length, attributes.getSize()); @@ -129,7 +130,7 @@ public void testUploadMissingTargetDirectory() throws Exception { new DefaultLocalTouchFeature().touch(local); final TransferStatus status = new TransferStatus(); assertThrows(NotfoundException.class, () -> feature.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - new DisabledStreamListener(), status, new DisabledLoginCallback())); + new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledLoginCallback())); local.delete(); } @@ -148,7 +149,7 @@ public void testUploadBelowMultipartSize() throws Exception { final TransferStatus status = new TransferStatus(); status.setLength(random.length); final Node node = feature.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - new DisabledStreamListener(), status, new DisabledLoginCallback()); + new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledLoginCallback()); assertTrue(new SDSFindFeature(session, nodeid).find(test)); final PathAttributes attributes = new SDSAttributesFinderFeature(session, nodeid).find(test); assertEquals(random.length, attributes.getSize()); @@ -172,7 +173,7 @@ public void testUploadExactMultipartSize() throws Exception { final TransferStatus status = new TransferStatus(); status.setLength(random.length); final Node node = feature.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - new DisabledStreamListener(), status, new DisabledLoginCallback()); + new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledLoginCallback()); assertTrue(status.isComplete()); assertNotSame(PathAttributes.EMPTY, status.getResponse()); assertTrue(new SDSFindFeature(session, nodeid).find(test)); @@ -198,7 +199,7 @@ public void testUploadMultipleParts() throws Exception { final TransferStatus status = new TransferStatus(); status.setLength(random.length); final Node node = feature.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - new DisabledStreamListener(), status, new DisabledLoginCallback()); + new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledLoginCallback()); assertTrue(status.isComplete()); assertNotSame(PathAttributes.EMPTY, status.getResponse()); assertTrue(new SDSFindFeature(session, nodeid).find(test)); @@ -227,7 +228,7 @@ public void testTripleCryptUploadBelowMultipartSize() throws Exception { final SDSEncryptionBulkFeature bulk = new SDSEncryptionBulkFeature(session, nodeid); bulk.pre(Transfer.Type.upload, Collections.singletonMap(new TransferItem(test, local), status), new DisabledConnectionCallback()); final Node node = feature.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - new DisabledStreamListener(), status, new DisabledLoginCallback()); + new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledLoginCallback()); assertTrue(status.isComplete()); assertNotSame(PathAttributes.EMPTY, status.getResponse()); assertTrue(new SDSFindFeature(session, nodeid).find(test)); @@ -266,7 +267,7 @@ public void testTripleCryptUploadExactMultipartSize() throws Exception { final SDSEncryptionBulkFeature bulk = new SDSEncryptionBulkFeature(session, nodeid); bulk.pre(Transfer.Type.upload, Collections.singletonMap(new TransferItem(test, local), status), new DisabledConnectionCallback()); final Node node = feature.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - new DisabledStreamListener(), status, new DisabledLoginCallback()); + new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledLoginCallback()); assertTrue(status.isComplete()); assertNotSame(PathAttributes.EMPTY, status.getResponse()); assertTrue(new SDSFindFeature(session, nodeid).find(test)); @@ -305,7 +306,7 @@ public void testTripleCryptUploadMultipleParts() throws Exception { final SDSEncryptionBulkFeature bulk = new SDSEncryptionBulkFeature(session, nodeid); bulk.pre(Transfer.Type.upload, Collections.singletonMap(new TransferItem(test, local), status), new DisabledConnectionCallback()); final Node node = feature.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - new DisabledStreamListener(), status, new DisabledLoginCallback()); + new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledLoginCallback()); assertTrue(status.isComplete()); assertNotSame(PathAttributes.EMPTY, status.getResponse()); assertTrue(new SDSFindFeature(session, nodeid).find(test)); diff --git a/dracoon/src/test/java/ch/cyberduck/core/sds/SDSReadFeatureTest.java b/dracoon/src/test/java/ch/cyberduck/core/sds/SDSReadFeatureTest.java index 58f1b5ff59d..9e8ca3e1614 100644 --- a/dracoon/src/test/java/ch/cyberduck/core/sds/SDSReadFeatureTest.java +++ b/dracoon/src/test/java/ch/cyberduck/core/sds/SDSReadFeatureTest.java @@ -18,6 +18,7 @@ import ch.cyberduck.core.AlphanumericRandomStringService; import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.exception.NotfoundException; @@ -109,7 +110,7 @@ public void testReadRange() throws Exception { final TransferStatus upload = new TransferStatus().withLength(content.length); upload.setExists(true); new DefaultUploadFeature<>(new SDSDirectS3MultipartWriteFeature(session, nodeid)).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), upload, + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), upload, new DisabledConnectionCallback()); final TransferStatus status = new TransferStatus(); status.setLength(content.length); @@ -142,7 +143,7 @@ public void testReadRangeUnknownLength() throws Exception { final TransferStatus upload = new TransferStatus().withLength(content.length); upload.setExists(true); new DefaultUploadFeature<>(new SDSDirectS3MultipartWriteFeature(session, nodeid)).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), upload, + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), upload, new DisabledConnectionCallback()); final TransferStatus status = new TransferStatus(); status.setLength(-1L); diff --git a/dropbox/src/test/java/ch/cyberduck/core/dropbox/DropboxReadFeatureTest.java b/dropbox/src/test/java/ch/cyberduck/core/dropbox/DropboxReadFeatureTest.java index d6ebf02edaa..6bd6c3b072e 100644 --- a/dropbox/src/test/java/ch/cyberduck/core/dropbox/DropboxReadFeatureTest.java +++ b/dropbox/src/test/java/ch/cyberduck/core/dropbox/DropboxReadFeatureTest.java @@ -20,6 +20,7 @@ import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledListProgressListener; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.features.Delete; @@ -92,7 +93,7 @@ public void testReadRange() throws Exception { IOUtils.write(content, out); out.close(); new DefaultUploadFeature<>(new DropboxWriteFeature(session)).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), new TransferStatus().withLength(content.length), new DisabledConnectionCallback()); final TransferStatus status = new TransferStatus(); diff --git a/dropbox/src/test/java/ch/cyberduck/core/dropbox/DropboxUploadFeatureTest.java b/dropbox/src/test/java/ch/cyberduck/core/dropbox/DropboxUploadFeatureTest.java index 4589aa06542..3d451646329 100644 --- a/dropbox/src/test/java/ch/cyberduck/core/dropbox/DropboxUploadFeatureTest.java +++ b/dropbox/src/test/java/ch/cyberduck/core/dropbox/DropboxUploadFeatureTest.java @@ -19,6 +19,7 @@ import ch.cyberduck.core.AlphanumericRandomStringService; import ch.cyberduck.core.BytecountStreamListener; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.PathAttributes; @@ -60,7 +61,7 @@ public void testUploadSmall() throws Exception { status.setMime("text/plain"); final BytecountStreamListener count = new BytecountStreamListener(); final Metadata metadata = feature.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - count, status, new DisabledLoginCallback()); + new DisabledProgressListener(), count, status, new DisabledLoginCallback()); assertEquals(content.length, count.getSent()); assertTrue(status.isComplete()); assertTrue(new DropboxFindFeature(session).find(test)); diff --git a/eue/src/main/java/ch/cyberduck/core/eue/EueLargeUploadService.java b/eue/src/main/java/ch/cyberduck/core/eue/EueLargeUploadService.java index 07a3f6a8b70..1562a891f1c 100644 --- a/eue/src/main/java/ch/cyberduck/core/eue/EueLargeUploadService.java +++ b/eue/src/main/java/ch/cyberduck/core/eue/EueLargeUploadService.java @@ -20,6 +20,7 @@ import ch.cyberduck.core.Local; import ch.cyberduck.core.LocaleFactory; import ch.cyberduck.core.Path; +import ch.cyberduck.core.ProgressListener; import ch.cyberduck.core.concurrency.Interruptibles; import ch.cyberduck.core.eue.io.swagger.client.model.ResourceCreationResponseEntry; import ch.cyberduck.core.eue.io.swagger.client.model.UploadType; @@ -80,7 +81,7 @@ public EueLargeUploadService(final EueSession session, final EueResourceIdProvid } @Override - public EueWriteFeature.Chunk upload(final Path file, final Local local, final BandwidthThrottle throttle, final StreamListener listener, + public EueWriteFeature.Chunk upload(final Path file, final Local local, final BandwidthThrottle throttle, final ProgressListener progress, final StreamListener streamListener, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException { final ThreadPool pool = ThreadPoolFactory.get("multipart", concurrency); try { @@ -102,7 +103,7 @@ public EueWriteFeature.Chunk upload(final Path file, final Local local, final Ba } for(int partNumber = 1; remaining > 0; partNumber++) { final long length = Math.min(chunksize, remaining); - parts.add(this.submit(pool, file, local, throttle, listener, status, + parts.add(this.submit(pool, file, local, throttle, streamListener, status, uploadUri, resourceId, partNumber, offset, length, callback)); remaining -= length; offset += length; diff --git a/eue/src/main/java/ch/cyberduck/core/eue/EueSingleUploadService.java b/eue/src/main/java/ch/cyberduck/core/eue/EueSingleUploadService.java index a95a49ede45..645120206c9 100644 --- a/eue/src/main/java/ch/cyberduck/core/eue/EueSingleUploadService.java +++ b/eue/src/main/java/ch/cyberduck/core/eue/EueSingleUploadService.java @@ -18,6 +18,7 @@ import ch.cyberduck.core.ConnectionCallback; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; +import ch.cyberduck.core.ProgressListener; import ch.cyberduck.core.eue.io.swagger.client.model.ResourceCreationResponseEntry; import ch.cyberduck.core.eue.io.swagger.client.model.UploadType; import ch.cyberduck.core.exception.BackgroundException; @@ -48,7 +49,7 @@ public EueSingleUploadService(final EueSession session, final EueResourceIdProvi } @Override - public EueWriteFeature.Chunk upload(final Path file, final Local local, final BandwidthThrottle throttle, final StreamListener listener, + public EueWriteFeature.Chunk upload(final Path file, final Local local, final BandwidthThrottle throttle, final ProgressListener progress, final StreamListener streamListener, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException { final String uploadUri; final String resourceId; @@ -66,7 +67,7 @@ public EueWriteFeature.Chunk upload(final Path file, final Local local, final Ba status.setParameters(Collections.singletonMap(RESOURCE_ID, resourceId)); status.setUrl(uploadUri); status.setChecksum(writer.checksum(file, status).compute(local.getInputStream(), status)); - return super.upload(file, local, throttle, listener, status, callback); + return super.upload(file, local, throttle, progress, streamListener, status, callback); } @Override diff --git a/eue/src/main/java/ch/cyberduck/core/eue/EueThresholdUploadService.java b/eue/src/main/java/ch/cyberduck/core/eue/EueThresholdUploadService.java index 018ec8ea2cf..ad999e20180 100644 --- a/eue/src/main/java/ch/cyberduck/core/eue/EueThresholdUploadService.java +++ b/eue/src/main/java/ch/cyberduck/core/eue/EueThresholdUploadService.java @@ -21,6 +21,7 @@ import ch.cyberduck.core.ConnectionCallback; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; +import ch.cyberduck.core.ProgressListener; import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.features.Upload; import ch.cyberduck.core.features.Vault; @@ -53,18 +54,18 @@ public EueThresholdUploadService(final EueSession session, final EueResourceIdPr } @Override - public EueWriteFeature.Chunk upload(final Path file, Local local, final BandwidthThrottle throttle, final StreamListener listener, + public EueWriteFeature.Chunk upload(final Path file, Local local, final BandwidthThrottle throttle, final ProgressListener progress, final StreamListener streamListener, final TransferStatus status, final ConnectionCallback prompt) throws BackgroundException { if(status.getLength() >= threshold) { if(Vault.DISABLED == registry.find(session, file)) { // Only allow concurrent write of chunks when not uploading to vault. Write with default feature multiple 4MB chunks in parallel - return new EueLargeUploadService(session, fileid, writer).upload(file, local, throttle, listener, status, prompt); + return new EueLargeUploadService(session, fileid, writer).upload(file, local, throttle, progress, streamListener, status, prompt); } // Write with multipart write feature for known file length sequentially 4MB chunks - return new EueUploadService(session, fileid, writer).upload(file, local, throttle, listener, status, prompt); + return new EueUploadService(session, fileid, writer).upload(file, local, throttle, progress, streamListener, status, prompt); } // Write single chunk smaller than threshold - return new EueSingleUploadService(session, fileid, writer).upload(file, local, throttle, listener, status, prompt); + return new EueSingleUploadService(session, fileid, writer).upload(file, local, throttle, progress, streamListener, status, prompt); } @Override diff --git a/eue/src/test/java/ch/cyberduck/core/cryptomator/EueSingleUploadServiceTest.java b/eue/src/test/java/ch/cyberduck/core/cryptomator/EueSingleUploadServiceTest.java index 65ce6c6ce5b..5eb16a09c1f 100644 --- a/eue/src/test/java/ch/cyberduck/core/cryptomator/EueSingleUploadServiceTest.java +++ b/eue/src/test/java/ch/cyberduck/core/cryptomator/EueSingleUploadServiceTest.java @@ -22,6 +22,7 @@ import ch.cyberduck.core.DisabledLoginCallback; import ch.cyberduck.core.DisabledPasswordCallback; import ch.cyberduck.core.DisabledPasswordStore; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.cryptomator.features.CryptoReadFeature; @@ -85,7 +86,7 @@ public void testUploadVault() throws Exception { final CryptoUploadFeature feature = new CryptoUploadFeature<>(session, new EueSingleUploadService(session, fileid, new EueWriteFeature(session, fileid)), new EueWriteFeature(session, fileid), cryptomator); - feature.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), count, writeStatus, null); + feature.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, writeStatus, null); assertEquals(content.length, count.getSent()); assertTrue(writeStatus.isComplete()); assertTrue(cryptomator.getFeature(session, Find.class, new EueFindFeature(session, fileid)).find(test)); diff --git a/eue/src/test/java/ch/cyberduck/core/cryptomator/EueThresholdUploadServiceTest.java b/eue/src/test/java/ch/cyberduck/core/cryptomator/EueThresholdUploadServiceTest.java index 1c5083dc0c3..f6dca9a896a 100644 --- a/eue/src/test/java/ch/cyberduck/core/cryptomator/EueThresholdUploadServiceTest.java +++ b/eue/src/test/java/ch/cyberduck/core/cryptomator/EueThresholdUploadServiceTest.java @@ -21,6 +21,7 @@ import ch.cyberduck.core.DisabledLoginCallback; import ch.cyberduck.core.DisabledPasswordCallback; import ch.cyberduck.core.DisabledPasswordStore; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.cryptomator.features.CryptoBulkFeature; @@ -91,7 +92,7 @@ public void testUploadVault() throws Exception { final CryptoUploadFeature feature = new CryptoUploadFeature<>(session, new EueThresholdUploadService(session, fileid, registry), new EueWriteFeature(session, fileid), cryptomator); - feature.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), count, writeStatus, new DisabledConnectionCallback()); + feature.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, writeStatus, new DisabledConnectionCallback()); assertEquals(content.length, count.getSent()); assertTrue(writeStatus.isComplete()); assertTrue(cryptomator.getFeature(session, Find.class, new EueFindFeature(session, fileid)).find(test)); @@ -128,7 +129,7 @@ public void testUploadVaultWithBulkFeature() throws Exception { final CryptoUploadFeature feature = new CryptoUploadFeature<>(session, new EueThresholdUploadService(session, fileid, registry), new EueWriteFeature(session, fileid), cryptomator); - feature.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), count, writeStatus, new DisabledConnectionCallback()); + feature.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, writeStatus, new DisabledConnectionCallback()); assertEquals(content.length, count.getSent()); assertTrue(writeStatus.isComplete()); assertTrue(cryptomator.getFeature(session, Find.class, new EueFindFeature(session, fileid)).find(test)); diff --git a/eue/src/test/java/ch/cyberduck/core/cryptomator/EueUploadServiceTest.java b/eue/src/test/java/ch/cyberduck/core/cryptomator/EueUploadServiceTest.java index 440b62e14c6..19b58d0958d 100644 --- a/eue/src/test/java/ch/cyberduck/core/cryptomator/EueUploadServiceTest.java +++ b/eue/src/test/java/ch/cyberduck/core/cryptomator/EueUploadServiceTest.java @@ -22,6 +22,7 @@ import ch.cyberduck.core.DisabledLoginCallback; import ch.cyberduck.core.DisabledPasswordCallback; import ch.cyberduck.core.DisabledPasswordStore; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.cryptomator.features.CryptoBulkFeature; @@ -91,7 +92,7 @@ public void testUploadVault() throws Exception { final CryptoUploadFeature feature = new CryptoUploadFeature<>(session, new EueUploadService(session, fileid, new EueMultipartWriteFeature(session, fileid)), new EueMultipartWriteFeature(session, fileid), cryptomator); - feature.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), count, writeStatus, new DisabledConnectionCallback()); + feature.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, writeStatus, new DisabledConnectionCallback()); assertEquals(content.length, count.getSent()); assertTrue(writeStatus.isComplete()); assertTrue(cryptomator.getFeature(session, Find.class, new EueFindFeature(session, fileid)).find(test)); @@ -127,7 +128,7 @@ public void testUploadVaultWithBulkFeature() throws Exception { final CryptoUploadFeature feature = new CryptoUploadFeature<>(session, new EueUploadService(session, fileid, new EueMultipartWriteFeature(session, fileid)), new EueMultipartWriteFeature(session, fileid), cryptomator); - feature.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), count, writeStatus, new DisabledConnectionCallback()); + feature.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, writeStatus, new DisabledConnectionCallback()); assertEquals(content.length, count.getSent()); assertTrue(writeStatus.isComplete()); assertTrue(cryptomator.getFeature(session, Find.class, new EueFindFeature(session, fileid)).find(test)); diff --git a/eue/src/test/java/ch/cyberduck/core/eue/EueCopyFeatureTest.java b/eue/src/test/java/ch/cyberduck/core/eue/EueCopyFeatureTest.java index db05e4a6ed6..daf6b1841b7 100644 --- a/eue/src/test/java/ch/cyberduck/core/eue/EueCopyFeatureTest.java +++ b/eue/src/test/java/ch/cyberduck/core/eue/EueCopyFeatureTest.java @@ -19,6 +19,7 @@ import ch.cyberduck.core.AlphanumericRandomStringService; import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.PathAttributes; @@ -173,7 +174,7 @@ public void testCopyToExistingFile() throws Exception { IOUtils.write(random, local.getOutputStream(false)); final TransferStatus status = new TransferStatus().withLength(random.length); final EueWriteFeature.Chunk upload = new EueSingleUploadService(session, fileid, new EueWriteFeature(session, fileid)).upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - new DisabledStreamListener(), status, new DisabledLoginCallback()); + new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledLoginCallback()); assertNotNull(upload.getResourceId()); local.delete(); assertTrue(new EueFindFeature(session, fileid).find(test)); diff --git a/eue/src/test/java/ch/cyberduck/core/eue/EueLargeUploadServiceTest.java b/eue/src/test/java/ch/cyberduck/core/eue/EueLargeUploadServiceTest.java index a3e017d01b0..2ca84680086 100644 --- a/eue/src/test/java/ch/cyberduck/core/eue/EueLargeUploadServiceTest.java +++ b/eue/src/test/java/ch/cyberduck/core/eue/EueLargeUploadServiceTest.java @@ -20,6 +20,7 @@ import ch.cyberduck.core.BytecountStreamListener; import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.PathAttributes; @@ -55,7 +56,7 @@ public void testUploadLargeFileInChunks() throws Exception { final TransferStatus status = new TransferStatus(); status.setLength(content.length); final BytecountStreamListener count = new BytecountStreamListener(); - final EueWriteFeature.Chunk uploadResponse = s.upload(file, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), count, status, new DisabledConnectionCallback()); + final EueWriteFeature.Chunk uploadResponse = s.upload(file, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, status, new DisabledConnectionCallback()); assertNotNull(uploadResponse.getCdash64()); assertEquals(content.length, count.getSent()); assertEquals(PathAttributes.EMPTY, status.getResponse()); diff --git a/eue/src/test/java/ch/cyberduck/core/eue/EueSingleUploadServiceTest.java b/eue/src/test/java/ch/cyberduck/core/eue/EueSingleUploadServiceTest.java index f6e55f482c1..94645368399 100644 --- a/eue/src/test/java/ch/cyberduck/core/eue/EueSingleUploadServiceTest.java +++ b/eue/src/test/java/ch/cyberduck/core/eue/EueSingleUploadServiceTest.java @@ -20,6 +20,7 @@ import ch.cyberduck.core.BytecountStreamListener; import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.features.Delete; @@ -53,7 +54,7 @@ public void testUploadSimpleFile() throws Exception { IOUtils.write(content, local.getOutputStream(false)); final TransferStatus status = new TransferStatus().withLength(content.length); final BytecountStreamListener count = new BytecountStreamListener(); - service.upload(file, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), count, status, new DisabledConnectionCallback()); + service.upload(file, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, status, new DisabledConnectionCallback()); assertEquals(content.length, count.getSent()); assertTrue(status.isComplete()); assertTrue(new EueFindFeature(session, fileid).find(file)); @@ -67,7 +68,7 @@ public void testUploadSimpleFile() throws Exception { IOUtils.write(content, local.getOutputStream(false)); final TransferStatus status = new TransferStatus().withLength(content.length).exists(true); final BytecountStreamListener count = new BytecountStreamListener(); - service.upload(file, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), count, status, new DisabledConnectionCallback()); + service.upload(file, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, status, new DisabledConnectionCallback()); assertEquals(content.length, count.getSent()); assertTrue(status.isComplete()); assertTrue(new EueFindFeature(session, fileid).find(file)); diff --git a/eue/src/test/java/ch/cyberduck/core/eue/EueThresholdUploadServiceTest.java b/eue/src/test/java/ch/cyberduck/core/eue/EueThresholdUploadServiceTest.java index 2c341f9ece9..3ea1474329d 100644 --- a/eue/src/test/java/ch/cyberduck/core/eue/EueThresholdUploadServiceTest.java +++ b/eue/src/test/java/ch/cyberduck/core/eue/EueThresholdUploadServiceTest.java @@ -20,6 +20,7 @@ import ch.cyberduck.core.BytecountStreamListener; import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.features.Delete; @@ -55,7 +56,7 @@ public void testUploadSimpleFile() throws Exception { final TransferStatus status = new TransferStatus(); status.setLength(content.length); final BytecountStreamListener count = new BytecountStreamListener(); - service.upload(file, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), count, status, new DisabledConnectionCallback()); + service.upload(file, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, status, new DisabledConnectionCallback()); assertEquals(content.length, count.getSent()); assertTrue(status.isComplete()); assertTrue(new EueFindFeature(session, fileid).find(file)); @@ -81,7 +82,7 @@ public void testUploadLargeFileInChunks() throws Exception { final TransferStatus status = new TransferStatus(); status.setLength(content.length); final BytecountStreamListener count = new BytecountStreamListener(); - service.upload(file, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), count, status, new DisabledConnectionCallback()); + service.upload(file, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, status, new DisabledConnectionCallback()); assertEquals(content.length, count.getSent()); assertTrue(status.isComplete()); assertTrue(new EueFindFeature(session, fileid).find(file)); diff --git a/eue/src/test/java/ch/cyberduck/core/eue/EueUploadServiceTest.java b/eue/src/test/java/ch/cyberduck/core/eue/EueUploadServiceTest.java index 2878205bdfd..0c1cc77ea99 100644 --- a/eue/src/test/java/ch/cyberduck/core/eue/EueUploadServiceTest.java +++ b/eue/src/test/java/ch/cyberduck/core/eue/EueUploadServiceTest.java @@ -20,6 +20,7 @@ import ch.cyberduck.core.BytecountStreamListener; import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.features.Delete; @@ -54,7 +55,7 @@ public void testUploadLargeFileInChunks() throws Exception { final TransferStatus status = new TransferStatus(); status.setLength(content.length); final BytecountStreamListener count = new BytecountStreamListener(); - final EueWriteFeature.Chunk uploadResponse = s.upload(file, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), count, status, new DisabledConnectionCallback()); + final EueWriteFeature.Chunk uploadResponse = s.upload(file, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, status, new DisabledConnectionCallback()); assertNotNull(uploadResponse.getCdash64()); assertEquals(content.length, count.getSent()); assertTrue(status.isComplete()); diff --git a/ftp/src/test/java/ch/cyberduck/core/shared/DefaultUploadFeatureTest.java b/ftp/src/test/java/ch/cyberduck/core/shared/DefaultUploadFeatureTest.java index 1d3323e03f2..df06cdacbe4 100644 --- a/ftp/src/test/java/ch/cyberduck/core/shared/DefaultUploadFeatureTest.java +++ b/ftp/src/test/java/ch/cyberduck/core/shared/DefaultUploadFeatureTest.java @@ -19,6 +19,7 @@ import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.features.Delete; @@ -58,14 +59,14 @@ public void testTransferAppend() throws Exception { { final TransferStatus status = new TransferStatus().withLength(content.length / 2); final Void reply = new DefaultUploadFeature<>(new FTPWriteFeature(session)).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledConnectionCallback()); } { final TransferStatus status = new TransferStatus().withLength(content.length / 2).withOffset(content.length / 2).append(true); final Void reply = new DefaultUploadFeature(new FTPWriteFeature(session)).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledConnectionCallback()); } diff --git a/googledrive/src/test/java/ch/cyberduck/core/googledrive/DriveReadFeatureTest.java b/googledrive/src/test/java/ch/cyberduck/core/googledrive/DriveReadFeatureTest.java index 75ea0bc4de1..a923bf03859 100644 --- a/googledrive/src/test/java/ch/cyberduck/core/googledrive/DriveReadFeatureTest.java +++ b/googledrive/src/test/java/ch/cyberduck/core/googledrive/DriveReadFeatureTest.java @@ -19,6 +19,7 @@ import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledListProgressListener; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.SimplePathPredicate; @@ -76,7 +77,7 @@ public void testReadRange() throws Exception { out.close(); final DriveFileIdProvider fileid = new DriveFileIdProvider(session); new DriveUploadFeature(session, fileid).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), new TransferStatus().withLength(content.length), new DisabledConnectionCallback()); final TransferStatus status = new TransferStatus(); diff --git a/googledrive/src/test/java/ch/cyberduck/core/googledrive/DriveUploadFeatureTest.java b/googledrive/src/test/java/ch/cyberduck/core/googledrive/DriveUploadFeatureTest.java index a4ece92af10..bc0f0cfb979 100644 --- a/googledrive/src/test/java/ch/cyberduck/core/googledrive/DriveUploadFeatureTest.java +++ b/googledrive/src/test/java/ch/cyberduck/core/googledrive/DriveUploadFeatureTest.java @@ -19,6 +19,7 @@ import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledListProgressListener; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.features.Delete; @@ -56,7 +57,7 @@ public void testWrite() throws Exception { final Path test = new Path(DriveHomeFinderService.MYDRIVE_FOLDER, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)); final DriveFileIdProvider fileid = new DriveFileIdProvider(session); final DriveUploadFeature upload = new DriveUploadFeature(session, fileid); - upload.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), + upload.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledConnectionCallback()); test.attributes().setFileId(fileid.getFileId(test)); assertTrue(session.getFeature(Find.class).find(test)); diff --git a/googlestorage/src/test/java/ch/cyberduck/core/googlestorage/DefaultUploadFeatureTest.java b/googlestorage/src/test/java/ch/cyberduck/core/googlestorage/DefaultUploadFeatureTest.java index fc704e22fe5..5383d5701a9 100644 --- a/googlestorage/src/test/java/ch/cyberduck/core/googlestorage/DefaultUploadFeatureTest.java +++ b/googlestorage/src/test/java/ch/cyberduck/core/googlestorage/DefaultUploadFeatureTest.java @@ -18,6 +18,7 @@ import ch.cyberduck.core.AlphanumericRandomStringService; import ch.cyberduck.core.DisabledListProgressListener; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.PathAttributes; @@ -60,7 +61,7 @@ public void testUpload() throws Exception { final TransferStatus status = new TransferStatus(); status.setLength(random.length); final StorageObject versionId = m.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - new DisabledStreamListener(), status, new DisabledLoginCallback()); + new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledLoginCallback()); assertTrue(new GoogleStorageFindFeature(session).find(test)); final PathAttributes attributes = new GoogleStorageListService(session).list(container, new DisabledListProgressListener()).find(new SimplePathPredicate(test)).attributes(); assertEquals(random.length, attributes.getSize()); diff --git a/i18n/src/main/resources/ar.lproj/Status.strings b/i18n/src/main/resources/ar.lproj/Status.strings index 82fd8d6725d..96981cf848a 100644 Binary files a/i18n/src/main/resources/ar.lproj/Status.strings and b/i18n/src/main/resources/ar.lproj/Status.strings differ diff --git a/i18n/src/main/resources/bg.lproj/Status.strings b/i18n/src/main/resources/bg.lproj/Status.strings index 83651b2e0f6..74ef24b07c5 100644 Binary files a/i18n/src/main/resources/bg.lproj/Status.strings and b/i18n/src/main/resources/bg.lproj/Status.strings differ diff --git a/i18n/src/main/resources/ca.lproj/Status.strings b/i18n/src/main/resources/ca.lproj/Status.strings index 2a40825a613..64995988122 100644 Binary files a/i18n/src/main/resources/ca.lproj/Status.strings and b/i18n/src/main/resources/ca.lproj/Status.strings differ diff --git a/i18n/src/main/resources/cs.lproj/Status.strings b/i18n/src/main/resources/cs.lproj/Status.strings index 7bcae358f41..46cbc0c83ec 100644 Binary files a/i18n/src/main/resources/cs.lproj/Status.strings and b/i18n/src/main/resources/cs.lproj/Status.strings differ diff --git a/i18n/src/main/resources/cy.lproj/Status.strings b/i18n/src/main/resources/cy.lproj/Status.strings index 5f6d4ee7b47..fddbf7d4db7 100644 Binary files a/i18n/src/main/resources/cy.lproj/Status.strings and b/i18n/src/main/resources/cy.lproj/Status.strings differ diff --git a/i18n/src/main/resources/da.lproj/Status.strings b/i18n/src/main/resources/da.lproj/Status.strings index ba351e6bfc6..b69ae2cca17 100644 Binary files a/i18n/src/main/resources/da.lproj/Status.strings and b/i18n/src/main/resources/da.lproj/Status.strings differ diff --git a/i18n/src/main/resources/de.lproj/Status.strings b/i18n/src/main/resources/de.lproj/Status.strings index ab8cfe8ac54..ea63d0a9d16 100644 Binary files a/i18n/src/main/resources/de.lproj/Status.strings and b/i18n/src/main/resources/de.lproj/Status.strings differ diff --git a/i18n/src/main/resources/el.lproj/Status.strings b/i18n/src/main/resources/el.lproj/Status.strings index 0038aa0228c..22f266294f1 100644 Binary files a/i18n/src/main/resources/el.lproj/Status.strings and b/i18n/src/main/resources/el.lproj/Status.strings differ diff --git a/i18n/src/main/resources/en.lproj/Status.strings b/i18n/src/main/resources/en.lproj/Status.strings index ffbd19c852c..72344514a12 100644 Binary files a/i18n/src/main/resources/en.lproj/Status.strings and b/i18n/src/main/resources/en.lproj/Status.strings differ diff --git a/i18n/src/main/resources/es.lproj/Status.strings b/i18n/src/main/resources/es.lproj/Status.strings index cd62c09eccf..dd7f6c3aa67 100644 Binary files a/i18n/src/main/resources/es.lproj/Status.strings and b/i18n/src/main/resources/es.lproj/Status.strings differ diff --git a/i18n/src/main/resources/et.lproj/Status.strings b/i18n/src/main/resources/et.lproj/Status.strings index 35b83acd715..e593951a15d 100644 Binary files a/i18n/src/main/resources/et.lproj/Status.strings and b/i18n/src/main/resources/et.lproj/Status.strings differ diff --git a/i18n/src/main/resources/fi.lproj/Status.strings b/i18n/src/main/resources/fi.lproj/Status.strings index d755f0f6c20..12ee1839084 100644 Binary files a/i18n/src/main/resources/fi.lproj/Status.strings and b/i18n/src/main/resources/fi.lproj/Status.strings differ diff --git a/i18n/src/main/resources/fr.lproj/Status.strings b/i18n/src/main/resources/fr.lproj/Status.strings index 6a5352c74c6..26c2278a204 100644 Binary files a/i18n/src/main/resources/fr.lproj/Status.strings and b/i18n/src/main/resources/fr.lproj/Status.strings differ diff --git a/i18n/src/main/resources/he.lproj/Status.strings b/i18n/src/main/resources/he.lproj/Status.strings index ae97ca84c4e..e675d296eb4 100644 Binary files a/i18n/src/main/resources/he.lproj/Status.strings and b/i18n/src/main/resources/he.lproj/Status.strings differ diff --git a/i18n/src/main/resources/hr.lproj/Status.strings b/i18n/src/main/resources/hr.lproj/Status.strings index 9651bc24a4b..c08341033f8 100644 Binary files a/i18n/src/main/resources/hr.lproj/Status.strings and b/i18n/src/main/resources/hr.lproj/Status.strings differ diff --git a/i18n/src/main/resources/hu.lproj/Status.strings b/i18n/src/main/resources/hu.lproj/Status.strings index 7e5b0da4b43..da2dea431af 100644 Binary files a/i18n/src/main/resources/hu.lproj/Status.strings and b/i18n/src/main/resources/hu.lproj/Status.strings differ diff --git a/i18n/src/main/resources/it.lproj/Status.strings b/i18n/src/main/resources/it.lproj/Status.strings index 75e89ea7fa9..d9e84e394a8 100644 Binary files a/i18n/src/main/resources/it.lproj/Status.strings and b/i18n/src/main/resources/it.lproj/Status.strings differ diff --git a/i18n/src/main/resources/ja.lproj/Status.strings b/i18n/src/main/resources/ja.lproj/Status.strings index 74671d61623..7d5dbd4578f 100644 Binary files a/i18n/src/main/resources/ja.lproj/Status.strings and b/i18n/src/main/resources/ja.lproj/Status.strings differ diff --git a/i18n/src/main/resources/ka.lproj/Status.strings b/i18n/src/main/resources/ka.lproj/Status.strings index 715fd93dde4..379a17a72e9 100644 Binary files a/i18n/src/main/resources/ka.lproj/Status.strings and b/i18n/src/main/resources/ka.lproj/Status.strings differ diff --git a/i18n/src/main/resources/ko.lproj/Status.strings b/i18n/src/main/resources/ko.lproj/Status.strings index 69f68c977ab..2d2b87aca8d 100644 Binary files a/i18n/src/main/resources/ko.lproj/Status.strings and b/i18n/src/main/resources/ko.lproj/Status.strings differ diff --git a/i18n/src/main/resources/lv.lproj/Status.strings b/i18n/src/main/resources/lv.lproj/Status.strings index bc7e5b5bff7..30c4b42547b 100644 Binary files a/i18n/src/main/resources/lv.lproj/Status.strings and b/i18n/src/main/resources/lv.lproj/Status.strings differ diff --git a/i18n/src/main/resources/nl.lproj/Status.strings b/i18n/src/main/resources/nl.lproj/Status.strings index 15c834e8bb8..7c81271385d 100644 Binary files a/i18n/src/main/resources/nl.lproj/Status.strings and b/i18n/src/main/resources/nl.lproj/Status.strings differ diff --git a/i18n/src/main/resources/no.lproj/Status.strings b/i18n/src/main/resources/no.lproj/Status.strings index beb9005fddd..0d534ce1ec2 100644 Binary files a/i18n/src/main/resources/no.lproj/Status.strings and b/i18n/src/main/resources/no.lproj/Status.strings differ diff --git a/i18n/src/main/resources/pl.lproj/Status.strings b/i18n/src/main/resources/pl.lproj/Status.strings index 749810fa2f3..e227b6e88d3 100644 Binary files a/i18n/src/main/resources/pl.lproj/Status.strings and b/i18n/src/main/resources/pl.lproj/Status.strings differ diff --git a/i18n/src/main/resources/pt_BR.lproj/Status.strings b/i18n/src/main/resources/pt_BR.lproj/Status.strings index 4eb2deabe5c..61c56936f5f 100644 Binary files a/i18n/src/main/resources/pt_BR.lproj/Status.strings and b/i18n/src/main/resources/pt_BR.lproj/Status.strings differ diff --git a/i18n/src/main/resources/pt_PT.lproj/Status.strings b/i18n/src/main/resources/pt_PT.lproj/Status.strings index 2a566854d80..35ee5c088e7 100644 Binary files a/i18n/src/main/resources/pt_PT.lproj/Status.strings and b/i18n/src/main/resources/pt_PT.lproj/Status.strings differ diff --git a/i18n/src/main/resources/ro.lproj/Status.strings b/i18n/src/main/resources/ro.lproj/Status.strings index b5baba2bd48..f96b35dc4ac 100644 Binary files a/i18n/src/main/resources/ro.lproj/Status.strings and b/i18n/src/main/resources/ro.lproj/Status.strings differ diff --git a/i18n/src/main/resources/ru.lproj/Status.strings b/i18n/src/main/resources/ru.lproj/Status.strings index 83a669db2be..6f5f2052063 100644 Binary files a/i18n/src/main/resources/ru.lproj/Status.strings and b/i18n/src/main/resources/ru.lproj/Status.strings differ diff --git a/i18n/src/main/resources/sk.lproj/Status.strings b/i18n/src/main/resources/sk.lproj/Status.strings index eab382f2611..5f7b6cec12b 100644 Binary files a/i18n/src/main/resources/sk.lproj/Status.strings and b/i18n/src/main/resources/sk.lproj/Status.strings differ diff --git a/i18n/src/main/resources/sl.lproj/Status.strings b/i18n/src/main/resources/sl.lproj/Status.strings index 992f1abfc0c..63b03010a51 100644 Binary files a/i18n/src/main/resources/sl.lproj/Status.strings and b/i18n/src/main/resources/sl.lproj/Status.strings differ diff --git a/i18n/src/main/resources/sr.lproj/Status.strings b/i18n/src/main/resources/sr.lproj/Status.strings index 28ef339ce7e..0730b924280 100644 Binary files a/i18n/src/main/resources/sr.lproj/Status.strings and b/i18n/src/main/resources/sr.lproj/Status.strings differ diff --git a/i18n/src/main/resources/sv.lproj/Status.strings b/i18n/src/main/resources/sv.lproj/Status.strings index ae668da365e..ee683495693 100644 Binary files a/i18n/src/main/resources/sv.lproj/Status.strings and b/i18n/src/main/resources/sv.lproj/Status.strings differ diff --git a/i18n/src/main/resources/ta_IN.lproj/Status.strings b/i18n/src/main/resources/ta_IN.lproj/Status.strings index 204fd7786be..774accf2cfa 100644 Binary files a/i18n/src/main/resources/ta_IN.lproj/Status.strings and b/i18n/src/main/resources/ta_IN.lproj/Status.strings differ diff --git a/i18n/src/main/resources/th.lproj/Status.strings b/i18n/src/main/resources/th.lproj/Status.strings index 80b47741263..c8efcf704d8 100644 Binary files a/i18n/src/main/resources/th.lproj/Status.strings and b/i18n/src/main/resources/th.lproj/Status.strings differ diff --git a/i18n/src/main/resources/tr.lproj/Status.strings b/i18n/src/main/resources/tr.lproj/Status.strings index 44c93439971..743adf20a75 100644 Binary files a/i18n/src/main/resources/tr.lproj/Status.strings and b/i18n/src/main/resources/tr.lproj/Status.strings differ diff --git a/i18n/src/main/resources/uk.lproj/Status.strings b/i18n/src/main/resources/uk.lproj/Status.strings index 1e608c78bed..84d27fb090f 100644 Binary files a/i18n/src/main/resources/uk.lproj/Status.strings and b/i18n/src/main/resources/uk.lproj/Status.strings differ diff --git a/i18n/src/main/resources/zh_CN.lproj/Status.strings b/i18n/src/main/resources/zh_CN.lproj/Status.strings index ed192fe37b1..1a3a3eb532b 100644 Binary files a/i18n/src/main/resources/zh_CN.lproj/Status.strings and b/i18n/src/main/resources/zh_CN.lproj/Status.strings differ diff --git a/i18n/src/main/resources/zh_TW.lproj/Status.strings b/i18n/src/main/resources/zh_TW.lproj/Status.strings index 0f15bdef3e5..e651b012f82 100644 Binary files a/i18n/src/main/resources/zh_TW.lproj/Status.strings and b/i18n/src/main/resources/zh_TW.lproj/Status.strings differ diff --git a/irods/src/main/java/ch/cyberduck/core/irods/IRODSUploadFeature.java b/irods/src/main/java/ch/cyberduck/core/irods/IRODSUploadFeature.java index 7ff73d48fa9..75a6b610d8c 100644 --- a/irods/src/main/java/ch/cyberduck/core/irods/IRODSUploadFeature.java +++ b/irods/src/main/java/ch/cyberduck/core/irods/IRODSUploadFeature.java @@ -22,6 +22,7 @@ import ch.cyberduck.core.Local; import ch.cyberduck.core.LocaleFactory; import ch.cyberduck.core.Path; +import ch.cyberduck.core.ProgressListener; import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.exception.ChecksumException; import ch.cyberduck.core.features.Upload; @@ -61,7 +62,7 @@ public IRODSUploadFeature(final IRODSSession session) { @Override public Checksum upload(final Path file, final Local local, final BandwidthThrottle throttle, - final StreamListener listener, final TransferStatus status, + final ProgressListener progress, final StreamListener streamListener, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException { try { final IRODSFileSystemAO fs = session.getClient(); @@ -78,7 +79,7 @@ public Checksum upload(final Path file, final Local local, final BandwidthThrott block.setTransferOptions(options); final DataTransferOperations transfer = fs.getIRODSAccessObjectFactory().getDataTransferOperations(fs.getIRODSAccount()); transfer.putOperation(new File(local.getAbsolute()), f, new DefaultTransferStatusCallbackListener( - status, listener, block + status, streamListener, block ), block); if(status.isComplete()) { final DataObjectChecksumUtilitiesAO checksum = fs diff --git a/irods/src/test/java/ch/cyberduck/core/irods/IRODSReadFeatureTest.java b/irods/src/test/java/ch/cyberduck/core/irods/IRODSReadFeatureTest.java index aa0d9352015..8b12968fdd0 100644 --- a/irods/src/test/java/ch/cyberduck/core/irods/IRODSReadFeatureTest.java +++ b/irods/src/test/java/ch/cyberduck/core/irods/IRODSReadFeatureTest.java @@ -22,6 +22,7 @@ import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledHostKeyCallback; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Host; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; @@ -34,7 +35,6 @@ import ch.cyberduck.core.io.DisabledStreamListener; import ch.cyberduck.core.io.StreamCopier; import ch.cyberduck.core.proxy.DisabledProxyFinder; -import ch.cyberduck.core.proxy.Proxy; import ch.cyberduck.core.serializer.impl.dd.ProfilePlistReader; import ch.cyberduck.core.shared.DefaultUploadFeature; import ch.cyberduck.core.transfer.TransferStatus; @@ -138,7 +138,7 @@ public void testReadRange() throws Exception { IOUtils.write(content, out); out.close(); new DefaultUploadFeature(new IRODSWriteFeature(session)).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), new TransferStatus().withLength(content.length), new DisabledConnectionCallback()); final TransferStatus status = new TransferStatus(); diff --git a/irods/src/test/java/ch/cyberduck/core/irods/IRODSUploadFeatureTest.java b/irods/src/test/java/ch/cyberduck/core/irods/IRODSUploadFeatureTest.java index 9dc06bfb4ec..fcb9c53fcee 100644 --- a/irods/src/test/java/ch/cyberduck/core/irods/IRODSUploadFeatureTest.java +++ b/irods/src/test/java/ch/cyberduck/core/irods/IRODSUploadFeatureTest.java @@ -23,6 +23,7 @@ import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledHostKeyCallback; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Host; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; @@ -85,7 +86,7 @@ public void testAppend() throws Exception { final TransferStatus status = new TransferStatus().withLength(content.length / 2); final BytecountStreamListener count = new BytecountStreamListener(); checksumPart1 = new IRODSUploadFeature(session).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), count, + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, status, new DisabledConnectionCallback()); assertEquals(content.length / 2, count.getSent()); @@ -93,7 +94,7 @@ test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), count, { final TransferStatus status = new TransferStatus().withLength(content.length / 2).withOffset(content.length / 2).append(true); checksumPart2 = new IRODSUploadFeature(session).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledConnectionCallback()); assertEquals(content.length / 2, status.getOffset()); @@ -133,7 +134,7 @@ public void testWrite() throws Exception { final TransferStatus copy = new TransferStatus(status); final BytecountStreamListener count = new BytecountStreamListener(); checksum = new IRODSUploadFeature(session).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), count, status, new DisabledConnectionCallback()); + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, status, new DisabledConnectionCallback()); assertTrue(status.isComplete()); assertEquals(content.length, count.getSent()); assertEquals(checksum, new MD5ChecksumCompute().compute(new FileInputStream(local.getAbsolute()), copy)); @@ -167,7 +168,7 @@ public void testInterruptStatus() throws Exception { final Path test = new Path(new IRODSHomeFinderService(session).find(), UUID.randomUUID().toString(), EnumSet.of(Path.Type.file)); final TransferStatus status = new TransferStatus().withLength(content.length); final Checksum checksum = new IRODSUploadFeature(session).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener() { + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener() { @Override public void sent(final long bytes) { super.sent(bytes); diff --git a/manta/src/test/java/ch/cyberduck/core/manta/MantaReadFeatureTest.java b/manta/src/test/java/ch/cyberduck/core/manta/MantaReadFeatureTest.java index 07903c44531..1086c44a91d 100644 --- a/manta/src/test/java/ch/cyberduck/core/manta/MantaReadFeatureTest.java +++ b/manta/src/test/java/ch/cyberduck/core/manta/MantaReadFeatureTest.java @@ -18,6 +18,7 @@ import ch.cyberduck.core.AlphanumericRandomStringService; import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.exception.NotfoundException; @@ -100,7 +101,7 @@ public void testReadRange() throws Exception { test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - new DisabledStreamListener(), + new DisabledProgressListener(), new DisabledStreamListener(), new TransferStatus().withLength(content.length), new DisabledConnectionCallback()); final TransferStatus status = new TransferStatus(); @@ -133,7 +134,7 @@ public void testReadRangeUnknownLength() throws Exception { IOUtils.write(content, out); out.close(); new DefaultUploadFeature<>(new MantaWriteFeature(session)).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), new TransferStatus().withLength(content.length), new DisabledConnectionCallback()); final TransferStatus status = new TransferStatus(); diff --git a/onedrive/src/test/java/ch/cyberduck/core/onedrive/GraphReadFeatureTest.java b/onedrive/src/test/java/ch/cyberduck/core/onedrive/GraphReadFeatureTest.java index 63c0293a4b2..03cd4437450 100644 --- a/onedrive/src/test/java/ch/cyberduck/core/onedrive/GraphReadFeatureTest.java +++ b/onedrive/src/test/java/ch/cyberduck/core/onedrive/GraphReadFeatureTest.java @@ -18,6 +18,7 @@ import ch.cyberduck.core.AlphanumericRandomStringService; import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.exception.NotfoundException; @@ -90,7 +91,7 @@ public void testReadRange() throws Exception { IOUtils.write(content, out); out.close(); new DefaultUploadFeature<>(new GraphWriteFeature(session, fileid)).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), new TransferStatus().withLength(content.length), new DisabledConnectionCallback()); final TransferStatus status = new TransferStatus(); @@ -133,7 +134,7 @@ public void testReadRangeUnknownLength() throws Exception { IOUtils.write(content, out); out.close(); new DefaultUploadFeature<>(new GraphWriteFeature(session, fileid)).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), new TransferStatus().withLength(content.length), new DisabledConnectionCallback()); final TransferStatus status = new TransferStatus(); diff --git a/openstack/src/main/java/ch/cyberduck/core/openstack/SwiftLargeObjectUploadFeature.java b/openstack/src/main/java/ch/cyberduck/core/openstack/SwiftLargeObjectUploadFeature.java index 5947cfd79db..6f237a76736 100644 --- a/openstack/src/main/java/ch/cyberduck/core/openstack/SwiftLargeObjectUploadFeature.java +++ b/openstack/src/main/java/ch/cyberduck/core/openstack/SwiftLargeObjectUploadFeature.java @@ -24,8 +24,10 @@ import ch.cyberduck.core.DefaultPathContainerService; import ch.cyberduck.core.DisabledListProgressListener; import ch.cyberduck.core.Local; +import ch.cyberduck.core.LocaleFactory; import ch.cyberduck.core.Path; import ch.cyberduck.core.PathContainerService; +import ch.cyberduck.core.ProgressListener; import ch.cyberduck.core.concurrency.Interruptibles; import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.exception.NotfoundException; @@ -48,6 +50,7 @@ import java.io.IOException; import java.security.MessageDigest; +import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -99,7 +102,7 @@ public SwiftLargeObjectUploadFeature(final SwiftSession session, @Override public StorageObject upload(final Path file, final Local local, final BandwidthThrottle throttle, - final StreamListener listener, + final ProgressListener progress, final StreamListener streamListener, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException { final ThreadPool pool = ThreadPoolFactory.get("multipart", concurrency); @@ -148,7 +151,7 @@ public StorageObject upload(final Path file, final Local local, } else { // Submit to queue - segments.add(this.submit(pool, segment, local, throttle, listener, status, offset, length, callback)); + segments.add(this.submit(pool, segment, local, throttle, streamListener, status, offset, length, callback)); log.debug("Segment {} submitted with size {} and offset {}", segment, length, offset); remaining -= length; offset += length; @@ -164,6 +167,8 @@ public StorageObject upload(final Path file, final Local local, // Create and upload the large object manifest. It is best to upload all the segments first and // then create or update the manifest. try { + progress.message(MessageFormat.format(LocaleFactory.localizedString("Finalize {0}", "Status"), + file.getName())); // Static Large Object. final String manifest = segmentService.manifest(containerService.getContainer(file).getName(), completed); log.debug("Creating SLO manifest {} for {}", manifest, file); diff --git a/openstack/src/main/java/ch/cyberduck/core/openstack/SwiftThresholdUploadService.java b/openstack/src/main/java/ch/cyberduck/core/openstack/SwiftThresholdUploadService.java index 1a0e6c61242..4b1ff06b250 100644 --- a/openstack/src/main/java/ch/cyberduck/core/openstack/SwiftThresholdUploadService.java +++ b/openstack/src/main/java/ch/cyberduck/core/openstack/SwiftThresholdUploadService.java @@ -20,6 +20,7 @@ import ch.cyberduck.core.ConnectionCallback; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; +import ch.cyberduck.core.ProgressListener; import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.features.Upload; import ch.cyberduck.core.features.Write; @@ -66,7 +67,7 @@ public Write.Append append(final Path file, final TransferStatus status) throws } @Override - public StorageObject upload(final Path file, final Local local, final BandwidthThrottle throttle, final StreamListener listener, + public StorageObject upload(final Path file, final Local local, final BandwidthThrottle throttle, final ProgressListener progress, final StreamListener streamListener, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException { final Upload feature; if(this.threshold(status)) { @@ -75,7 +76,7 @@ public StorageObject upload(final Path file, final Local local, final BandwidthT else { feature = new SwiftSmallObjectUploadFeature(session, writer); } - return feature.upload(file, local, throttle, listener, status, callback); + return feature.upload(file, local, throttle, progress, streamListener, status, callback); } protected boolean threshold(final TransferStatus status) { diff --git a/openstack/src/test/java/ch/cyberduck/core/cryptomator/SwiftLargeObjectUploadFeatureTest.java b/openstack/src/test/java/ch/cyberduck/core/cryptomator/SwiftLargeObjectUploadFeatureTest.java index d13cd483e93..f8b51afb451 100644 --- a/openstack/src/test/java/ch/cyberduck/core/cryptomator/SwiftLargeObjectUploadFeatureTest.java +++ b/openstack/src/test/java/ch/cyberduck/core/cryptomator/SwiftLargeObjectUploadFeatureTest.java @@ -22,6 +22,7 @@ import ch.cyberduck.core.DisabledLoginCallback; import ch.cyberduck.core.DisabledPasswordCallback; import ch.cyberduck.core.DisabledPasswordStore; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.cryptomator.features.CryptoListService; @@ -88,7 +89,7 @@ public void testLargeObjectUpload() throws Exception { writeStatus.setHeader(cryptomator.getFileHeaderCryptor().encryptHeader(header)); writeStatus.setLength(content.length); final BytecountStreamListener count = new BytecountStreamListener(); - m.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), count, writeStatus, null); + m.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, writeStatus, null); assertEquals(content.length, count.getSent()); assertTrue(writeStatus.isComplete()); assertEquals(content.length, writeStatus.getResponse().getSize()); diff --git a/openstack/src/test/java/ch/cyberduck/core/openstack/SwiftLargeObjectUploadFeatureTest.java b/openstack/src/test/java/ch/cyberduck/core/openstack/SwiftLargeObjectUploadFeatureTest.java index 75f995bffa1..9d89ac944cc 100644 --- a/openstack/src/test/java/ch/cyberduck/core/openstack/SwiftLargeObjectUploadFeatureTest.java +++ b/openstack/src/test/java/ch/cyberduck/core/openstack/SwiftLargeObjectUploadFeatureTest.java @@ -5,6 +5,7 @@ import ch.cyberduck.core.ConnectionCallback; import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.PathAttributes; @@ -75,7 +76,7 @@ protected void beforeRead(int n) throws IOException { } }; } - }, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), listener, status, new DisabledLoginCallback()); + }, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), listener, status, new DisabledLoginCallback()); } catch(BackgroundException e) { // Expected @@ -89,7 +90,7 @@ protected void beforeRead(int n) throws IOException { final TransferStatus append = new TransferStatus().append(true).withLength(content.length); new SwiftLargeObjectUploadFeature(session, new SwiftRegionService(session), new SwiftWriteFeature(session, new SwiftRegionService(session)), 1 * 1024L * 1024L, 1).upload(test, local, - new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), append, + new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), append, new DisabledLoginCallback()); assertEquals(content.length, append.getResponse().getSize()); assertTrue(new SwiftFindFeature(session).find(test)); @@ -134,7 +135,7 @@ public StorageObject upload(final Path file, final Local local, final BandwidthT final BytecountStreamListener listener = new BytecountStreamListener(); try { feature.upload(test, new Local(System.getProperty("java.io.tmpdir"), name), - new BandwidthThrottle(BandwidthThrottle.UNLIMITED), listener, status, new DisabledLoginCallback()); + new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), listener, status, new DisabledLoginCallback()); } catch(BackgroundException e) { // Expected @@ -150,7 +151,7 @@ public StorageObject upload(final Path file, final Local local, final BandwidthT final TransferStatus append = new TransferStatus().append(true).withLength(1024L * 1024L).withOffset(1024L * 1024L); feature.upload(test, local, - new BandwidthThrottle(BandwidthThrottle.UNLIMITED), listener, append, + new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), listener, append, new DisabledLoginCallback()); assertEquals(2 * 1024L * 1024L, listener.getSent()); assertTrue(append.isComplete()); @@ -195,7 +196,7 @@ public void testUploadOverwrite() throws Exception { new SwiftWriteFeature(session, regionService), (long) (content.length / 2), 4); final BytecountStreamListener count = new BytecountStreamListener(); - final StorageObject object = upload.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), count, + final StorageObject object = upload.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, status, new DisabledConnectionCallback()); assertEquals(Checksum.NONE, Checksum.parse(object.getMd5sum())); assertNotEquals(Checksum.NONE, new SwiftAttributesFinderFeature(session).find(test).getChecksum()); @@ -248,7 +249,7 @@ public void testUploadOverwrite() throws Exception { new SwiftWriteFeature(session, regionService), 1048576L, 4); final BytecountStreamListener count = new BytecountStreamListener(); - upload.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), count, + upload.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, status, new DisabledConnectionCallback()); assertTrue(status.isComplete()); diff --git a/osx/src/main/java/ch/cyberduck/ui/cocoa/controller/ProgressController.java b/osx/src/main/java/ch/cyberduck/ui/cocoa/controller/ProgressController.java index 5b64b7d0ec9..861204f47b2 100644 --- a/osx/src/main/java/ch/cyberduck/ui/cocoa/controller/ProgressController.java +++ b/osx/src/main/java/ch/cyberduck/ui/cocoa/controller/ProgressController.java @@ -59,24 +59,24 @@ public class ProgressController extends BundleController implements TransferListener, ProgressListener { private static final NSDictionary NORMAL_FONT_ATTRIBUTES = NSDictionary.dictionaryWithObjectsForKeys( - NSArray.arrayWithObjects( - NSFont.systemFontOfSize(NSFont.smallSystemFontSize()), - NSColor.controlTextColor(), - BundleController.PARAGRAPH_STYLE_LEFT_ALIGNMENT_TRUNCATE_TAIL), - NSArray.arrayWithObjects( - NSAttributedString.FontAttributeName, - NSAttributedString.ForegroundColorAttributeName, - NSAttributedString.ParagraphStyleAttributeName) + NSArray.arrayWithObjects( + NSFont.systemFontOfSize(NSFont.smallSystemFontSize()), + NSColor.controlTextColor(), + BundleController.PARAGRAPH_STYLE_LEFT_ALIGNMENT_TRUNCATE_TAIL), + NSArray.arrayWithObjects( + NSAttributedString.FontAttributeName, + NSAttributedString.ForegroundColorAttributeName, + NSAttributedString.ParagraphStyleAttributeName) ); private static final NSDictionary HIGHLIGHTED_FONT_ATTRIBUTES = NSDictionary.dictionaryWithObjectsForKeys( - NSArray.arrayWithObjects( - NSFont.systemFontOfSize(NSFont.smallSystemFontSize()), - NSColor.alternateSelectedControlTextColor(), - BundleController.PARAGRAPH_STYLE_LEFT_ALIGNMENT_TRUNCATE_TAIL), - NSArray.arrayWithObjects( - NSAttributedString.FontAttributeName, - NSAttributedString.ForegroundColorAttributeName, - NSAttributedString.ParagraphStyleAttributeName) + NSArray.arrayWithObjects( + NSFont.systemFontOfSize(NSFont.smallSystemFontSize()), + NSColor.alternateSelectedControlTextColor(), + BundleController.PARAGRAPH_STYLE_LEFT_ALIGNMENT_TRUNCATE_TAIL), + NSArray.arrayWithObjects( + NSAttributedString.FontAttributeName, + NSAttributedString.ForegroundColorAttributeName, + NSAttributedString.ParagraphStyleAttributeName) ); private static final NSImage RED_ICON = IconCacheFactory.get().iconNamed("NSStatusUnavailable"); private static final NSImage GREEN_ICON = IconCacheFactory.get().iconNamed("NSStatusAvailable"); @@ -128,11 +128,11 @@ public ProgressController(final Transfer transfer) { @Override public void awakeFromNib() { this.setProgress(MessageFormat.format(LocaleFactory.localizedString("{0} of {1}"), - sizeFormatter.format(transfer.getTransferred()), - sizeFormatter.format(transfer.getSize()))); + sizeFormatter.format(transfer.getTransferred()), + sizeFormatter.format(transfer.getSize()))); this.setMessage(StringUtils.EMPTY); this.setStatus(LocaleFactory.localizedString(transfer.isComplete() ? - String.format("%s complete", StringUtils.capitalize(transfer.getType().name())) : "Transfer incomplete", "Status")); + String.format("%s complete", StringUtils.capitalize(transfer.getType().name())) : "Transfer incomplete", "Status")); super.awakeFromNib(); } @@ -176,10 +176,10 @@ public void run() { progressBar.setHidden(true); setMessage(StringUtils.EMPTY); setProgress(MessageFormat.format(LocaleFactory.localizedString("{0} of {1}"), - sizeFormatter.format(transfer.getTransferred()), - sizeFormatter.format(transfer.getSize()))); + sizeFormatter.format(transfer.getTransferred()), + sizeFormatter.format(transfer.getSize()))); setStatus(LocaleFactory.localizedString(LocaleFactory.localizedString(transfer.isComplete() ? - String.format("%s complete", StringUtils.capitalize(transfer.getType().name())) : "Transfer incomplete", "Status"), "Status")); + String.format("%s complete", StringUtils.capitalize(transfer.getType().name())) : "Transfer incomplete", "Status"), "Status")); statusIconView.setImage(transfer.isComplete() ? GREEN_ICON : RED_ICON); } }); @@ -193,13 +193,18 @@ public void transferDidProgress(final Transfer transfer, final TransferProgress invoke(new DefaultMainAction() { @Override public void run() { - if(transferred > 0 && size > 0) { - progressBar.setIndeterminate(false); - progressBar.setMaxValue(size); - progressBar.setDoubleValue(transferred); + if(transfer.isComplete()) { + progressBar.setIndeterminate(true); } else { - progressBar.setIndeterminate(true); + if(progress.isComplete()) { + progressBar.setIndeterminate(true); + } + else { + progressBar.setIndeterminate(false); + progressBar.setMaxValue(size); + progressBar.setDoubleValue(transferred); + } } } }); @@ -210,7 +215,7 @@ private void setProgress(final String message) { @Override public void run() { progressField.setAttributedStringValue(NSAttributedString.attributedStringWithAttributes( - message, TRUNCATE_MIDDLE_ATTRIBUTES)); + message, TRUNCATE_MIDDLE_ATTRIBUTES)); } }); } @@ -231,12 +236,12 @@ public void setMessage(final String message) { text = message; } messageField.setAttributedStringValue(NSAttributedString.attributedStringWithAttributes( - text, TRUNCATE_MIDDLE_ATTRIBUTES)); + text, TRUNCATE_MIDDLE_ATTRIBUTES)); } private void setStatus(final String status) { statusField.setAttributedStringValue(NSAttributedString.attributedStringWithAttributes(status, - TRUNCATE_MIDDLE_ATTRIBUTES)); + TRUNCATE_MIDDLE_ATTRIBUTES)); } public boolean isHighlighted() { @@ -268,18 +273,18 @@ public void setFilesPopup(final NSPopUpButton p) { for(int i = 0; i < items.size(); i++) { final TransferItem entry = items.get(i); this.filesPopup.addItemWithTitle(i == 0 && items.size() > 1 ? - String.format("%s (%d more)", entry.remote.getName(), items.size() - 1) : entry.remote.getName()); + String.format("%s (%d more)", entry.remote.getName(), items.size() - 1) : entry.remote.getName()); } this.filesPopupMenuDelegate = new TransferMenuDelegate(transfer); this.filesPopup.menu().setDelegate(this.filesPopupMenuDelegate.id()); notificationCenter.addObserver(this.id(), - Foundation.selector("filesPopupWillShow:"), - NSPopUpButton.PopUpButtonWillPopUpNotification, - this.filesPopup.id()); + Foundation.selector("filesPopupWillShow:"), + NSPopUpButton.PopUpButtonWillPopUpNotification, + this.filesPopup.id()); notificationCenter.addObserver(this.id(), - Foundation.selector("filesPopupWillHide:"), - "NSMenuDidEndTrackingNotification", - this.filesPopup.menu().id()); + Foundation.selector("filesPopupWillHide:"), + "NSMenuDidEndTrackingNotification", + this.filesPopup.menu().id()); } @Action diff --git a/owncloud/src/test/java/ch/cyberduck/core/cryptomator/OcisUploadFeatureTest.java b/owncloud/src/test/java/ch/cyberduck/core/cryptomator/OcisUploadFeatureTest.java index 1a9adeb469f..79171e661c9 100644 --- a/owncloud/src/test/java/ch/cyberduck/core/cryptomator/OcisUploadFeatureTest.java +++ b/owncloud/src/test/java/ch/cyberduck/core/cryptomator/OcisUploadFeatureTest.java @@ -22,6 +22,7 @@ import ch.cyberduck.core.DisabledLoginCallback; import ch.cyberduck.core.DisabledPasswordCallback; import ch.cyberduck.core.DisabledPasswordStore; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.cryptomator.features.CryptoReadFeature; @@ -92,7 +93,7 @@ public void testUploadVault() throws Exception { writeStatus.setLength(content.length); final Path test = new Path(vault, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)); final BytecountStreamListener counter = new BytecountStreamListener(); - service.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), counter, writeStatus, new DisabledConnectionCallback()); + service.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), counter, writeStatus, new DisabledConnectionCallback()); assertEquals(content.length, counter.getSent()); assertTrue(writeStatus.isComplete()); assertTrue(cryptomator.getFeature(session, Find.class, new DAVFindFeature(session)).find(test)); diff --git a/owncloud/src/test/java/ch/cyberduck/core/owncloud/OcisUploadFeatureTest.java b/owncloud/src/test/java/ch/cyberduck/core/owncloud/OcisUploadFeatureTest.java index e2e29a92a6e..6abe258afb1 100644 --- a/owncloud/src/test/java/ch/cyberduck/core/owncloud/OcisUploadFeatureTest.java +++ b/owncloud/src/test/java/ch/cyberduck/core/owncloud/OcisUploadFeatureTest.java @@ -20,6 +20,7 @@ import ch.cyberduck.core.BytecountStreamListener; import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.PathAttributes; @@ -73,7 +74,7 @@ public void testUploadLargeFileInChunks() throws Exception { status.setLength(content.length); final BytecountStreamListener count = new BytecountStreamListener(); assertFalse(feature.append(file, status).append); - final Void response = feature.upload(file, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), count, status, new DisabledConnectionCallback()); + final Void response = feature.upload(file, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, status, new DisabledConnectionCallback()); assertTrue(status.isComplete()); assertEquals(content.length, count.getSent()); assertTrue(status.isComplete()); @@ -95,7 +96,7 @@ public void testUploadLargeFileInChunks() throws Exception { status.setLength(content.length); final BytecountStreamListener count = new BytecountStreamListener(); assertFalse(feature.append(file, status).append); - final Void response = feature.upload(file, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), count, status, new DisabledConnectionCallback()); + final Void response = feature.upload(file, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, status, new DisabledConnectionCallback()); assertTrue(status.isComplete()); assertEquals(content.length, count.getSent()); assertTrue(status.isComplete()); diff --git a/s3/src/main/java/ch/cyberduck/core/s3/S3MultipartUploadService.java b/s3/src/main/java/ch/cyberduck/core/s3/S3MultipartUploadService.java index 760b4dcf20c..0b371dfd45a 100644 --- a/s3/src/main/java/ch/cyberduck/core/s3/S3MultipartUploadService.java +++ b/s3/src/main/java/ch/cyberduck/core/s3/S3MultipartUploadService.java @@ -23,6 +23,7 @@ import ch.cyberduck.core.LocaleFactory; import ch.cyberduck.core.Path; import ch.cyberduck.core.PathContainerService; +import ch.cyberduck.core.ProgressListener; import ch.cyberduck.core.concurrency.Interruptibles; import ch.cyberduck.core.exception.AccessDeniedException; import ch.cyberduck.core.exception.BackgroundException; @@ -97,7 +98,7 @@ public S3MultipartUploadService(final S3Session session, final Write @Override public StorageObject upload(final Path file, final Local local, final BandwidthThrottle throttle, - final StreamListener listener, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException { + final ProgressListener progress, final StreamListener streamListener, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException { final S3Protocol.AuthenticationHeaderSignatureVersion signatureVersion = session.getSignatureVersion(); switch(signatureVersion) { case AWS4HMACSHA256: @@ -67,13 +68,13 @@ public StorageObject upload(final Path file, final Local local, final BandwidthT break; } try { - return super.upload(file, local, throttle, listener, status, callback); + return super.upload(file, local, throttle, progress, streamListener, status, callback); } catch(InteroperabilityException e) { if(!session.getSignatureVersion().equals(signatureVersion)) { // Retry if upload fails with Header "x-amz-content-sha256" set to the hex-encoded SHA256 hash of the // request payload is required for AWS Version 4 request signing - return this.upload(file, local, throttle, listener, status, callback); + return this.upload(file, local, throttle, progress, streamListener, status, callback); } throw e; } diff --git a/s3/src/main/java/ch/cyberduck/core/s3/S3ThresholdUploadService.java b/s3/src/main/java/ch/cyberduck/core/s3/S3ThresholdUploadService.java index 21712bad6e0..0e819c7d16d 100644 --- a/s3/src/main/java/ch/cyberduck/core/s3/S3ThresholdUploadService.java +++ b/s3/src/main/java/ch/cyberduck/core/s3/S3ThresholdUploadService.java @@ -21,6 +21,7 @@ import ch.cyberduck.core.ConnectionCallback; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; +import ch.cyberduck.core.ProgressListener; import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.exception.InteroperabilityException; import ch.cyberduck.core.exception.NotfoundException; @@ -64,17 +65,17 @@ public Write.Append append(final Path file, final TransferStatus status) throws } @Override - public StorageObject upload(final Path file, Local local, final BandwidthThrottle throttle, final StreamListener listener, + public StorageObject upload(final Path file, Local local, final BandwidthThrottle throttle, final ProgressListener progress, final StreamListener streamListener, final TransferStatus status, final ConnectionCallback prompt) throws BackgroundException { if(this.threshold(status)) { try { - return new S3MultipartUploadService(session, writer, acl).upload(file, local, throttle, listener, status, prompt); + return new S3MultipartUploadService(session, writer, acl).upload(file, local, throttle, progress, streamListener, status, prompt); } catch(NotfoundException | InteroperabilityException e) { log.warn("Failure {} using multipart upload. Fallback to single upload.", e.getMessage()); status.append(false); try { - return new S3SingleUploadService(session, writer).upload(file, local, throttle, listener, status, prompt); + return new S3SingleUploadService(session, writer).upload(file, local, throttle, progress, streamListener, status, prompt); } catch(BackgroundException f) { log.warn("Failure {} using single upload. Throw original multipart failure {}", e, e); @@ -83,7 +84,7 @@ public StorageObject upload(final Path file, Local local, final BandwidthThrottl } } // Use single upload service - return new S3SingleUploadService(session, writer).upload(file, local, throttle, listener, status, prompt); + return new S3SingleUploadService(session, writer).upload(file, local, throttle, progress, streamListener, status, prompt); } protected boolean threshold(final TransferStatus status) { diff --git a/s3/src/test/java/ch/cyberduck/core/cryptomator/S3MultipartUploadServiceTest.java b/s3/src/test/java/ch/cyberduck/core/cryptomator/S3MultipartUploadServiceTest.java index 15f0cf22552..7fa691a53f1 100644 --- a/s3/src/test/java/ch/cyberduck/core/cryptomator/S3MultipartUploadServiceTest.java +++ b/s3/src/test/java/ch/cyberduck/core/cryptomator/S3MultipartUploadServiceTest.java @@ -21,6 +21,7 @@ import ch.cyberduck.core.DisabledLoginCallback; import ch.cyberduck.core.DisabledPasswordCallback; import ch.cyberduck.core.DisabledPasswordStore; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.cryptomator.features.CryptoBulkFeature; @@ -92,7 +93,7 @@ public void testUploadSinglePart() throws Exception { writeStatus.setHeader(cryptomator.getFileHeaderCryptor().encryptHeader(header)); writeStatus.setLength(content.length); final BytecountStreamListener count = new BytecountStreamListener(); - m.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), count, writeStatus, null); + m.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, writeStatus, null); assertEquals(content.length, count.getSent()); assertTrue(writeStatus.isComplete()); assertTrue(cryptomator.getFeature(session, Find.class, new S3FindFeature(session, acl)).find(test)); @@ -126,7 +127,7 @@ public void testUpload() throws Exception { final FileHeader header = cryptomator.getFileHeaderCryptor().create(); writeStatus.setHeader(cryptomator.getFileHeaderCryptor().encryptHeader(header)); writeStatus.setLength(content.length); - m.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), writeStatus, null); + m.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), writeStatus, null); assertTrue(writeStatus.isComplete()); assertTrue(cryptomator.getFeature(session, Find.class, new S3FindFeature(session, acl)).find(test)); assertEquals(content.length, cryptomator.getFeature(session, AttributesFinder.class, new S3AttributesFinderFeature(session, acl)).find(test).getSize()); @@ -159,7 +160,7 @@ public void testUploadWithBulk() throws Exception { new S3WriteFeature(session, acl), cryptomator); final Local local = new Local(System.getProperty("java.io.tmpdir"), UUID.randomUUID().toString()); IOUtils.write(content, local.getOutputStream(false)); - m.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), writeStatus, null); + m.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), writeStatus, null); assertTrue(writeStatus.isComplete()); assertTrue(cryptomator.getFeature(session, Find.class, new S3FindFeature(session, acl)).find(test)); assertEquals(content.length, cryptomator.getFeature(session, AttributesFinder.class, new S3AttributesFinderFeature(session, acl)).find(test).getSize()); diff --git a/s3/src/test/java/ch/cyberduck/core/cryptomator/S3SingleUploadServiceTest.java b/s3/src/test/java/ch/cyberduck/core/cryptomator/S3SingleUploadServiceTest.java index 348454d9ecf..a316e8186de 100644 --- a/s3/src/test/java/ch/cyberduck/core/cryptomator/S3SingleUploadServiceTest.java +++ b/s3/src/test/java/ch/cyberduck/core/cryptomator/S3SingleUploadServiceTest.java @@ -21,6 +21,7 @@ import ch.cyberduck.core.DisabledLoginCallback; import ch.cyberduck.core.DisabledPasswordCallback; import ch.cyberduck.core.DisabledPasswordStore; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.cryptomator.features.CryptoReadFeature; @@ -84,7 +85,7 @@ public void testUploadVault() throws Exception { final CryptoUploadFeature m = new CryptoUploadFeature<>(session, new S3SingleUploadService(session, new S3WriteFeature(session, acl)), new S3WriteFeature(session, acl), cryptomator); - m.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), count, writeStatus, null); + m.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, writeStatus, null); assertEquals(content.length, count.getSent()); assertTrue(writeStatus.isComplete()); assertTrue(cryptomator.getFeature(session, Find.class, new S3FindFeature(session, acl)).find(test)); diff --git a/s3/src/test/java/ch/cyberduck/core/s3/AbstractS3Test.java b/s3/src/test/java/ch/cyberduck/core/s3/AbstractS3Test.java index cd2731e5fe1..800e2e1b4c1 100644 --- a/s3/src/test/java/ch/cyberduck/core/s3/AbstractS3Test.java +++ b/s3/src/test/java/ch/cyberduck/core/s3/AbstractS3Test.java @@ -104,7 +104,7 @@ public void setupVirtualHost() throws Exception { final ProtocolFactory factory = new ProtocolFactory(new HashSet<>(Collections.singleton(new S3Protocol()))); final Profile profile = new ProfilePlistReader(factory).read( this.getClass().getResourceAsStream("/S3 (HTTPS).cyberduckprofile")); - final Host host = new Host(profile, "test-eu-west-3-cyberduck.s3.amazonaws.com", new Credentials( + final Host host = new Host(profile, "test.eu-west-3-cyberduck.s3.amazonaws.com", new Credentials( PROPERTIES.get("s3.key"), PROPERTIES.get("s3.secret") )); virtualhost = new S3Session(host, new DefaultX509TrustManager(), new DefaultX509KeyManager()); diff --git a/s3/src/test/java/ch/cyberduck/core/s3/S3MultipartUploadServiceTest.java b/s3/src/test/java/ch/cyberduck/core/s3/S3MultipartUploadServiceTest.java index 127a7337a14..01482be3d66 100644 --- a/s3/src/test/java/ch/cyberduck/core/s3/S3MultipartUploadServiceTest.java +++ b/s3/src/test/java/ch/cyberduck/core/s3/S3MultipartUploadServiceTest.java @@ -6,6 +6,7 @@ import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledListProgressListener; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.PathAttributes; @@ -61,7 +62,7 @@ public void testUploadSinglePart() throws Exception { status.setStorageClass(S3Object.STORAGE_CLASS_REDUCED_REDUNDANCY); final BytecountStreamListener count = new BytecountStreamListener(); service.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - count, status, new DisabledLoginCallback()); + new DisabledProgressListener(), count, status, new DisabledLoginCallback()); assertEquals(random.length, count.getSent()); assertSame(Checksum.NONE, status.getResponse().getChecksum()); assertTrue(status.isComplete()); @@ -96,7 +97,7 @@ public void testUploadBucketInHostname() throws Exception { status.setStorageClass(S3Object.STORAGE_CLASS_REDUCED_REDUNDANCY); final BytecountStreamListener count = new BytecountStreamListener(); service.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - count, status, new DisabledLoginCallback()); + new DisabledProgressListener(), count, status, new DisabledLoginCallback()); assertEquals(random.length, count.getSent()); assertSame(Checksum.NONE, status.getResponse().getChecksum()); assertTrue(status.isComplete()); @@ -133,7 +134,7 @@ public void testUploadSinglePartEncrypted() throws Exception { status.setStorageClass(S3Object.STORAGE_CLASS_REDUCED_REDUNDANCY); final BytecountStreamListener count = new BytecountStreamListener(); service.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - count, status, new DisabledLoginCallback()); + new DisabledProgressListener(), count, status, new DisabledLoginCallback()); assertEquals(random.length, count.getSent()); assertSame(Checksum.NONE, status.getResponse().getChecksum()); assertEquals(random.length, status.getResponse().getSize()); @@ -157,7 +158,7 @@ public void testUploadInvalidContainer() throws Exception { final Path test = new Path(container, UUID.randomUUID().toString(), EnumSet.of(Path.Type.file)); final Local local = new Local(System.getProperty("java.io.tmpdir"), UUID.randomUUID().toString()); final TransferStatus status = new TransferStatus(); - m.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), status, null); + m.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), status, null); } @Test @@ -174,7 +175,7 @@ public void testMultipleParts() throws Exception { final TransferStatus status = new TransferStatus(); status.setLength(content.length); final BytecountStreamListener count = new BytecountStreamListener(); - m.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), count, status, null); + m.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, status, null); assertEquals(content.length, count.getSent()); assertTrue(status.isComplete()); assertNotSame(PathAttributes.EMPTY, status.getResponse()); @@ -199,7 +200,7 @@ public void testMultiplePartsWithSHA256Checksum() throws Exception { status.setLength(content.length); status.setModified(System.currentTimeMillis()); final BytecountStreamListener count = new BytecountStreamListener(); - m.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), count, status, null); + m.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, status, null); assertEquals(content.length, count.getSent()); assertTrue(status.isComplete()); assertNotSame(PathAttributes.EMPTY, status.getResponse()); @@ -237,7 +238,7 @@ public StorageObject upload(final Path file, final Local local, final BandwidthT }; try { feature.upload(test, new Local(System.getProperty("java.io.tmpdir"), name), - new BandwidthThrottle(BandwidthThrottle.UNLIMITED), count, status, + new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, status, new DisabledLoginCallback()); } catch(BackgroundException e) { @@ -254,7 +255,7 @@ public StorageObject upload(final Path file, final Local local, final BandwidthT assertEquals(10L * 1024L * 1024L, feature.append(upload, status).offset, 0L); final TransferStatus append = new TransferStatus().append(true).withLength(2L * 1024L * 1024L).withOffset(10L * 1024L * 1024L); new S3MultipartUploadService(session, new S3WriteFeature(session, acl), acl, 10L * 1024L * 1024L, 1).upload(test, local, - new BandwidthThrottle(BandwidthThrottle.UNLIMITED), count, append, + new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, append, new DisabledConnectionCallback()); assertEquals(12L * 1024L * 1024L, count.getSent()); assertTrue(append.isComplete()); @@ -298,7 +299,7 @@ protected void beforeRead(int n) throws IOException { } }; } - }, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), count, status, + }, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), count, status, new DisabledConnectionCallback()); } catch(BackgroundException e) { @@ -313,7 +314,7 @@ protected void beforeRead(int n) throws IOException { final TransferStatus append = new TransferStatus().append(true).withLength(content.length); new S3MultipartUploadService(session, new S3WriteFeature(session, acl), acl, 10485760L, 1).upload( test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - count, append, + new DisabledProgressListener(), count, append, new DisabledConnectionCallback()); assertEquals(32769L, count.getSent()); assertTrue(append.isComplete()); diff --git a/s3/src/test/java/ch/cyberduck/core/s3/S3SingleUploadServiceTest.java b/s3/src/test/java/ch/cyberduck/core/s3/S3SingleUploadServiceTest.java index 0a8e95527e0..1923d5652d7 100644 --- a/s3/src/test/java/ch/cyberduck/core/s3/S3SingleUploadServiceTest.java +++ b/s3/src/test/java/ch/cyberduck/core/s3/S3SingleUploadServiceTest.java @@ -16,6 +16,7 @@ */ import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Host; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; @@ -69,7 +70,7 @@ public void testUpload() throws Exception { status.setLength(random.length); status.setMime("text/plain"); service.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - new DisabledStreamListener(), status, new DisabledLoginCallback()); + new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledLoginCallback()); assertTrue(new S3FindFeature(session, acl).find(test)); final PathAttributes attr = new S3AttributesFinderFeature(session, acl).find(test); assertEquals(status.getResponse().getChecksum(), attr.getChecksum()); @@ -95,7 +96,7 @@ public void testUploadSSE() throws Exception { status.setLength(random.length); status.setEncryption(KMSEncryptionFeature.SSE_KMS_DEFAULT); service.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - new DisabledStreamListener(), status, new DisabledLoginCallback()); + new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledLoginCallback()); assertTrue(new S3FindFeature(session, acl).find(test)); final PathAttributes attributes = new S3AttributesFinderFeature(session, acl).find(test); assertEquals(random.length, attributes.getSize()); @@ -118,7 +119,7 @@ public void testUploadWithSHA256Checksum() throws Exception { final TransferStatus status = new TransferStatus(); status.setLength(random.length); service.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - new DisabledStreamListener(), status, new DisabledLoginCallback()); + new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledLoginCallback()); assertTrue(new S3FindFeature(session, acl).find(test)); final PathAttributes attributes = new S3AttributesFinderFeature(session, acl).find(test); assertEquals(random.length, attributes.getSize()); @@ -134,7 +135,7 @@ public void testUploadInvalidContainer() throws Exception { final Local local = new Local(System.getProperty("java.io.tmpdir"), UUID.randomUUID().toString()); LocalTouchFactory.get().touch(local); final TransferStatus status = new TransferStatus(); - m.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), + m.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledLoginCallback()); } } diff --git a/s3/src/test/java/ch/cyberduck/core/s3/S3ThresholdUploadServiceTest.java b/s3/src/test/java/ch/cyberduck/core/s3/S3ThresholdUploadServiceTest.java index 0438eab25b0..ceed933c046 100644 --- a/s3/src/test/java/ch/cyberduck/core/s3/S3ThresholdUploadServiceTest.java +++ b/s3/src/test/java/ch/cyberduck/core/s3/S3ThresholdUploadServiceTest.java @@ -18,6 +18,7 @@ import ch.cyberduck.core.AlphanumericRandomStringService; import ch.cyberduck.core.BytecountStreamListener; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.NullLocal; import ch.cyberduck.core.Path; @@ -53,7 +54,7 @@ public void testUploadInvalidContainer() throws Exception { final Path test = new Path(container, UUID.randomUUID().toString(), EnumSet.of(Path.Type.file)); final Local local = new NullLocal(System.getProperty("java.io.tmpdir"), UUID.randomUUID().toString()); final TransferStatus status = new TransferStatus().withLength(5 * 1024L); - m.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), status, null); + m.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), status, null); } @Test @@ -70,7 +71,7 @@ public void testUploadSinglePartEuCentral() throws Exception { status.setStorageClass(S3Object.STORAGE_CLASS_REDUCED_REDUNDANCY); final BytecountStreamListener count = new BytecountStreamListener(); service.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - count, status, new DisabledLoginCallback()); + new DisabledProgressListener(), count, status, new DisabledLoginCallback()); assertEquals(random.length, count.getSent(), 0L); assertTrue(status.isComplete()); assertTrue(new S3FindFeature(session, new S3AccessControlListFeature(session)).find(test)); @@ -95,7 +96,7 @@ public void testUploadSinglePartUsEast() throws Exception { status.setStorageClass(S3Object.STORAGE_CLASS_REDUCED_REDUNDANCY); final BytecountStreamListener count = new BytecountStreamListener(); service.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - count, status, new DisabledLoginCallback()); + new DisabledProgressListener(), count, status, new DisabledLoginCallback()); assertEquals(random.length, count.getSent()); assertTrue(status.isComplete()); assertTrue(new S3FindFeature(session, new S3AccessControlListFeature(session)).find(test)); @@ -121,7 +122,7 @@ public void testUploadZeroLength() throws Exception { status.setMime("text/plain"); final BytecountStreamListener count = new BytecountStreamListener(); service.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - count, status, new DisabledLoginCallback()); + new DisabledProgressListener(), count, status, new DisabledLoginCallback()); assertEquals(random.length, count.getSent()); assertTrue(status.isComplete()); assertTrue(new S3FindFeature(session, new S3AccessControlListFeature(session)).find(test)); diff --git a/spectra/src/main/java/ch/cyberduck/core/spectra/SpectraUploadFeature.java b/spectra/src/main/java/ch/cyberduck/core/spectra/SpectraUploadFeature.java index 3f46a3ff9ad..3ab8e381617 100644 --- a/spectra/src/main/java/ch/cyberduck/core/spectra/SpectraUploadFeature.java +++ b/spectra/src/main/java/ch/cyberduck/core/spectra/SpectraUploadFeature.java @@ -18,6 +18,7 @@ import ch.cyberduck.core.ConnectionCallback; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; +import ch.cyberduck.core.ProgressListener; import ch.cyberduck.core.exception.BackgroundException; import ch.cyberduck.core.features.Upload; import ch.cyberduck.core.features.Write; @@ -48,7 +49,7 @@ public SpectraUploadFeature(final SpectraSession session, final Write(new SFTPWriteFeature(session)).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledConnectionCallback()); } { final TransferStatus status = new TransferStatus().withLength(content.length / 2).withOffset(content.length / 2).append(true); new DefaultUploadFeature(new SFTPWriteFeature(session)).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledConnectionCallback()); } diff --git a/storegate/src/test/java/ch/cyberduck/core/storegate/StoregateReadFeatureTest.java b/storegate/src/test/java/ch/cyberduck/core/storegate/StoregateReadFeatureTest.java index 6f1a3dfd6fd..90a272b6a3b 100644 --- a/storegate/src/test/java/ch/cyberduck/core/storegate/StoregateReadFeatureTest.java +++ b/storegate/src/test/java/ch/cyberduck/core/storegate/StoregateReadFeatureTest.java @@ -18,6 +18,7 @@ import ch.cyberduck.core.AlphanumericRandomStringService; import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.exception.NotfoundException; @@ -111,7 +112,7 @@ public void testReadRange() throws Exception { final TransferStatus upload = new TransferStatus().withLength(content.length); upload.setExists(true); new DefaultUploadFeature<>(new StoregateWriteFeature(session, nodeid)).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), upload, + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), upload, new DisabledConnectionCallback()); final TransferStatus status = new TransferStatus(); status.setLength(content.length); @@ -145,7 +146,7 @@ public void testReadRangeUnknownLength() throws Exception { final TransferStatus upload = new TransferStatus().withLength(content.length); upload.setExists(true); new DefaultUploadFeature<>(new StoregateWriteFeature(session, nodeid)).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), upload, + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), upload, new DisabledConnectionCallback()); final TransferStatus status = new TransferStatus(); status.setLength(-1L); diff --git a/tus/src/main/java/ch/cyberduck/core/tus/TusUploadFeature.java b/tus/src/main/java/ch/cyberduck/core/tus/TusUploadFeature.java index 2861cfbda0c..c90e4c34139 100644 --- a/tus/src/main/java/ch/cyberduck/core/tus/TusUploadFeature.java +++ b/tus/src/main/java/ch/cyberduck/core/tus/TusUploadFeature.java @@ -21,6 +21,7 @@ import ch.cyberduck.core.Host; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; +import ch.cyberduck.core.ProgressListener; import ch.cyberduck.core.StringAppender; import ch.cyberduck.core.concurrency.Interruptibles; import ch.cyberduck.core.exception.BackgroundException; @@ -88,7 +89,7 @@ public TusUploadFeature(final Host host, final HttpClient client, final Write 0) { final long length = Math.min(preferences.getInteger("tus.chunk.size"), remaining); - chunks.add(this.submit(file, local, throttle, listener, status, + chunks.add(this.submit(file, local, throttle, streamListener, status, uploadUrl, offset, length, callback)); remaining -= length; offset += length; diff --git a/webdav/src/test/java/ch/cyberduck/core/dav/DAVLockFeatureTest.java b/webdav/src/test/java/ch/cyberduck/core/dav/DAVLockFeatureTest.java index 4909f64089d..31f61687b2a 100644 --- a/webdav/src/test/java/ch/cyberduck/core/dav/DAVLockFeatureTest.java +++ b/webdav/src/test/java/ch/cyberduck/core/dav/DAVLockFeatureTest.java @@ -18,6 +18,7 @@ import ch.cyberduck.core.AlphanumericRandomStringService; import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledPasswordCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.exception.InteroperabilityException; @@ -53,7 +54,7 @@ public void testLockNotSupported() throws Exception { final Path test = new Path(new DefaultHomeFinderService(session).find(), new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)); final HttpUploadFeature upload = new DAVUploadFeature(session); upload.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - new DisabledStreamListener(), status, new DisabledConnectionCallback()); + new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledConnectionCallback()); String lock = null; try { lock = new DAVLockFeature(session).lock(test); diff --git a/webdav/src/test/java/ch/cyberduck/core/dav/DAVReadFeatureTest.java b/webdav/src/test/java/ch/cyberduck/core/dav/DAVReadFeatureTest.java index 2fd4bf141f6..ebd25616f6c 100644 --- a/webdav/src/test/java/ch/cyberduck/core/dav/DAVReadFeatureTest.java +++ b/webdav/src/test/java/ch/cyberduck/core/dav/DAVReadFeatureTest.java @@ -3,6 +3,7 @@ import ch.cyberduck.core.AlphanumericRandomStringService; import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.exception.NotfoundException; @@ -56,7 +57,7 @@ public void testReadChunkedTransfer() throws Exception { IOUtils.write(content, out); out.close(); new DAVUploadFeature(session).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), new TransferStatus().withLength(content.length), new DisabledConnectionCallback()); // Unknown length in status @@ -103,7 +104,7 @@ public void testReadRange() throws Exception { IOUtils.write(content, out); out.close(); new DAVUploadFeature(session).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), new TransferStatus().withLength(content.length), new DisabledConnectionCallback()); final TransferStatus status = new TransferStatus(); @@ -131,7 +132,7 @@ public void testReadRangeUnknownLength() throws Exception { IOUtils.write(content, out); out.close(); new DAVUploadFeature(session).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), new TransferStatus().withLength(content.length), new DisabledConnectionCallback()); final TransferStatus status = new TransferStatus(); diff --git a/webdav/src/test/java/ch/cyberduck/core/dav/DAVUploadFeatureTest.java b/webdav/src/test/java/ch/cyberduck/core/dav/DAVUploadFeatureTest.java index 2e60b22ee05..a24007fb307 100644 --- a/webdav/src/test/java/ch/cyberduck/core/dav/DAVUploadFeatureTest.java +++ b/webdav/src/test/java/ch/cyberduck/core/dav/DAVUploadFeatureTest.java @@ -20,6 +20,7 @@ import ch.cyberduck.core.AlphanumericRandomStringService; import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.exception.AccessDeniedException; @@ -56,7 +57,7 @@ public void testAccessDenied() throws Exception { final Path test = new Path(new Path("/dav/accessdenied", EnumSet.of(Path.Type.directory)), "nosuchname", EnumSet.of(Path.Type.file)); try { new DAVUploadFeature(session).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledConnectionCallback()); } @@ -81,14 +82,14 @@ public void testAppend() throws Exception { { final TransferStatus status = new TransferStatus().withLength(content.length / 2); new DAVUploadFeature(session).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledConnectionCallback()); } { final TransferStatus status = new TransferStatus().withLength(content.length / 2).withOffset(content.length / 2).append(true); new DAVUploadFeature(session).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledConnectionCallback()); } diff --git a/webdav/src/test/java/ch/cyberduck/core/dav/DAVWriteFeatureTest.java b/webdav/src/test/java/ch/cyberduck/core/dav/DAVWriteFeatureTest.java index a4777e75749..45d2a050c68 100644 --- a/webdav/src/test/java/ch/cyberduck/core/dav/DAVWriteFeatureTest.java +++ b/webdav/src/test/java/ch/cyberduck/core/dav/DAVWriteFeatureTest.java @@ -4,6 +4,7 @@ import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledListProgressListener; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.PathAttributes; @@ -53,7 +54,7 @@ public void testReadWrite() throws Exception { final Path test = new Path(new DefaultHomeFinderService(session).find(), new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)); final HttpUploadFeature upload = new DAVUploadFeature(session); upload.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - new DisabledStreamListener(), status, new DisabledConnectionCallback()); + new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledConnectionCallback()); assertTrue(session.getFeature(Find.class).find(test)); assertEquals(content.length, new DAVListService(session).list(test.getParent(), new DisabledListProgressListener()).get(test).attributes().getSize(), 0L); assertEquals(content.length, new DAVUploadFeature(session).append(test, status.withRemote(new DAVAttributesFinderFeature(session).find(test))).offset, 0L); @@ -86,7 +87,7 @@ public void testReadWriteChunkedTransfer() throws Exception { final Path test = new Path(new DefaultHomeFinderService(session).find(), new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)); final HttpUploadFeature upload = new DAVUploadFeature(session); upload.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - new DisabledStreamListener(), status, new DisabledConnectionCallback()); + new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledConnectionCallback()); assertTrue(session.getFeature(Find.class).find(test)); assertEquals(content.length, new DAVListService(session).list(test.getParent(), new DisabledListProgressListener()).get(test).attributes().getSize(), 0L); assertEquals(content.length, new DAVUploadFeature(session).append(test, status.withRemote(new DAVAttributesFinderFeature(session).find(test))).offset, 0L); @@ -122,7 +123,7 @@ public void testReplaceContent() throws Exception { final TransferStatus status = new TransferStatus(); status.setLength(content.length); upload.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - new DisabledStreamListener(), status, new DisabledConnectionCallback()); + new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledConnectionCallback()); assertNotEquals(folderEtag, new DAVAttributesFinderFeature(session).find(folder).getETag()); } final PathAttributes attr1 = new DAVAttributesFinderFeature(session).find(test); @@ -136,7 +137,7 @@ public void testReplaceContent() throws Exception { final TransferStatus status = new TransferStatus(); status.setLength(content.length); upload.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - new DisabledStreamListener(), status, new DisabledConnectionCallback()); + new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledConnectionCallback()); assertEquals(folderEtag, new DAVAttributesFinderFeature(session).find(folder).getETag()); assertNotEquals(fileEtag, new DAVAttributesFinderFeature(session).find(test).getETag()); } diff --git a/webdav/src/test/java/ch/cyberduck/core/dav/microsoft/MicrosoftIISDAVLockFeatureTest.java b/webdav/src/test/java/ch/cyberduck/core/dav/microsoft/MicrosoftIISDAVLockFeatureTest.java index 35429896443..1be9a81ab90 100644 --- a/webdav/src/test/java/ch/cyberduck/core/dav/microsoft/MicrosoftIISDAVLockFeatureTest.java +++ b/webdav/src/test/java/ch/cyberduck/core/dav/microsoft/MicrosoftIISDAVLockFeatureTest.java @@ -19,6 +19,7 @@ import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledListProgressListener; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.PathAttributes; @@ -60,7 +61,7 @@ public void testLock() throws Exception { final Path test = new Path(new DefaultHomeFinderService(session).find(), new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)); final HttpUploadFeature upload = new DAVUploadFeature(session); upload.upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), - new DisabledStreamListener(), status, new DisabledConnectionCallback()); + new DisabledProgressListener(), new DisabledStreamListener(), status, new DisabledConnectionCallback()); final String lock = new DAVLockFeature(session).lock(test); assertTrue(new MicrosoftIISDAVFindFeature(session).find(test)); final PathAttributes attributes = new MicrosoftIISDAVListService(session, new MicrosoftIISDAVAttributesFinderFeature(session)).list(test.getParent(), new DisabledListProgressListener()).get(test).attributes(); diff --git a/webdav/src/test/java/ch/cyberduck/core/dav/microsoft/MicrosoftIISDAVReadFeatureTest.java b/webdav/src/test/java/ch/cyberduck/core/dav/microsoft/MicrosoftIISDAVReadFeatureTest.java index 3a83fa714d8..f9a5eaa043a 100644 --- a/webdav/src/test/java/ch/cyberduck/core/dav/microsoft/MicrosoftIISDAVReadFeatureTest.java +++ b/webdav/src/test/java/ch/cyberduck/core/dav/microsoft/MicrosoftIISDAVReadFeatureTest.java @@ -19,6 +19,7 @@ import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledListProgressListener; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.dav.DAVDeleteFeature; @@ -65,7 +66,7 @@ public void testReadConcurrency() throws Exception { IOUtils.write(content, out); out.close(); new DAVUploadFeature(session).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), new TransferStatus().withLength(content.length), new DisabledConnectionCallback()); final ExecutorService service = Executors.newCachedThreadPool(); diff --git a/webdav/src/test/java/ch/cyberduck/core/dav/microsoft/MicrosoftIISDAVUploadFeatureTest.java b/webdav/src/test/java/ch/cyberduck/core/dav/microsoft/MicrosoftIISDAVUploadFeatureTest.java index ee7546d2857..9e6c15d016d 100644 --- a/webdav/src/test/java/ch/cyberduck/core/dav/microsoft/MicrosoftIISDAVUploadFeatureTest.java +++ b/webdav/src/test/java/ch/cyberduck/core/dav/microsoft/MicrosoftIISDAVUploadFeatureTest.java @@ -18,6 +18,7 @@ import ch.cyberduck.core.AlphanumericRandomStringService; import ch.cyberduck.core.DisabledConnectionCallback; import ch.cyberduck.core.DisabledLoginCallback; +import ch.cyberduck.core.DisabledProgressListener; import ch.cyberduck.core.Local; import ch.cyberduck.core.Path; import ch.cyberduck.core.dav.DAVDeleteFeature; @@ -57,7 +58,7 @@ public void testUpload() throws Exception { IOUtils.write(content, out); out.close(); new DAVUploadFeature(session).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), new TransferStatus().withLength(content.length), new DisabledConnectionCallback()); new DAVDeleteFeature(session).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback()); @@ -77,7 +78,7 @@ public void testUploadNoConnectionInPool() throws Exception { final ClientConnectionManager manager = session.getClient().getClient().getConnectionManager(); manager.closeIdleConnections(0L, TimeUnit.MILLISECONDS); assertThrows(InteroperabilityException.class, () -> new DAVUploadFeature(session).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), new TransferStatus().withLength(content.length), new DisabledConnectionCallback())); local.delete(); @@ -96,7 +97,7 @@ public void testZeroByteUploadNoConnectionInPool() throws Exception { final ClientConnectionManager manager = session.getClient().getClient().getConnectionManager(); manager.closeIdleConnections(0L, TimeUnit.MILLISECONDS); new DAVUploadFeature(session).upload( - test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), + test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), new TransferStatus().withLength(content.length), new DisabledConnectionCallback()); new DAVDeleteFeature(session).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback()); diff --git a/webdav/src/test/java/ch/cyberduck/core/worker/DAVConcurrentTransferWorkerTest.java b/webdav/src/test/java/ch/cyberduck/core/worker/DAVConcurrentTransferWorkerTest.java index 57b76622188..5ff7cb0791f 100644 --- a/webdav/src/test/java/ch/cyberduck/core/worker/DAVConcurrentTransferWorkerTest.java +++ b/webdav/src/test/java/ch/cyberduck/core/worker/DAVConcurrentTransferWorkerTest.java @@ -79,7 +79,7 @@ public void testLargeUpAndDownload() throws Exception { assertNotNull(out); IOUtils.write(content, out); out.close(); - new DAVUploadFeature(session).upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), new TransferStatus().withLength(content.length), new DisabledConnectionCallback()); + new DAVUploadFeature(session).upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), new TransferStatus().withLength(content.length), new DisabledConnectionCallback()); assertEquals(content.length, new DAVAttributesFinderFeature(session).find(test).getSize()); final Local localFile = new DefaultTemporaryFileService().create(test.getName()); final Transfer download = new DownloadTransfer(new Host(new TestProtocol()), Collections.singletonList(new TransferItem(test, localFile)), new NullFilter<>()); @@ -112,7 +112,7 @@ public void testDownloadTransferWithFailure() throws Exception { assertNotNull(out); IOUtils.write(content, out); out.close(); - new DAVUploadFeature(session).upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), new TransferStatus().withLength(content.length), new DisabledConnectionCallback()); + new DAVUploadFeature(session).upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), new TransferStatus().withLength(content.length), new DisabledConnectionCallback()); final AtomicBoolean failed = new AtomicBoolean(); final Host host = new Host(session.getHost()) { @Override diff --git a/webdav/src/test/java/ch/cyberduck/core/worker/DAVSingleTransferWorkerTest.java b/webdav/src/test/java/ch/cyberduck/core/worker/DAVSingleTransferWorkerTest.java index bcc161b325b..9caa91980bb 100644 --- a/webdav/src/test/java/ch/cyberduck/core/worker/DAVSingleTransferWorkerTest.java +++ b/webdav/src/test/java/ch/cyberduck/core/worker/DAVSingleTransferWorkerTest.java @@ -82,7 +82,7 @@ public void testDownloadTransferWithFailure() throws Exception { assertNotNull(out); IOUtils.write(content, out); out.close(); - new DAVUploadFeature(session).upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledStreamListener(), new TransferStatus().withLength(content.length), new DisabledConnectionCallback()); + new DAVUploadFeature(session).upload(test, local, new BandwidthThrottle(BandwidthThrottle.UNLIMITED), new DisabledProgressListener(), new DisabledStreamListener(), new TransferStatus().withLength(content.length), new DisabledConnectionCallback()); final AtomicBoolean failed = new AtomicBoolean(); final Host host = new Host(session.getHost()) { @Override diff --git a/windows/src/main/csharp/ch/cyberduck/ui/Model/TransferProgressModel.cs b/windows/src/main/csharp/ch/cyberduck/ui/Model/TransferProgressModel.cs index c3bd487762d..d25c18f328b 100644 --- a/windows/src/main/csharp/ch/cyberduck/ui/Model/TransferProgressModel.cs +++ b/windows/src/main/csharp/ch/cyberduck/ui/Model/TransferProgressModel.cs @@ -49,7 +49,7 @@ public void Refresh(TransferProgress progress) else { Completed = progress.isComplete(); - Progress = progress.getSize().longValue() is long size and > 0 + Progress = !Completed && progress.getSize().longValue() is long size and > 0 ? progress.getTransferred().longValue() * 100.0 / size : null; Text = progress.getProgress(); diff --git a/windows/src/main/csharp/ch/cyberduck/ui/ViewModels/TransferViewModel.cs b/windows/src/main/csharp/ch/cyberduck/ui/ViewModels/TransferViewModel.cs index a2996fd6776..67c4cd06a87 100644 --- a/windows/src/main/csharp/ch/cyberduck/ui/ViewModels/TransferViewModel.cs +++ b/windows/src/main/csharp/ch/cyberduck/ui/ViewModels/TransferViewModel.cs @@ -187,10 +187,10 @@ partial void OnProgressStateChanged(TransferProgressModel value) else { Running = true; - (ProgressPending, Progress) = value.Progress switch + (ProgressPending, Progress) = (value.Progress, value.Completed) switch { - null => (true, 0), - double progress => (false, progress) + (null, _) or (_, true) => (true, 0), + (double progress, _) => (false, progress), }; OnPropertyChanged(nameof(MessageText)); diff --git a/windows/src/main/csharp/ch/cyberduck/ui/ViewModels/TransfersViewModel.cs b/windows/src/main/csharp/ch/cyberduck/ui/ViewModels/TransfersViewModel.cs index 44f4feb0e82..322820b0354 100644 --- a/windows/src/main/csharp/ch/cyberduck/ui/ViewModels/TransfersViewModel.cs +++ b/windows/src/main/csharp/ch/cyberduck/ui/ViewModels/TransfersViewModel.cs @@ -486,19 +486,26 @@ private async Task OnShowCanExecute(CancellationToken cancellationToken) bool Run() { - foreach (var item in SelectedTransfers) + foreach (var transfer in SelectedTransfers) { if (cancellationToken.IsCancellationRequested) { return false; } - if (item.Local is null) + if (transfer.Running) + { + // Dont flicker + return false; + } + + + if (transfer.Local is null) { continue; } - foreach (var file in item.Roots) + foreach (var file in transfer.Roots) { if (cancellationToken.IsCancellationRequested) { @@ -608,6 +615,7 @@ private void ValidateCommands() StopCommand.NotifyCanExecuteChanged(); TrashCommand.NotifyCanExecuteChanged(); + // TODO Reduce triggering this a billion times a second OpenCanExecuteCommand.ExecuteAsync(null).ContinueWith(LogTask); ShowCanExecuteCommand.ExecuteAsync(null).ContinueWith(LogTask); }