Cyberduck Mountain Duck CLI

Changeset 44646


Ignore:
Timestamp:
Jul 12, 2018 8:23:32 PM (7 days ago)
Author:
robot
Message:

Honour transfer status (offset and length) to compute checksum.

Location:
trunk
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property subgit:lock:e3b00b521605223268e3c6db8f62f7ff9d39a3a5 deleted
    • Property subgit:lock:79a663633e6f7103690679bba8ab636ba2002bfb set to 2018-07-12T20:23:30.425
  • trunk/backblaze/src/main/java/ch/cyberduck/core/b2/B2LargeUploadService.java

    r44122 r44646  
    2929import ch.cyberduck.core.io.BandwidthThrottle;
    3030import ch.cyberduck.core.io.Checksum;
    31 import ch.cyberduck.core.io.StreamCopier;
    3231import ch.cyberduck.core.io.StreamListener;
    3332import ch.cyberduck.core.io.StreamProgress;
     
    3938import ch.cyberduck.core.worker.DefaultExceptionMappingService;
    4039
    41 import org.apache.commons.io.input.BoundedInputStream;
    4240import org.apache.log4j.Logger;
    4341
     
    6967
    7068    private final PathContainerService containerService
    71             = new B2PathContainerService();
     69        = new B2PathContainerService();
    7270
    7371    private final B2Session session;
     
    122120                if(uploads.isEmpty()) {
    123121                    fileid = session.getClient().startLargeFileUpload(this.fileid.getFileid(containerService.getContainer(file), new DisabledListProgressListener()),
    124                             containerService.getKey(file), status.getMime(), fileinfo).getFileId();
     122                        containerService.getKey(file), status.getMime(), fileinfo).getFileId();
    125123                }
    126124                else {
     
    131129            else {
    132130                fileid = session.getClient().startLargeFileUpload(this.fileid.getFileid(containerService.getContainer(file), new DisabledListProgressListener()),
    133                         containerService.getKey(file), status.getMime(), fileinfo).getFileId();
     131                    containerService.getKey(file), status.getMime(), fileinfo).getFileId();
    134132            }
    135133            // Full size of file
     
    228226                }
    229227                final TransferStatus status = new TransferStatus()
    230                         .length(length)
    231                         .skip(offset);
     228                    .length(length)
     229                    .skip(offset);
    232230                status.setHeader(overall.getHeader());
    233231                status.setNonces(overall.getNonces());
    234                 status.setChecksum(writer.checksum(file).compute(
    235                         StreamCopier.skip(new BoundedInputStream(local.getInputStream(), offset + length), offset),
    236                         status));
     232                status.setChecksum(writer.checksum(file).compute(local.getInputStream(), status));
    237233                status.setSegment(true);
    238234                status.setPart(partNumber);
  • trunk/core/src/main/java/ch/cyberduck/core/io/AbstractChecksumCompute.java

    r39836 r44646  
    2020
    2121import ch.cyberduck.core.LocaleFactory;
     22import ch.cyberduck.core.exception.BackgroundException;
    2223import ch.cyberduck.core.exception.ChecksumException;
    2324import ch.cyberduck.core.transfer.TransferStatus;
     
    2627import org.apache.commons.codec.binary.Hex;
    2728import org.apache.commons.io.IOUtils;
     29import org.apache.commons.io.input.BoundedInputStream;
    2830
    2931import java.io.ByteArrayInputStream;
     
    6769        return md.digest();
    6870    }
     71
     72    protected InputStream normalize(final InputStream in, final TransferStatus status) throws ChecksumException {
     73        try {
     74            final InputStream bounded = status.getLength() > 0 ?
     75                new BoundedInputStream(in, status.getOffset() + status.getLength()) : in;
     76            return status.getOffset() > 0 ? StreamCopier.skip(bounded, status.getOffset()) : bounded;
     77        }
     78        catch(BackgroundException e) {
     79            throw new ChecksumException(LocaleFactory.localizedString("Checksum failure", "Error"), e.getMessage(), e);
     80        }
     81    }
    6982}
  • trunk/core/src/main/java/ch/cyberduck/core/io/CRC32ChecksumCompute.java

    r39836 r44646  
    2626import java.util.zip.CRC32;
    2727
    28 public class CRC32ChecksumCompute implements ChecksumCompute {
     28public class CRC32ChecksumCompute extends AbstractChecksumCompute {
    2929
    3030    @Override
    3131    public Checksum compute(final InputStream in, final TransferStatus status) throws ChecksumException {
     32        final InputStream normalized = this.normalize(in, status);
    3233        final CRC32 crc32 = new CRC32();
    3334        try {
    3435            byte[] buffer = new byte[16384];
    3536            int bytesRead;
    36             while((bytesRead = in.read(buffer, 0, buffer.length)) != -1) {
     37            while((bytesRead = normalized.read(buffer, 0, buffer.length)) != -1) {
    3738                crc32.update(buffer, 0, bytesRead);
    3839            }
     
    4243        }
    4344        finally {
    44             IOUtils.closeQuietly(in);
     45            IOUtils.closeQuietly(normalized);
    4546        }
    4647        return new Checksum(HashAlgorithm.crc32, Long.toHexString(crc32.getValue()));
  • trunk/core/src/main/java/ch/cyberduck/core/io/MD5ChecksumCompute.java

    r39836 r44646  
    3030    @Override
    3131    public Checksum compute(final InputStream in, final TransferStatus status) throws ChecksumException {
    32         return new Checksum(HashAlgorithm.md5, Hex.encodeHexString(this.digest("MD5", in)));
     32        return new Checksum(HashAlgorithm.md5, Hex.encodeHexString(this.digest("MD5",
     33            this.normalize(in, status))));
    3334    }
    3435}
  • trunk/core/src/main/java/ch/cyberduck/core/io/SHA1ChecksumCompute.java

    r39836 r44646  
    3030    @Override
    3131    public Checksum compute(final InputStream in, final TransferStatus status) throws ChecksumException {
    32         return new Checksum(HashAlgorithm.sha1, Hex.encodeHexString(this.digest("SHA-1", in)));
     32        return new Checksum(HashAlgorithm.sha1, Hex.encodeHexString(this.digest("SHA-1",
     33            this.normalize(in, status))));
    3334    }
    3435}
  • trunk/core/src/main/java/ch/cyberduck/core/io/SHA256ChecksumCompute.java

    r39836 r44646  
    3030    @Override
    3131    public Checksum compute(final InputStream in, final TransferStatus status) throws ChecksumException {
    32         return new Checksum(HashAlgorithm.sha256, Hex.encodeHexString(this.digest("SHA-256", in)));
     32        return new Checksum(HashAlgorithm.sha256, Hex.encodeHexString(this.digest("SHA-256",
     33            this.normalize(in, status))));
    3334    }
    3435}
  • trunk/core/src/main/java/ch/cyberduck/core/io/SHA512ChecksumCompute.java

    r39836 r44646  
    2727    @Override
    2828    public Checksum compute(final InputStream in, final TransferStatus status) throws ChecksumException {
    29         return new Checksum(HashAlgorithm.sha512, Hex.encodeHexString(this.digest("SHA-512", in)));
     29        return new Checksum(HashAlgorithm.sha512, Hex.encodeHexString(this.digest("SHA-512",
     30            this.normalize(in, status))));
    3031    }
    3132}
  • trunk/core/src/test/java/ch/cyberduck/core/io/MD5ChecksumComputeTest.java

    r40505 r44646  
    1616    public void testCompute() throws Exception {
    1717        assertEquals("a43c1b0aa53a0c908810c06ab1ff3967",
    18                 new MD5ChecksumCompute().compute(IOUtils.toInputStream("input", Charset.defaultCharset()), new TransferStatus()).hash);
     18            new MD5ChecksumCompute().compute(IOUtils.toInputStream("input", Charset.defaultCharset()), new TransferStatus()).hash);
    1919    }
    2020
     
    2222    public void testComputeEmptyString() throws Exception {
    2323        assertEquals("d41d8cd98f00b204e9800998ecf8427e",
    24                 new MD5ChecksumCompute().compute(IOUtils.toInputStream("", Charset.defaultCharset()), new TransferStatus()).hash);
     24            new MD5ChecksumCompute().compute(IOUtils.toInputStream("", Charset.defaultCharset()), new TransferStatus()).hash);
    2525        assertEquals("d41d8cd98f00b204e9800998ecf8427e",
    26                 new MD5ChecksumCompute().compute(new NullInputStream(0L), new TransferStatus().length(0)).hash);
     26            new MD5ChecksumCompute().compute(new NullInputStream(0L), new TransferStatus().length(0)).hash);
     27    }
     28
     29    @Test
     30    public void testNormalize() throws Exception {
     31        assertEquals("a43c1b0aa53a0c908810c06ab1ff3967",
     32            new MD5ChecksumCompute().compute(IOUtils.toInputStream("input", Charset.defaultCharset()),
     33                new TransferStatus()).hash);
     34        assertEquals("a43c1b0aa53a0c908810c06ab1ff3967",
     35            new MD5ChecksumCompute().compute(IOUtils.toInputStream("_input", Charset.defaultCharset()),
     36                new TransferStatus().skip(1)).hash);
     37        assertEquals("a43c1b0aa53a0c908810c06ab1ff3967",
     38            new MD5ChecksumCompute().compute(IOUtils.toInputStream("_input_", Charset.defaultCharset()),
     39                new TransferStatus().skip(1).length(5)).hash);
    2740    }
    2841}
  • trunk/core/src/test/java/ch/cyberduck/core/io/SHA1ChecksumComputeTest.java

    r39836 r44646  
    2121import ch.cyberduck.core.transfer.TransferStatus;
    2222
     23import org.apache.commons.io.IOUtils;
    2324import org.apache.commons.io.input.NullInputStream;
    2425import org.junit.Test;
     26
     27import java.nio.charset.Charset;
    2528
    2629import static org.junit.Assert.assertEquals;
     
    3134    public void testCompute() throws Exception {
    3235        assertEquals("da39a3ee5e6b4b0d3255bfef95601890afd80709",
    33                 new SHA1ChecksumCompute().compute(new NullInputStream(0), new TransferStatus()).hash);
     36            new SHA1ChecksumCompute().compute(new NullInputStream(0), new TransferStatus()).hash);
    3437
    3538    }
     39
     40    @Test
     41    public void testNormalize() throws Exception {
     42        assertEquals("140f86aae51ab9e1cda9b4254fe98a74eb54c1a1",
     43            new SHA1ChecksumCompute().compute(IOUtils.toInputStream("input", Charset.defaultCharset()),
     44                new TransferStatus()).hash);
     45        assertEquals("140f86aae51ab9e1cda9b4254fe98a74eb54c1a1",
     46            new SHA1ChecksumCompute().compute(IOUtils.toInputStream("_input", Charset.defaultCharset()),
     47                new TransferStatus().skip(1)).hash);
     48        assertEquals("140f86aae51ab9e1cda9b4254fe98a74eb54c1a1",
     49            new SHA1ChecksumCompute().compute(IOUtils.toInputStream("_input_", Charset.defaultCharset()),
     50                new TransferStatus().skip(1).length(5)).hash);
     51    }
    3652}
  • trunk/core/src/test/java/ch/cyberduck/core/io/SHA256ChecksumComputeTest.java

    r39836 r44646  
    2121import ch.cyberduck.core.transfer.TransferStatus;
    2222
     23import org.apache.commons.io.IOUtils;
    2324import org.apache.commons.io.input.NullInputStream;
    2425import org.junit.Test;
     26
     27import java.nio.charset.Charset;
    2528
    2629import static org.junit.Assert.assertEquals;
     
    3134    public void testCompute() throws Exception {
    3235        assertEquals("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
    33                 new SHA256ChecksumCompute().compute(new NullInputStream(0), new TransferStatus()).hash);
     36            new SHA256ChecksumCompute().compute(new NullInputStream(0), new TransferStatus()).hash);
     37    }
     38
     39    @Test
     40    public void testNormalize() throws Exception {
     41        assertEquals("c96c6d5be8d08a12e7b5cdc1b207fa6b2430974c86803d8891675e76fd992c20",
     42            new SHA256ChecksumCompute().compute(IOUtils.toInputStream("input", Charset.defaultCharset()),
     43                new TransferStatus()).hash);
     44        assertEquals("c96c6d5be8d08a12e7b5cdc1b207fa6b2430974c86803d8891675e76fd992c20",
     45            new SHA256ChecksumCompute().compute(IOUtils.toInputStream("_input", Charset.defaultCharset()),
     46                new TransferStatus().skip(1)).hash);
     47        assertEquals("c96c6d5be8d08a12e7b5cdc1b207fa6b2430974c86803d8891675e76fd992c20",
     48            new SHA256ChecksumCompute().compute(IOUtils.toInputStream("_input_", Charset.defaultCharset()),
     49                new TransferStatus().skip(1).length(5)).hash);
    3450    }
    3551}
  • trunk/core/src/test/java/ch/cyberduck/core/io/SHA512ChecksumComputeTest.java

    r39836 r44646  
    1818import ch.cyberduck.core.transfer.TransferStatus;
    1919
     20import org.apache.commons.io.IOUtils;
    2021import org.apache.commons.io.input.NullInputStream;
    2122import org.junit.Test;
     23
     24import java.nio.charset.Charset;
    2225
    2326import static org.junit.Assert.assertEquals;
     
    2831    public void testCompute() throws Exception {
    2932        assertEquals("cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e",
    30                 new SHA512ChecksumCompute().compute(new NullInputStream(0), new TransferStatus()).hash);
     33            new SHA512ChecksumCompute().compute(new NullInputStream(0), new TransferStatus()).hash);
     34    }
     35
     36    @Test
     37    public void testNormalize() throws Exception {
     38        assertEquals("dc6d6c30f2be9c976d6318c9a534d85e9a1c3f3608321a04b4678ef408124d45d7164f3e562e68c6c0b6c077340a785824017032fddfa924f4cf400e6cbb6adc",
     39            new SHA512ChecksumCompute().compute(IOUtils.toInputStream("input", Charset.defaultCharset()),
     40                new TransferStatus()).hash);
     41        assertEquals("dc6d6c30f2be9c976d6318c9a534d85e9a1c3f3608321a04b4678ef408124d45d7164f3e562e68c6c0b6c077340a785824017032fddfa924f4cf400e6cbb6adc",
     42            new SHA512ChecksumCompute().compute(IOUtils.toInputStream("_input", Charset.defaultCharset()),
     43                new TransferStatus().skip(1)).hash);
     44        assertEquals("dc6d6c30f2be9c976d6318c9a534d85e9a1c3f3608321a04b4678ef408124d45d7164f3e562e68c6c0b6c077340a785824017032fddfa924f4cf400e6cbb6adc",
     45            new SHA512ChecksumCompute().compute(IOUtils.toInputStream("_input_", Charset.defaultCharset()),
     46                new TransferStatus().skip(1).length(5)).hash);
    3147    }
    3248}
  • trunk/cryptomator/src/main/java/ch/cyberduck/core/cryptomator/features/CryptoChecksumCompute.java

    r41861 r44646  
    2222import ch.cyberduck.core.exception.BackgroundException;
    2323import ch.cyberduck.core.exception.ChecksumException;
    24 import ch.cyberduck.core.io.AbstractChecksumCompute;
    2524import ch.cyberduck.core.io.Checksum;
    2625import ch.cyberduck.core.io.ChecksumCompute;
     
    4847import java.util.concurrent.Future;
    4948
    50 public class CryptoChecksumCompute extends AbstractChecksumCompute implements ChecksumCompute {
     49public class CryptoChecksumCompute implements ChecksumCompute {
    5150    private static final Logger log = Logger.getLogger(CryptoChecksumCompute.class);
    5251
     
    8281            final PipedOutputStream source = new PipedOutputStream();
    8382            final CryptoOutputStream<Void> out = new CryptoOutputStream<Void>(new VoidStatusOutputStream(source), cryptomator.getCryptor(),
    84                     cryptomator.getCryptor().fileHeaderCryptor().decryptHeader(header), nonces, cryptomator.numberOfChunks(offset));
     83                cryptomator.getCryptor().fileHeaderCryptor().decryptHeader(header), nonces, cryptomator.numberOfChunks(offset));
    8584            final PipedInputStream sink = new PipedInputStream(source, PreferencesFactory.get().getInteger("connection.chunksize"));
    8685            final ThreadPool pool = ThreadPoolFactory.get("checksum", 1);
  • trunk/openstack/src/main/java/ch/cyberduck/core/openstack/SwiftLargeObjectUploadFeature.java

    r41833 r44646  
    3232import ch.cyberduck.core.io.BandwidthThrottle;
    3333import ch.cyberduck.core.io.HashAlgorithm;
    34 import ch.cyberduck.core.io.StreamCopier;
    3534import ch.cyberduck.core.io.StreamListener;
    3635import ch.cyberduck.core.io.StreamProgress;
     
    4241import ch.cyberduck.core.worker.DefaultExceptionMappingService;
    4342
    44 import org.apache.commons.io.input.BoundedInputStream;
    4543import org.apache.log4j.Logger;
    4644
     
    6260
    6361    private final PathContainerService containerService
    64             = new PathContainerService();
     62        = new PathContainerService();
    6563
    6664    private final SwiftSegmentService segmentService;
     
    7674                                         final Long segmentSize, final Integer concurrency) {
    7775        this(session, regionService, new SwiftObjectListService(session, regionService), new SwiftSegmentService(session, regionService), writer,
    78                 segmentSize, concurrency);
     76            segmentSize, concurrency);
    7977    }
    8078
     
    137135                if(log.isDebugEnabled()) {
    138136                    log.debug(String.format("Segment %s submitted with size %d and offset %d",
    139                             segment, length, offset));
     137                        segment, length, offset));
    140138                }
    141139                remaining -= length;
     
    178176            final StorageObject stored = new StorageObject(containerService.getKey(file));
    179177            final String checksum = session.getClient().createSLOManifestObject(regionService.lookup(
    180                     containerService.getContainer(file)),
    181                     containerService.getContainer(file).getName(),
    182                     status.getMime(),
    183                     containerService.getKey(file), manifest, Collections.emptyMap());
     178                containerService.getContainer(file)),
     179                containerService.getContainer(file).getName(),
     180                status.getMime(),
     181                containerService.getKey(file), manifest, Collections.emptyMap());
    184182            // The value of the Content-Length header is the total size of all segment objects, and the value of the ETag header is calculated by taking
    185183            // the ETag value of each segment, concatenating them together, and then returning the MD5 checksum of the result.
     
    205203                }
    206204                final TransferStatus status = new TransferStatus()
    207                         .length(length)
    208                         .skip(offset);
     205                    .length(length)
     206                    .skip(offset);
    209207                status.setHeader(overall.getHeader());
    210208                status.setNonces(overall.getNonces());
    211                 status.setChecksum(writer.checksum(segment).compute(
    212                         StreamCopier.skip(new BoundedInputStream(local.getInputStream(), offset + length), offset), status));
     209                status.setChecksum(writer.checksum(segment).compute(local.getInputStream(), status));
    213210                status.setSegment(true);
    214211                return SwiftLargeObjectUploadFeature.super.upload(
    215                         segment, local, throttle, listener, status, overall, new StreamProgress() {
    216                             @Override
    217                             public void progress(final long bytes) {
    218                                 status.progress(bytes);
    219                                 // Discard sent bytes in overall progress if there is an error reply for segment.
    220                                 overall.progress(bytes);
    221                             }
    222 
    223                             @Override
    224                             public void setComplete() {
    225                                 status.setComplete();
    226                             }
    227                         }, callback);
     212                    segment, local, throttle, listener, status, overall, new StreamProgress() {
     213                        @Override
     214                        public void progress(final long bytes) {
     215                            status.progress(bytes);
     216                            // Discard sent bytes in overall progress if there is an error reply for segment.
     217                            overall.progress(bytes);
     218                        }
     219
     220                        @Override
     221                        public void setComplete() {
     222                            status.setComplete();
     223                        }
     224                    }, callback);
    228225            }
    229226        }, overall));
  • trunk/s3/src/main/java/ch/cyberduck/core/s3/S3MultipartUploadService.java

    r43865 r44646  
    3333import ch.cyberduck.core.io.BandwidthThrottle;
    3434import ch.cyberduck.core.io.MD5ChecksumCompute;
    35 import ch.cyberduck.core.io.StreamCopier;
    3635import ch.cyberduck.core.io.StreamListener;
    3736import ch.cyberduck.core.io.StreamProgress;
     
    4443import ch.cyberduck.core.transfer.TransferStatus;
    4544
    46 import org.apache.commons.io.input.BoundedInputStream;
    4745import org.apache.commons.lang3.StringUtils;
    4846import org.apache.log4j.Logger;
     
    6866
    6967    private final Preferences preferences
    70             = PreferencesFactory.get();
     68        = PreferencesFactory.get();
    7169
    7270    private final S3Session session;
    7371
    7472    private final PathContainerService containerService
    75             = new S3PathContainerService();
     73        = new S3PathContainerService();
    7674
    7775    private final S3DefaultMultipartService multipartService;
     
    8785    public S3MultipartUploadService(final S3Session session, final Write<StorageObject> writer) {
    8886        this(session, writer, PreferencesFactory.get().getLong("s3.upload.multipart.size"),
    89                 PreferencesFactory.get().getInteger("s3.upload.multipart.concurrency"));
     87            PreferencesFactory.get().getInteger("s3.upload.multipart.concurrency"));
    9088    }
    9189
     
    191189                if(log.isInfoEnabled()) {
    192190                    log.info(String.format("Completed multipart upload for %s with %d parts and checksum %s",
    193                             complete.getObjectKey(), completed.size(), complete.getEtag()));
     191                        complete.getObjectKey(), completed.size(), complete.getEtag()));
    194192                }
    195193                if(file.getType().contains(Path.Type.encrypted)) {
     
    203201                    }
    204202                    final String expected = String.format("%s-%d",
    205                             new MD5ChecksumCompute().compute(concat.toString(), status), completed.size());
     203                        new MD5ChecksumCompute().compute(concat.toString(), new TransferStatus()), completed.size());
    206204                    final String reference;
    207205                    if(complete.getEtag().startsWith("\"") && complete.getEtag().endsWith("\"")) {
     
    214212                        if(session.getHost().getHostname().endsWith(preferences.getProperty("s3.hostname.default"))) {
    215213                            throw new ChecksumException(MessageFormat.format(LocaleFactory.localizedString("Upload {0} failed", "Error"), file.getName()),
    216                                     MessageFormat.format("Mismatch between MD5 hash {0} of uploaded data and ETag {1} returned by the server",
    217                                             expected, reference));
     214                                MessageFormat.format("Mismatch between MD5 hash {0} of uploaded data and ETag {1} returned by the server",
     215                                    expected, reference));
    218216                        }
    219217                        else {
     
    255253                requestParameters.put("partNumber", String.valueOf(partNumber));
    256254                final TransferStatus status = new TransferStatus()
    257                         .length(length)
    258                         .skip(offset)
    259                         .withParameters(requestParameters);
     255                    .length(length)
     256                    .skip(offset)
     257                    .withParameters(requestParameters);
    260258                status.setHeader(overall.getHeader());
    261259                status.setNonces(overall.getNonces());
    262260                switch(session.getSignatureVersion()) {
    263261                    case AWS4HMACSHA256:
    264                         status.setChecksum(writer.checksum(file)
    265                                 .compute(StreamCopier.skip(new BoundedInputStream(local.getInputStream(), offset + length), offset), status)
     262                        status.setChecksum(writer.checksum(file).compute(local.getInputStream(), status)
    266263                        );
    267264                        break;
     
    269266                status.setSegment(true);
    270267                final StorageObject part = S3MultipartUploadService.super.upload(
    271                         file, local, throttle, listener, status, overall, new StreamProgress() {
    272                             @Override
    273                             public void progress(final long bytes) {
    274                                 status.progress(bytes);
    275                                 // Discard sent bytes in overall progress if there is an error reply for segment.
    276                                 overall.progress(bytes);
    277                             }
    278 
    279                             @Override
    280                             public void setComplete() {
    281                                 status.setComplete();
    282                             }
    283                         }, callback);
     268                    file, local, throttle, listener, status, overall, new StreamProgress() {
     269                        @Override
     270                        public void progress(final long bytes) {
     271                            status.progress(bytes);
     272                            // Discard sent bytes in overall progress if there is an error reply for segment.
     273                            overall.progress(bytes);
     274                        }
     275
     276                        @Override
     277                        public void setComplete() {
     278                            status.setComplete();
     279                        }
     280                    }, callback);
    284281                if(log.isInfoEnabled()) {
    285282                    log.info(String.format("Received response %s for part number %d", part, partNumber));
     
    287284                // Populate part with response data that is accessible via the object's metadata
    288285                return new MultipartPart(partNumber,
    289                         null == part.getLastModifiedDate() ? new Date(System.currentTimeMillis()) : part.getLastModifiedDate(),
    290                         null == part.getETag() ? StringUtils.EMPTY : part.getETag(),
    291                         part.getContentLength());
     286                    null == part.getLastModifiedDate() ? new Date(System.currentTimeMillis()) : part.getLastModifiedDate(),
     287                    null == part.getETag() ? StringUtils.EMPTY : part.getETag(),
     288                    part.getContentLength());
    292289
    293290            }
  • trunk/s3/src/main/java/ch/cyberduck/core/s3/S3MultipartWriteFeature.java

    r43131 r44646  
    215215                        }
    216216                        final String expected = String.format("%s-%d",
    217                             new MD5ChecksumCompute().compute(concat.toString(), overall), completed.size());
     217                            new MD5ChecksumCompute().compute(concat.toString(), new TransferStatus()), completed.size());
    218218                        final String reference;
    219219                        if(complete.getEtag().startsWith("\"") && complete.getEtag().endsWith("\"")) {
Note: See TracChangeset for help on using the changeset viewer.
swiss made software