Skip to content

Commit bb837e8

Browse files
committed
Revert interface changes in stream progress from 6d861cf.
1 parent 677d3d0 commit bb837e8

File tree

19 files changed

+39
-38
lines changed

19 files changed

+39
-38
lines changed

Diff for: backblaze/src/main/java/ch/cyberduck/core/b2/B2LargeUploadService.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ public int compare(final B2UploadPartResponse o1, final B2UploadPartResponse o2)
186186
log.info("Finished large file upload {} with {} parts", file, completed.size());
187187
fileid.cache(file, response.getFileId());
188188
// Mark parent status as complete
189-
status.setResponse(new B2AttributesFinderFeature(session, fileid).toAttributes(response)).setComplete();
189+
status.setResponse(new B2AttributesFinderFeature(session, fileid).toAttributes(response));
190+
status.setComplete();
190191
return response;
191192
}
192193
catch(B2ApiException e) {

Diff for: box/src/main/java/ch/cyberduck/core/box/BoxLargeUploadService.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ public File upload(final Path file, final Local local, final BandwidthThrottle t
111111
if(optional.isPresent()) {
112112
final File commited = optional.get();
113113
// Mark parent status as complete
114-
status.setResponse(new BoxAttributesFinderFeature(session, fileid).toAttributes(commited)).setComplete();
114+
status.setResponse(new BoxAttributesFinderFeature(session, fileid).toAttributes(commited));
115+
status.setComplete();
115116
return commited;
116117
}
117118
throw new NotfoundException(file.getAbsolute());

Diff for: brick/src/main/java/ch/cyberduck/core/brick/BrickUploadFeature.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ public FileEntity upload(final Path file, final Local local, final BandwidthThro
108108
final List<TransferStatus> checksums = Interruptibles.awaitAll(parts);
109109
final FileEntity entity = this.completeUpload(file, ref, status, checksums);
110110
// Mark parent status as complete
111-
status.setResponse(new BrickAttributesFinderFeature(session).toAttributes(entity)).setComplete();
111+
status.setResponse(new BrickAttributesFinderFeature(session).toAttributes(entity));
112+
status.setComplete();
112113
return entity;
113114
}
114115
finally {

Diff for: core/src/main/java/ch/cyberduck/core/http/HttpResponseOutputStream.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ public void close() throws IOException {
4949
final Reply response = this.getStatus();
5050
if(response != null) {
5151
log.debug("Closed stream {} with response value {}", this, response);
52-
status.setResponse(attributes.toAttributes(response)).setComplete();
52+
status.setResponse(attributes.toAttributes(response));
53+
status.setComplete();
5354
}
5455
}
5556
catch(BackgroundException e) {

Diff for: core/src/main/java/ch/cyberduck/core/io/StreamProgress.java

+6-7
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,21 @@
1818
*/
1919

2020
import ch.cyberduck.core.exception.BackgroundException;
21-
import ch.cyberduck.core.transfer.TransferStatus;
2221

2322
public interface StreamProgress {
24-
TransferStatus setComplete();
23+
void setComplete();
2524

26-
TransferStatus setFailure(final BackgroundException failure);
25+
void setFailure(final BackgroundException failure);
2726

2827
StreamProgress noop = new StreamProgress() {
2928
@Override
30-
public TransferStatus setComplete() {
31-
return null;
29+
public void setComplete() {
30+
//
3231
}
3332

3433
@Override
35-
public TransferStatus setFailure(final BackgroundException failure) {
36-
return null;
34+
public void setFailure(final BackgroundException failure) {
35+
//
3736
}
3837
};
3938
}

Diff for: core/src/main/java/ch/cyberduck/core/transfer/DownloadTransfer.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,12 @@ public void pre(final Session<?> source, final Session<?> destination, final Map
229229
progress.message(MessageFormat.format(LocaleFactory.localizedString("Making directory {0}", "Status"), local.getName()));
230230
try {
231231
new DefaultLocalDirectoryFeature().mkdir(local);
232+
status.setComplete();
232233
// Post process of file
233234
filter.complete(
234235
status.getRename().remote != null ? status.getRename().remote : entry.getKey().remote,
235236
status.getRename().local != null ? status.getRename().local : entry.getKey().local,
236-
status.setComplete(), progress);
237+
status, progress);
237238
}
238239
catch(AccessDeniedException e) {
239240
if(error.prompt(entry.getKey(), status, e, files.size())) {

Diff for: core/src/main/java/ch/cyberduck/core/transfer/ProxyTransferStatus.java

+3-6
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,13 @@ public void validate() throws ConnectionCanceledException {
4040
}
4141

4242
@Override
43-
public TransferStatus setComplete() {
43+
public void setComplete() {
4444
progress.setComplete();
45-
return this;
4645
}
4746

4847
@Override
49-
public TransferStatus setFailure(final BackgroundException failure) {
48+
public void setFailure(final BackgroundException failure) {
5049
progress.setFailure(failure);
51-
return this;
5250
}
5351

5452
@Override
@@ -57,8 +55,7 @@ public PathAttributes getResponse() {
5755
}
5856

5957
@Override
60-
public TransferStatus setResponse(final PathAttributes attributes) {
58+
public void setResponse(final PathAttributes attributes) {
6159
response.setResponse(attributes);
62-
return this;
6360
}
6461
}

Diff for: core/src/main/java/ch/cyberduck/core/transfer/TransferResponse.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ public interface TransferResponse {
2828
*
2929
* @param attributes Metadata
3030
*/
31-
TransferStatus setResponse(PathAttributes attributes);
31+
void setResponse(PathAttributes attributes);
3232
}

Diff for: core/src/main/java/ch/cyberduck/core/transfer/TransferStatus.java

+3-6
Original file line numberDiff line numberDiff line change
@@ -255,17 +255,15 @@ public boolean isComplete() {
255255
}
256256

257257
@Override
258-
public TransferStatus setComplete() {
258+
public void setComplete() {
259259
complete.set(true);
260260
done.countDown();
261-
return this;
262261
}
263262

264263
@Override
265-
public TransferStatus setFailure(final BackgroundException failure) {
264+
public void setFailure(final BackgroundException failure) {
266265
complete.set(false);
267266
done.countDown();
268-
return this;
269267
}
270268

271269
/**
@@ -459,9 +457,8 @@ public PathAttributes getResponse() {
459457
}
460458

461459
@Override
462-
public TransferStatus setResponse(PathAttributes attributes) {
460+
public void setResponse(PathAttributes attributes) {
463461
this.response = attributes;
464-
return this;
465462
}
466463

467464
public Permission getPermission() {

Diff for: core/src/main/java/ch/cyberduck/core/transfer/UploadTransfer.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -249,11 +249,12 @@ public int compare(final Map.Entry<TransferItem, TransferStatus> o1, final Map.E
249249
progress.message(MessageFormat.format(LocaleFactory.localizedString("Making directory {0}", "Status"), file.getName()));
250250
try {
251251
mkdir.mkdir(file, status);
252+
status.setComplete();
252253
// Post process of file
253254
filter.complete(
254255
status.getRename().remote != null ? status.getRename().remote : entry.getKey().remote,
255256
status.getRename().local != null ? status.getRename().local : entry.getKey().local,
256-
status.setComplete(), progress);
257+
status, progress);
257258
}
258259
catch(BackgroundException e) {
259260
if(error.prompt(entry.getKey(), status, e, files.size())) {

Diff for: core/src/main/java/ch/cyberduck/core/worker/AbstractTransferWorker.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,7 @@ public TransferStatus call() throws BackgroundException {
501501
}
502502
}
503503
if(complete) {
504+
status.setComplete();
504505
final Session<?> source = borrow(Connection.source);
505506
final Session<?> destination = borrow(Connection.destination);
506507
try {
@@ -510,7 +511,7 @@ public TransferStatus call() throws BackgroundException {
510511
filter.complete(
511512
status.getRename().remote != null ? status.getRename().remote : item.remote,
512513
status.getRename().local != null ? status.getRename().local : item.local,
513-
status.setComplete(), progress);
514+
status, progress);
514515
}
515516
finally {
516517
release(source, Connection.source, null);

Diff for: core/src/test/java/ch/cyberduck/core/worker/ConcurrentTransferWorkerTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ public void testAwait() throws Exception {
260260
@Override
261261
public TransferStatus call() {
262262
entry.countDown();
263-
return new TransferStatus().setComplete();
263+
return new TransferStatus();
264264
}
265265
});
266266
}

Diff for: cryptomator/src/main/java/ch/cyberduck/core/cryptomator/CryptoTransferStatus.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,12 @@ public CryptoTransferStatus(final CryptoVault vault, final TransferStatus proxy)
3939
}
4040

4141
@Override
42-
public CryptoTransferStatus setResponse(final PathAttributes attributes) {
42+
public void setResponse(final PathAttributes attributes) {
4343
try {
4444
super.setResponse(attributes.setSize(vault.toCleartextSize(0L, attributes.getSize())));
4545
}
4646
catch(CryptoInvalidFilesizeException e) {
4747
log.warn("Failure {} translating file size from response {}", e, attributes);
4848
}
49-
return this;
5049
}
5150
}

Diff for: cryptomator/src/main/java/ch/cyberduck/core/cryptomator/features/CryptoCopyFeature.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,10 @@ public Path copy(final Path source, final Path copy, final TransferStatus status
7070
vault.contains(copy) ? vault.encrypt(session, copy) : copy,
7171
vault.contains(copy) ? new TransferStatus(status) {
7272
@Override
73-
public TransferStatus setResponse(final PathAttributes attributes) {
73+
public void setResponse(final PathAttributes attributes) {
7474
status.setResponse(attributes);
7575
// Will be converted back to clear text when decrypting file below set in default copy feature implementation using writer.
7676
super.setResponse(new PathAttributes(attributes).setSize(vault.toCiphertextSize(0L, attributes.getSize())));
77-
return this;
7877
}
7978
} : status,
8079
callback, listener);

Diff for: cryptomator/src/main/java/ch/cyberduck/core/cryptomator/features/CryptoTouchFeature.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,10 @@ public Path touch(final Path file, final TransferStatus status) throws Backgroun
5151
status.setNonces(new RandomNonceGenerator(vault.getNonceSize()));
5252
final Path target = proxy.touch(vault.encrypt(session, file), new TransferStatus(status) {
5353
@Override
54-
public TransferStatus setResponse(final PathAttributes attributes) {
54+
public void setResponse(final PathAttributes attributes) {
5555
status.setResponse(attributes);
5656
// Will be converted back to clear text when decrypting file below set in default touch feature implementation using writer.
5757
super.setResponse(new PathAttributes(attributes).setSize(vault.toCiphertextSize(0L, attributes.getSize())));
58-
return this;
5958
}
6059
});
6160
final Path decrypt = vault.decrypt(session, target);

Diff for: dracoon/src/main/java/ch/cyberduck/core/sds/SDSUploadService.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,8 @@ public void uncaughtException(final Thread t, final Throwable e) {
245245
// Set node id in transfer status
246246
nodeid.cache(file, String.valueOf(uploadStatus.getNode().getId()));
247247
// Mark parent status as complete
248-
status.setResponse(new SDSAttributesAdapter(session).toAttributes(uploadStatus.getNode())).setComplete();
248+
status.setResponse(new SDSAttributesAdapter(session).toAttributes(uploadStatus.getNode()));
249+
status.setComplete();
249250
signal.countDown();
250251
break;
251252
}

Diff for: eue/src/main/java/ch/cyberduck/core/eue/EueLargeUploadService.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ public EueWriteFeature.Chunk upload(final Path file, final Local local, final Ba
137137
}
138138
final EueWriteFeature.Chunk object = new EueWriteFeature.Chunk(resourceId, size, cdash64);
139139
// Mark parent status as complete
140-
status.setResponse(new EueAttributesAdapter().toAttributes(object)).setComplete();
140+
status.setResponse(new EueAttributesAdapter().toAttributes(object));
141+
status.setComplete();
141142
return object;
142143
}
143144
catch(NoSuchAlgorithmException e) {

Diff for: openstack/src/main/java/ch/cyberduck/core/openstack/SwiftLargeObjectUploadFeature.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,8 @@ public StorageObject upload(final Path file, final Local local,
183183
// the ETag value of each segment, concatenating them together, and then returning the MD5 checksum of the result.
184184
stored.setMd5sum(checksum);
185185
// Mark parent status as complete
186-
status.setResponse(new SwiftAttributesFinderFeature(session).toAttributes(stored)).setComplete();
186+
status.setResponse(new SwiftAttributesFinderFeature(session).toAttributes(stored));
187+
status.setComplete();
187188
return stored;
188189
}
189190
catch(GenericException e) {

Diff for: s3/src/main/java/ch/cyberduck/core/s3/S3MultipartUploadService.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ public StorageObject upload(final Path file, final Local local, final BandwidthT
195195
object.addAllMetadata(multipart.getMetadata());
196196
}
197197
// Mark parent status as complete
198-
status.setResponse(new S3AttributesAdapter(session.getHost()).toAttributes(object)).setComplete();
198+
status.setResponse(new S3AttributesAdapter(session.getHost()).toAttributes(object));
199+
status.setComplete();
199200
return object;
200201
}
201202
catch(ServiceException e) {

0 commit comments

Comments
 (0)