Search in sources :

Example 6 with EncryptedFileKey

use of com.dracoon.sdk.crypto.model.EncryptedFileKey in project cyberduck by iterate-ch.

the class SDSDirectS3UploadFeature method upload.

@Override
public Node upload(final Path file, final Local local, final BandwidthThrottle throttle, final StreamListener listener, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException {
    final ThreadPool pool = ThreadPoolFactory.get("multipart", concurrency);
    try {
        final CreateFileUploadRequest createFileUploadRequest = new CreateFileUploadRequest().directS3Upload(true).timestampModification(status.getTimestamp() != null ? new DateTime(status.getTimestamp()) : null).size(TransferStatus.UNKNOWN_LENGTH == status.getLength() ? null : status.getLength()).parentId(Long.parseLong(nodeid.getVersionId(file.getParent(), new DisabledListProgressListener()))).name(file.getName());
        final CreateFileUploadResponse createFileUploadResponse = new NodesApi(session.getClient()).createFileUploadChannel(createFileUploadRequest, StringUtils.EMPTY);
        if (log.isDebugEnabled()) {
            log.debug(String.format("upload started for %s with response %s", file, createFileUploadResponse));
        }
        final Map<Integer, TransferStatus> etags = new HashMap<>();
        final List<PresignedUrl> presignedUrls = this.retrievePresignedUrls(createFileUploadResponse, status);
        final List<Future<TransferStatus>> parts = new ArrayList<>();
        final InputStream in;
        final String random = new UUIDRandomStringService().random();
        if (SDSNodeIdProvider.isEncrypted(file)) {
            in = new SDSTripleCryptEncryptorFeature(session, nodeid).encrypt(file, local.getInputStream(), status);
        } else {
            in = local.getInputStream();
        }
        try {
            // Full size of file
            final long size = status.getLength() + status.getOffset();
            long offset = 0;
            long remaining = status.getLength();
            for (int partNumber = 1; remaining >= 0; partNumber++) {
                final long length = Math.min(Math.max((size / (MAXIMUM_UPLOAD_PARTS - 1)), partsize), remaining);
                final PresignedUrl presignedUrl = presignedUrls.get(partNumber - 1);
                if (SDSNodeIdProvider.isEncrypted(file)) {
                    final Local temporary = temp.create(String.format("%s-%d", random, partNumber));
                    if (log.isDebugEnabled()) {
                        log.debug(String.format("Encrypted contents for part %d to %s", partNumber, temporary));
                    }
                    new StreamCopier(status, StreamProgress.noop).withAutoclose(false).withLimit(length).transfer(in, new BufferOutputStream(new FileBuffer(temporary)));
                    parts.add(this.submit(pool, file, temporary, throttle, listener, status, presignedUrl.getUrl(), presignedUrl.getPartNumber(), 0L, length, callback));
                } else {
                    parts.add(this.submit(pool, file, local, throttle, listener, status, presignedUrl.getUrl(), presignedUrl.getPartNumber(), offset, length, callback));
                }
                remaining -= length;
                offset += length;
                if (0L == remaining) {
                    break;
                }
            }
        } finally {
            in.close();
        }
        for (Future<TransferStatus> future : parts) {
            try {
                final TransferStatus part = future.get();
                etags.put(part.getPart(), part);
            } catch (InterruptedException e) {
                log.error("Part upload failed with interrupt failure");
                status.setCanceled();
                throw new ConnectionCanceledException(e);
            } catch (ExecutionException e) {
                log.warn(String.format("Part upload failed with execution failure %s", e.getMessage()));
                if (e.getCause() instanceof BackgroundException) {
                    throw (BackgroundException) e.getCause();
                }
                throw new BackgroundException(e.getCause());
            }
        }
        final CompleteS3FileUploadRequest completeS3FileUploadRequest = new CompleteS3FileUploadRequest().keepShareLinks(status.isExists() ? new HostPreferences(session.getHost()).getBoolean("sds.upload.sharelinks.keep") : false).resolutionStrategy(status.isExists() ? CompleteS3FileUploadRequest.ResolutionStrategyEnum.OVERWRITE : CompleteS3FileUploadRequest.ResolutionStrategyEnum.FAIL);
        if (status.getFilekey() != null) {
            final ObjectReader reader = session.getClient().getJSON().getContext(null).readerFor(FileKey.class);
            final FileKey fileKey = reader.readValue(status.getFilekey().array());
            final EncryptedFileKey encryptFileKey = Crypto.encryptFileKey(TripleCryptConverter.toCryptoPlainFileKey(fileKey), TripleCryptConverter.toCryptoUserPublicKey(session.keyPair().getPublicKeyContainer()));
            completeS3FileUploadRequest.setFileKey(TripleCryptConverter.toSwaggerFileKey(encryptFileKey));
        }
        etags.forEach((key, value) -> completeS3FileUploadRequest.addPartsItem(new S3FileUploadPart().partEtag(value.getChecksum().hash).partNumber(key)));
        if (log.isDebugEnabled()) {
            log.debug(String.format("Complete file upload with %s for %s", completeS3FileUploadRequest, file));
        }
        new NodesApi(session.getClient()).completeS3FileUpload(completeS3FileUploadRequest, createFileUploadResponse.getUploadId(), StringUtils.EMPTY);
        // Polling
        final ScheduledThreadPool polling = new ScheduledThreadPool();
        final CountDownLatch done = new CountDownLatch(1);
        final AtomicReference<BackgroundException> failure = new AtomicReference<>();
        final ScheduledFuture f = polling.repeat(new Runnable() {

            @Override
            public void run() {
                try {
                    if (log.isDebugEnabled()) {
                        log.debug(String.format("Query upload status for %s", createFileUploadResponse));
                    }
                    final S3FileUploadStatus uploadStatus = new NodesApi(session.getClient()).requestUploadStatusFiles(createFileUploadResponse.getUploadId(), StringUtils.EMPTY, null);
                    switch(uploadStatus.getStatus()) {
                        case "finishing":
                            // Expected
                            break;
                        case "transfer":
                            failure.set(new InteroperabilityException(uploadStatus.getStatus()));
                            done.countDown();
                            break;
                        case "error":
                            failure.set(new InteroperabilityException(uploadStatus.getErrorDetails().getMessage()));
                            done.countDown();
                            break;
                        case "done":
                            // Set node id in transfer status
                            nodeid.cache(file, String.valueOf(uploadStatus.getNode().getId()));
                            // Mark parent status as complete
                            status.withResponse(new SDSAttributesAdapter(session).toAttributes(uploadStatus.getNode())).setComplete();
                            done.countDown();
                            break;
                    }
                } catch (ApiException e) {
                    failure.set(new SDSExceptionMappingService(nodeid).map("Upload {0} failed", e, file));
                    done.countDown();
                }
            }
        }, new HostPreferences(session.getHost()).getLong("sds.upload.s3.status.period"), TimeUnit.MILLISECONDS);
        Uninterruptibles.awaitUninterruptibly(done);
        polling.shutdown();
        if (null != failure.get()) {
            throw failure.get();
        }
        return null;
    } catch (CryptoSystemException | InvalidFileKeyException | InvalidKeyPairException | UnknownVersionException e) {
        throw new TripleCryptExceptionMappingService().map("Upload {0} failed", e, file);
    } catch (ApiException e) {
        throw new SDSExceptionMappingService(nodeid).map("Upload {0} failed", e, file);
    } catch (IOException e) {
        throw new DefaultIOExceptionMappingService().map(e);
    } finally {
        temp.shutdown();
        // Cancel future tasks
        pool.shutdown(false);
    }
}
Also used : DisabledListProgressListener(ch.cyberduck.core.DisabledListProgressListener) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) DateTime(org.joda.time.DateTime) NodesApi(ch.cyberduck.core.sds.io.swagger.client.api.NodesApi) PresignedUrl(ch.cyberduck.core.sds.io.swagger.client.model.PresignedUrl) ScheduledThreadPool(ch.cyberduck.core.threading.ScheduledThreadPool) CreateFileUploadResponse(ch.cyberduck.core.sds.io.swagger.client.model.CreateFileUploadResponse) InvalidFileKeyException(com.dracoon.sdk.crypto.error.InvalidFileKeyException) S3FileUploadStatus(ch.cyberduck.core.sds.io.swagger.client.model.S3FileUploadStatus) ConnectionCanceledException(ch.cyberduck.core.exception.ConnectionCanceledException) Local(ch.cyberduck.core.Local) HostPreferences(ch.cyberduck.core.preferences.HostPreferences) CreateFileUploadRequest(ch.cyberduck.core.sds.io.swagger.client.model.CreateFileUploadRequest) UnknownVersionException(com.dracoon.sdk.crypto.error.UnknownVersionException) BackgroundException(ch.cyberduck.core.exception.BackgroundException) EncryptedFileKey(com.dracoon.sdk.crypto.model.EncryptedFileKey) FileBuffer(ch.cyberduck.core.io.FileBuffer) ThreadPool(ch.cyberduck.core.threading.ThreadPool) ScheduledThreadPool(ch.cyberduck.core.threading.ScheduledThreadPool) BufferOutputStream(ch.cyberduck.core.io.BufferOutputStream) InvalidKeyPairException(com.dracoon.sdk.crypto.error.InvalidKeyPairException) TransferStatus(ch.cyberduck.core.transfer.TransferStatus) ObjectReader(com.fasterxml.jackson.databind.ObjectReader) ExecutionException(java.util.concurrent.ExecutionException) FileKey(ch.cyberduck.core.sds.io.swagger.client.model.FileKey) EncryptedFileKey(com.dracoon.sdk.crypto.model.EncryptedFileKey) InteroperabilityException(ch.cyberduck.core.exception.InteroperabilityException) InputStream(java.io.InputStream) AtomicReference(java.util.concurrent.atomic.AtomicReference) IOException(java.io.IOException) CountDownLatch(java.util.concurrent.CountDownLatch) UUIDRandomStringService(ch.cyberduck.core.UUIDRandomStringService) ScheduledFuture(java.util.concurrent.ScheduledFuture) S3FileUploadPart(ch.cyberduck.core.sds.io.swagger.client.model.S3FileUploadPart) ScheduledFuture(java.util.concurrent.ScheduledFuture) Future(java.util.concurrent.Future) TripleCryptExceptionMappingService(ch.cyberduck.core.sds.triplecrypt.TripleCryptExceptionMappingService) DefaultIOExceptionMappingService(ch.cyberduck.core.DefaultIOExceptionMappingService) StreamCopier(ch.cyberduck.core.io.StreamCopier) CompleteS3FileUploadRequest(ch.cyberduck.core.sds.io.swagger.client.model.CompleteS3FileUploadRequest) ApiException(ch.cyberduck.core.sds.io.swagger.client.ApiException) CryptoSystemException(com.dracoon.sdk.crypto.error.CryptoSystemException)

Example 7 with EncryptedFileKey

use of com.dracoon.sdk.crypto.model.EncryptedFileKey in project cyberduck by iterate-ch.

the class SDSUploadService method complete.

/**
 * Complete file upload
 *
 * @param file        Remote path
 * @param uploadToken Upload token
 * @param status      Transfer status
 * @return Node Id from server
 */
public Node complete(final Path file, final String uploadToken, final TransferStatus status) throws BackgroundException {
    try {
        final CompleteUploadRequest body = new CompleteUploadRequest().keepShareLinks(status.isExists() ? new HostPreferences(session.getHost()).getBoolean("sds.upload.sharelinks.keep") : false).resolutionStrategy(status.isExists() ? CompleteUploadRequest.ResolutionStrategyEnum.OVERWRITE : CompleteUploadRequest.ResolutionStrategyEnum.FAIL);
        if (status.getFilekey() != null) {
            final ObjectReader reader = session.getClient().getJSON().getContext(null).readerFor(FileKey.class);
            final FileKey fileKey = reader.readValue(status.getFilekey().array());
            final EncryptedFileKey encryptFileKey = Crypto.encryptFileKey(TripleCryptConverter.toCryptoPlainFileKey(fileKey), TripleCryptConverter.toCryptoUserPublicKey(session.keyPair().getPublicKeyContainer()));
            body.setFileKey(TripleCryptConverter.toSwaggerFileKey(encryptFileKey));
        }
        final Node upload = new UploadsApi(session.getClient()).completeFileUploadByToken(body, uploadToken, StringUtils.EMPTY);
        if (!upload.isIsEncrypted()) {
            final Checksum checksum = status.getChecksum();
            if (Checksum.NONE != checksum) {
                final Checksum server = Checksum.parse(upload.getHash());
                if (Checksum.NONE != server) {
                    if (checksum.algorithm.equals(server.algorithm)) {
                        if (!server.equals(checksum)) {
                            throw new ChecksumException(MessageFormat.format(LocaleFactory.localizedString("Upload {0} failed", "Error"), file.getName()), MessageFormat.format("Mismatch between MD5 hash {0} of uploaded data and ETag {1} returned by the server", checksum.hash, server.hash));
                        }
                    }
                }
            }
        }
        nodeid.cache(file, String.valueOf(upload.getId()));
        return upload;
    } catch (ApiException e) {
        throw new SDSExceptionMappingService(nodeid).map("Upload {0} failed", e, file);
    } catch (CryptoSystemException | InvalidFileKeyException | InvalidKeyPairException | UnknownVersionException e) {
        throw new TripleCryptExceptionMappingService().map("Upload {0} failed", e, file);
    } catch (IOException e) {
        throw new DefaultIOExceptionMappingService().map("Upload {0} failed", e, file);
    }
}
Also used : EncryptedFileKey(com.dracoon.sdk.crypto.model.EncryptedFileKey) FileKey(ch.cyberduck.core.sds.io.swagger.client.model.FileKey) InvalidFileKeyException(com.dracoon.sdk.crypto.error.InvalidFileKeyException) EncryptedFileKey(com.dracoon.sdk.crypto.model.EncryptedFileKey) ChecksumException(ch.cyberduck.core.exception.ChecksumException) Node(ch.cyberduck.core.sds.io.swagger.client.model.Node) UploadsApi(ch.cyberduck.core.sds.io.swagger.client.api.UploadsApi) InvalidKeyPairException(com.dracoon.sdk.crypto.error.InvalidKeyPairException) IOException(java.io.IOException) HostPreferences(ch.cyberduck.core.preferences.HostPreferences) Checksum(ch.cyberduck.core.io.Checksum) CompleteUploadRequest(ch.cyberduck.core.sds.io.swagger.client.model.CompleteUploadRequest) TripleCryptExceptionMappingService(ch.cyberduck.core.sds.triplecrypt.TripleCryptExceptionMappingService) ObjectReader(com.fasterxml.jackson.databind.ObjectReader) DefaultIOExceptionMappingService(ch.cyberduck.core.DefaultIOExceptionMappingService) UnknownVersionException(com.dracoon.sdk.crypto.error.UnknownVersionException) ApiException(ch.cyberduck.core.sds.io.swagger.client.ApiException) CryptoSystemException(com.dracoon.sdk.crypto.error.CryptoSystemException)

Example 8 with EncryptedFileKey

use of com.dracoon.sdk.crypto.model.EncryptedFileKey in project cyberduck by iterate-ch.

the class SDSMissingFileKeysSchedulerFeatureTest method testFileKeyMigration.

@Test
public void testFileKeyMigration() throws Exception {
    final UserApi userApi = new UserApi(session.getClient());
    this.removeKeyPairs(userApi);
    session.resetUserKeyPairs();
    // create legacy and new crypto key pair
    final UserKeyPair deprecated = Crypto.generateUserKeyPair(UserKeyPair.Version.RSA2048, "eth[oh8uv4Eesij");
    userApi.setUserKeyPair(TripleCryptConverter.toSwaggerUserKeyPairContainer(deprecated), null);
    List<UserKeyPairContainer> keyPairs = userApi.requestUserKeyPairs(null, null);
    assertEquals(1, keyPairs.size());
    final SDSNodeIdProvider nodeid = new SDSNodeIdProvider(session);
    final Path room = new SDSDirectoryFeature(session, nodeid).createRoom(new Path(new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory, Path.Type.volume)), true);
    final byte[] content = RandomUtils.nextBytes(32769);
    final TransferStatus status = new TransferStatus();
    status.setLength(content.length);
    final Path test = new Path(room, UUID.randomUUID().toString(), EnumSet.of(Path.Type.file));
    final SDSEncryptionBulkFeature bulk = new SDSEncryptionBulkFeature(session, nodeid);
    bulk.pre(Transfer.Type.upload, Collections.singletonMap(new TransferItem(test), status), new DisabledConnectionCallback());
    final TripleCryptWriteFeature writer = new TripleCryptWriteFeature(session, nodeid, new SDSMultipartWriteFeature(session, nodeid));
    final StatusOutputStream<Node> out = writer.write(test, status, new DisabledConnectionCallback());
    new StreamCopier(status, status).transfer(new ByteArrayInputStream(content), out);
    // Start migration
    session.unlockTripleCryptKeyPair(new DisabledLoginCallback() {

        @Override
        public Credentials prompt(final Host bookmark, final String title, final String reason, final LoginOptions options) throws LoginCanceledException {
            return new VaultCredentials("eth[oh8uv4Eesij");
        }
    }, session.userAccount(), UserKeyPair.Version.RSA4096);
    keyPairs = userApi.requestUserKeyPairs(null, null);
    assertEquals(2, keyPairs.size());
    final FileKey key = new NodesApi(session.getClient()).requestUserFileKey(Long.parseLong(test.attributes().getVersionId()), null, null);
    final EncryptedFileKey encFileKey = TripleCryptConverter.toCryptoEncryptedFileKey(key);
    assertEquals(EncryptedFileKey.Version.RSA2048_AES256GCM, encFileKey.getVersion());
    final SDSMissingFileKeysSchedulerFeature background = new SDSMissingFileKeysSchedulerFeature();
    final List<UserFileKeySetRequest> processed = background.operate(session, new DisabledPasswordCallback() {

        @Override
        public Credentials prompt(final Host bookmark, final String title, final String reason, final LoginOptions options) {
            return new VaultCredentials("eth[oh8uv4Eesij");
        }
    }, null);
    assertFalse(processed.isEmpty());
    boolean found = false;
    for (UserFileKeySetRequest p : processed) {
        if (p.getFileId().equals(Long.parseLong(test.attributes().getVersionId()))) {
            found = true;
            break;
        }
    }
    assertTrue(found);
    final List<UserFileKeySetRequest> empty = new SDSMissingFileKeysSchedulerFeature().operate(session, new DisabledPasswordCallback() {

        @Override
        public Credentials prompt(final Host bookmark, final String title, final String reason, final LoginOptions options) {
            return new VaultCredentials("eth[oh8uv4Eesij");
        }
    }, null);
    assertTrue(empty.isEmpty());
    assertEquals(2, userApi.requestUserKeyPairs(null, null).size());
    new SDSDeleteFeature(session, nodeid).delete(Collections.singletonList(room), new DisabledLoginCallback(), new Delete.DisabledCallback());
}
Also used : Delete(ch.cyberduck.core.features.Delete) EncryptedFileKey(com.dracoon.sdk.crypto.model.EncryptedFileKey) Node(ch.cyberduck.core.sds.io.swagger.client.model.Node) LoginOptions(ch.cyberduck.core.LoginOptions) NodesApi(ch.cyberduck.core.sds.io.swagger.client.api.NodesApi) TransferStatus(ch.cyberduck.core.transfer.TransferStatus) TripleCryptWriteFeature(ch.cyberduck.core.sds.triplecrypt.TripleCryptWriteFeature) UserApi(ch.cyberduck.core.sds.io.swagger.client.api.UserApi) UserKeyPair(com.dracoon.sdk.crypto.model.UserKeyPair) Path(ch.cyberduck.core.Path) EncryptedFileKey(com.dracoon.sdk.crypto.model.EncryptedFileKey) FileKey(ch.cyberduck.core.sds.io.swagger.client.model.FileKey) UserKeyPairContainer(ch.cyberduck.core.sds.io.swagger.client.model.UserKeyPairContainer) VaultCredentials(ch.cyberduck.core.vault.VaultCredentials) LoginCanceledException(ch.cyberduck.core.exception.LoginCanceledException) Host(ch.cyberduck.core.Host) UserFileKeySetRequest(ch.cyberduck.core.sds.io.swagger.client.model.UserFileKeySetRequest) ByteArrayInputStream(java.io.ByteArrayInputStream) DisabledLoginCallback(ch.cyberduck.core.DisabledLoginCallback) AlphanumericRandomStringService(ch.cyberduck.core.AlphanumericRandomStringService) TransferItem(ch.cyberduck.core.transfer.TransferItem) DisabledPasswordCallback(ch.cyberduck.core.DisabledPasswordCallback) DisabledConnectionCallback(ch.cyberduck.core.DisabledConnectionCallback) StreamCopier(ch.cyberduck.core.io.StreamCopier) VaultCredentials(ch.cyberduck.core.vault.VaultCredentials) Credentials(ch.cyberduck.core.Credentials) Test(org.junit.Test) IntegrationTest(ch.cyberduck.test.IntegrationTest)

Example 9 with EncryptedFileKey

use of com.dracoon.sdk.crypto.model.EncryptedFileKey in project cyberduck by iterate-ch.

the class PresignedMultipartOutputStream method close.

@Override
public void close() throws IOException {
    try {
        if (close.get()) {
            log.warn(String.format("Skip double close of stream %s", this));
            return;
        }
        if (null != canceled.get()) {
            return;
        }
        if (etags.isEmpty()) {
            new SDSTouchFeature(session, nodeid).touch(file, new TransferStatus());
        } else {
            try {
                final CompleteS3FileUploadRequest completeS3FileUploadRequest = new CompleteS3FileUploadRequest().keepShareLinks(overall.isExists() ? new HostPreferences(session.getHost()).getBoolean("sds.upload.sharelinks.keep") : false).resolutionStrategy(overall.isExists() ? CompleteS3FileUploadRequest.ResolutionStrategyEnum.OVERWRITE : CompleteS3FileUploadRequest.ResolutionStrategyEnum.FAIL);
                if (overall.getFilekey() != null) {
                    final ObjectReader reader = session.getClient().getJSON().getContext(null).readerFor(FileKey.class);
                    final FileKey fileKey = reader.readValue(overall.getFilekey().array());
                    final EncryptedFileKey encryptFileKey = Crypto.encryptFileKey(TripleCryptConverter.toCryptoPlainFileKey(fileKey), TripleCryptConverter.toCryptoUserPublicKey(session.keyPair().getPublicKeyContainer()));
                    completeS3FileUploadRequest.setFileKey(TripleCryptConverter.toSwaggerFileKey(encryptFileKey));
                }
                etags.forEach((key, value) -> completeS3FileUploadRequest.addPartsItem(new S3FileUploadPart().partEtag(StringUtils.remove(value, '"')).partNumber(key)));
                new NodesApi(session.getClient()).completeS3FileUpload(completeS3FileUploadRequest, createFileUploadResponse.getUploadId(), StringUtils.EMPTY);
                // Polling
                final ScheduledThreadPool polling = new ScheduledThreadPool();
                final CountDownLatch done = new CountDownLatch(1);
                final AtomicReference<BackgroundException> failure = new AtomicReference<>();
                final ScheduledFuture f = polling.repeat(new Runnable() {

                    @Override
                    public void run() {
                        try {
                            final S3FileUploadStatus uploadStatus = new NodesApi(session.getClient()).requestUploadStatusFiles(createFileUploadResponse.getUploadId(), StringUtils.EMPTY, null);
                            switch(uploadStatus.getStatus()) {
                                case "finishing":
                                    // Expected
                                    break;
                                case "transfer":
                                    failure.set(new InteroperabilityException(uploadStatus.getStatus()));
                                    done.countDown();
                                case "error":
                                    failure.set(new InteroperabilityException(uploadStatus.getErrorDetails().getMessage()));
                                    done.countDown();
                                case "done":
                                    nodeid.cache(file, String.valueOf(uploadStatus.getNode().getId()));
                                    done.countDown();
                                    break;
                            }
                        } catch (ApiException e) {
                            failure.set(new SDSExceptionMappingService(nodeid).map("Upload {0} failed", e, file));
                            done.countDown();
                        }
                    }
                }, new HostPreferences(session.getHost()).getLong("sds.upload.s3.status.period"), TimeUnit.MILLISECONDS);
                Uninterruptibles.awaitUninterruptibly(done);
                polling.shutdown();
                if (null != failure.get()) {
                    throw failure.get();
                }
            } catch (CryptoSystemException | InvalidFileKeyException | InvalidKeyPairException | UnknownVersionException e) {
                throw new TripleCryptExceptionMappingService().map("Upload {0} failed", e, file);
            } catch (ApiException e) {
                throw new SDSExceptionMappingService(nodeid).map("Upload {0} failed", e, file);
            }
        }
    } catch (BackgroundException e) {
        throw new IOException(e);
    } finally {
        close.set(true);
    }
}
Also used : EncryptedFileKey(com.dracoon.sdk.crypto.model.EncryptedFileKey) InvalidKeyPairException(com.dracoon.sdk.crypto.error.InvalidKeyPairException) NodesApi(ch.cyberduck.core.sds.io.swagger.client.api.NodesApi) TransferStatus(ch.cyberduck.core.transfer.TransferStatus) ScheduledThreadPool(ch.cyberduck.core.threading.ScheduledThreadPool) ObjectReader(com.fasterxml.jackson.databind.ObjectReader) FileKey(ch.cyberduck.core.sds.io.swagger.client.model.FileKey) EncryptedFileKey(com.dracoon.sdk.crypto.model.EncryptedFileKey) InvalidFileKeyException(com.dracoon.sdk.crypto.error.InvalidFileKeyException) S3FileUploadStatus(ch.cyberduck.core.sds.io.swagger.client.model.S3FileUploadStatus) InteroperabilityException(ch.cyberduck.core.exception.InteroperabilityException) AtomicReference(java.util.concurrent.atomic.AtomicReference) IOException(java.io.IOException) CountDownLatch(java.util.concurrent.CountDownLatch) ScheduledFuture(java.util.concurrent.ScheduledFuture) HostPreferences(ch.cyberduck.core.preferences.HostPreferences) S3FileUploadPart(ch.cyberduck.core.sds.io.swagger.client.model.S3FileUploadPart) TripleCryptExceptionMappingService(ch.cyberduck.core.sds.triplecrypt.TripleCryptExceptionMappingService) UnknownVersionException(com.dracoon.sdk.crypto.error.UnknownVersionException) CompleteS3FileUploadRequest(ch.cyberduck.core.sds.io.swagger.client.model.CompleteS3FileUploadRequest) BackgroundException(ch.cyberduck.core.exception.BackgroundException) ApiException(ch.cyberduck.core.sds.io.swagger.client.ApiException) CryptoSystemException(com.dracoon.sdk.crypto.error.CryptoSystemException)

Aggregations

EncryptedFileKey (com.dracoon.sdk.crypto.model.EncryptedFileKey)9 ApiException (ch.cyberduck.core.sds.io.swagger.client.ApiException)6 NodesApi (ch.cyberduck.core.sds.io.swagger.client.api.NodesApi)6 FileKey (ch.cyberduck.core.sds.io.swagger.client.model.FileKey)6 TripleCryptExceptionMappingService (ch.cyberduck.core.sds.triplecrypt.TripleCryptExceptionMappingService)5 DisabledListProgressListener (ch.cyberduck.core.DisabledListProgressListener)4 InvalidFileKeyException (com.dracoon.sdk.crypto.error.InvalidFileKeyException)4 Credentials (ch.cyberduck.core.Credentials)3 HostPreferences (ch.cyberduck.core.preferences.HostPreferences)3 TransferStatus (ch.cyberduck.core.transfer.TransferStatus)3 CryptoException (com.dracoon.sdk.crypto.error.CryptoException)3 CryptoSystemException (com.dracoon.sdk.crypto.error.CryptoSystemException)3 InvalidKeyPairException (com.dracoon.sdk.crypto.error.InvalidKeyPairException)3 UnknownVersionException (com.dracoon.sdk.crypto.error.UnknownVersionException)3 UserKeyPair (com.dracoon.sdk.crypto.model.UserKeyPair)3 ObjectReader (com.fasterxml.jackson.databind.ObjectReader)3 IOException (java.io.IOException)3 DefaultIOExceptionMappingService (ch.cyberduck.core.DefaultIOExceptionMappingService)2 Host (ch.cyberduck.core.Host)2 LoginOptions (ch.cyberduck.core.LoginOptions)2