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

backblaze/src/main/java/ch/cyberduck/core/b2/B2LargeUploadService.java

Lines changed: 2 additions & 1 deletion
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) {

box/src/main/java/ch/cyberduck/core/box/BoxLargeUploadService.java

Lines changed: 2 additions & 1 deletion
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());

brick/src/main/java/ch/cyberduck/core/brick/BrickUploadFeature.java

Lines changed: 2 additions & 1 deletion
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 {

core/src/main/java/ch/cyberduck/core/http/HttpResponseOutputStream.java

Lines changed: 2 additions & 1 deletion
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) {

core/src/main/java/ch/cyberduck/core/io/StreamProgress.java

Lines changed: 6 additions & 7 deletions
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
}

core/src/main/java/ch/cyberduck/core/transfer/DownloadTransfer.java

Lines changed: 2 additions & 1 deletion
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())) {

core/src/main/java/ch/cyberduck/core/transfer/ProxyTransferStatus.java

Lines changed: 3 additions & 6 deletions
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
}

core/src/main/java/ch/cyberduck/core/transfer/TransferResponse.java

Lines changed: 1 addition & 1 deletion
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
}

core/src/main/java/ch/cyberduck/core/transfer/TransferStatus.java

Lines changed: 3 additions & 6 deletions
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() {

core/src/main/java/ch/cyberduck/core/transfer/UploadTransfer.java

Lines changed: 2 additions & 1 deletion
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())) {

0 commit comments

Comments
 (0)