Search in sources :

Example 1 with SDSAttributesFinderFeature

use of ch.cyberduck.core.sds.SDSAttributesFinderFeature in project cyberduck by iterate-ch.

the class TripleCryptWriteFeatureTest method testWrite.

@Test
public void testWrite() throws Exception {
    final Path room = new Path("test", EnumSet.of(Path.Type.directory, Path.Type.volume), new PathAttributes().withCustom(KEY_ENCRYPTED, String.valueOf(true)));
    final SDSNodeIdProvider nodeid = new SDSNodeIdProvider(session);
    final TripleCryptWriteFeature writer = new TripleCryptWriteFeature(session, nodeid, new SDSMultipartWriteFeature(session, nodeid));
    final byte[] content = RandomUtils.nextBytes(32769);
    final TransferStatus status = new TransferStatus();
    status.setLength(content.length);
    status.setChecksum(new MD5ChecksumCompute().compute(new ByteArrayInputStream(content), new TransferStatus()));
    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 StatusOutputStream<Node> out = writer.write(test, status, new DisabledConnectionCallback());
    assertNotNull(out);
    new StreamCopier(status, status).transfer(new ByteArrayInputStream(content), out);
    assertNotNull(test.attributes().getVersionId());
    assertTrue(new DefaultFindFeature(session).find(test));
    assertEquals(content.length, new SDSAttributesFinderFeature(session, nodeid).find(test).getSize());
    final byte[] compare = new byte[content.length];
    final InputStream stream = new TripleCryptReadFeature(session, nodeid, new SDSReadFeature(session, nodeid)).read(test, new TransferStatus(), new DisabledConnectionCallback() {

        @Override
        public void warn(final Host bookmark, final String title, final String message, final String defaultButton, final String cancelButton, final String preference) {
        // 
        }

        @Override
        public Credentials prompt(final Host bookmark, final String title, final String reason, final LoginOptions options) {
            return new VaultCredentials("eth[oh8uv4Eesij");
        }
    });
    IOUtils.readFully(stream, compare);
    stream.close();
    assertArrayEquals(content, compare);
    new SDSDeleteFeature(session, nodeid).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
}
Also used : Delete(ch.cyberduck.core.features.Delete) SDSDeleteFeature(ch.cyberduck.core.sds.SDSDeleteFeature) Node(ch.cyberduck.core.sds.io.swagger.client.model.Node) LoginOptions(ch.cyberduck.core.LoginOptions) SDSEncryptionBulkFeature(ch.cyberduck.core.sds.SDSEncryptionBulkFeature) DefaultFindFeature(ch.cyberduck.core.shared.DefaultFindFeature) TransferStatus(ch.cyberduck.core.transfer.TransferStatus) SDSAttributesFinderFeature(ch.cyberduck.core.sds.SDSAttributesFinderFeature) Path(ch.cyberduck.core.Path) VaultCredentials(ch.cyberduck.core.vault.VaultCredentials) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) PathAttributes(ch.cyberduck.core.PathAttributes) SDSMultipartWriteFeature(ch.cyberduck.core.sds.SDSMultipartWriteFeature) Host(ch.cyberduck.core.Host) MD5ChecksumCompute(ch.cyberduck.core.io.MD5ChecksumCompute) SDSNodeIdProvider(ch.cyberduck.core.sds.SDSNodeIdProvider) ByteArrayInputStream(java.io.ByteArrayInputStream) SDSReadFeature(ch.cyberduck.core.sds.SDSReadFeature) DisabledLoginCallback(ch.cyberduck.core.DisabledLoginCallback) TransferItem(ch.cyberduck.core.transfer.TransferItem) DisabledConnectionCallback(ch.cyberduck.core.DisabledConnectionCallback) StreamCopier(ch.cyberduck.core.io.StreamCopier) VaultCredentials(ch.cyberduck.core.vault.VaultCredentials) Credentials(ch.cyberduck.core.Credentials) AbstractSDSTest(ch.cyberduck.core.sds.AbstractSDSTest) Test(org.junit.Test) IntegrationTest(ch.cyberduck.test.IntegrationTest)

Example 2 with SDSAttributesFinderFeature

use of ch.cyberduck.core.sds.SDSAttributesFinderFeature in project cyberduck by iterate-ch.

the class TripleCryptWriteFeatureTest method testWriteMultipart.

@Test
public void testWriteMultipart() throws Exception {
    final Path room = new Path("test", EnumSet.of(Path.Type.directory, Path.Type.volume), new PathAttributes().withCustom(KEY_ENCRYPTED, String.valueOf(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 SDSNodeIdProvider nodeid = new SDSNodeIdProvider(session);
    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());
    assertNotNull(out);
    new StreamCopier(status, status).transfer(new ByteArrayInputStream(content), out);
    assertNotNull(test.attributes().getVersionId());
    assertTrue(new DefaultFindFeature(session).find(test));
    assertEquals(content.length, new SDSAttributesFinderFeature(session, nodeid).find(test).getSize());
    final byte[] compare = new byte[content.length];
    final InputStream stream = new TripleCryptReadFeature(session, nodeid, new SDSReadFeature(session, nodeid)).read(test, new TransferStatus(), new DisabledConnectionCallback() {

        @Override
        public void warn(final Host bookmark, final String title, final String message, final String defaultButton, final String cancelButton, final String preference) {
        // 
        }

        @Override
        public Credentials prompt(final Host bookmark, final String title, final String reason, final LoginOptions options) {
            return new VaultCredentials("eth[oh8uv4Eesij");
        }
    });
    IOUtils.readFully(stream, compare);
    stream.close();
    assertArrayEquals(content, compare);
    new SDSDeleteFeature(session, nodeid).delete(Collections.singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
}
Also used : Delete(ch.cyberduck.core.features.Delete) SDSDeleteFeature(ch.cyberduck.core.sds.SDSDeleteFeature) Node(ch.cyberduck.core.sds.io.swagger.client.model.Node) LoginOptions(ch.cyberduck.core.LoginOptions) SDSEncryptionBulkFeature(ch.cyberduck.core.sds.SDSEncryptionBulkFeature) DefaultFindFeature(ch.cyberduck.core.shared.DefaultFindFeature) TransferStatus(ch.cyberduck.core.transfer.TransferStatus) SDSAttributesFinderFeature(ch.cyberduck.core.sds.SDSAttributesFinderFeature) Path(ch.cyberduck.core.Path) VaultCredentials(ch.cyberduck.core.vault.VaultCredentials) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) PathAttributes(ch.cyberduck.core.PathAttributes) SDSMultipartWriteFeature(ch.cyberduck.core.sds.SDSMultipartWriteFeature) Host(ch.cyberduck.core.Host) SDSNodeIdProvider(ch.cyberduck.core.sds.SDSNodeIdProvider) ByteArrayInputStream(java.io.ByteArrayInputStream) SDSReadFeature(ch.cyberduck.core.sds.SDSReadFeature) DisabledLoginCallback(ch.cyberduck.core.DisabledLoginCallback) TransferItem(ch.cyberduck.core.transfer.TransferItem) DisabledConnectionCallback(ch.cyberduck.core.DisabledConnectionCallback) StreamCopier(ch.cyberduck.core.io.StreamCopier) VaultCredentials(ch.cyberduck.core.vault.VaultCredentials) Credentials(ch.cyberduck.core.Credentials) AbstractSDSTest(ch.cyberduck.core.sds.AbstractSDSTest) Test(org.junit.Test) IntegrationTest(ch.cyberduck.test.IntegrationTest)

Example 3 with SDSAttributesFinderFeature

use of ch.cyberduck.core.sds.SDSAttributesFinderFeature in project cyberduck by iterate-ch.

the class SDSSingleTransferWorkerTest method testDownloadVersioned.

@Test
public void testDownloadVersioned() throws Exception {
    final SDSNodeIdProvider fileid = new SDSNodeIdProvider(session);
    final Path room = new SDSDirectoryFeature(session, fileid).mkdir(new Path(new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory, Path.Type.volume)), new TransferStatus());
    final Path test = new Path(room, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
    final Local localFile = new DefaultTemporaryFileService().create(test.getName());
    {
        final byte[] content = RandomUtils.nextBytes(39864);
        final TransferStatus writeStatus = new TransferStatus().withLength(content.length).withChecksum(new SHA256ChecksumCompute().compute(new ByteArrayInputStream(content), new TransferStatus()));
        final StatusOutputStream<Node> out = new SDSMultipartWriteFeature(session, fileid).write(test, writeStatus, new DisabledConnectionCallback());
        assertNotNull(out);
        new StreamCopier(writeStatus, writeStatus).withLimit((long) content.length).transfer(new ByteArrayInputStream(content), out);
        out.close();
    }
    final byte[] content = RandomUtils.nextBytes(39864);
    final TransferStatus writeStatus = new TransferStatus().exists(true).withLength(content.length).withChecksum(new SHA256ChecksumCompute().compute(new ByteArrayInputStream(content), new TransferStatus()));
    final StatusOutputStream<Node> out = new SDSMultipartWriteFeature(session, fileid).write(test, writeStatus, new DisabledConnectionCallback());
    assertNotNull(out);
    new StreamCopier(writeStatus, writeStatus).withLimit((long) content.length).transfer(new ByteArrayInputStream(content), out);
    out.close();
    final String versionId = test.attributes().getVersionId();
    assertEquals(versionId, new SDSAttributesFinderFeature(session, fileid).find(test).getVersionId());
    assertEquals(versionId, new DefaultAttributesFinderFeature(session).find(test).getVersionId());
    final Transfer t = new DownloadTransfer(new Host(new TestProtocol()), Collections.singletonList(new TransferItem(test, localFile)), new NullFilter<>());
    assertTrue(new SingleTransferWorker(session, session, t, new TransferOptions(), new TransferSpeedometer(t), new DisabledTransferPrompt() {

        @Override
        public TransferAction prompt(final TransferItem file) {
            return TransferAction.overwrite;
        }
    }, new DisabledTransferErrorCallback(), new DisabledProgressListener(), new DisabledStreamListener(), new DisabledLoginCallback(), new DisabledNotificationService()) {
    }.run(session));
    byte[] compare = new byte[content.length];
    assertArrayEquals(content, IOUtils.toByteArray(localFile.getInputStream()));
    test.attributes().setVersionId(versionId);
    assertEquals(versionId, new DefaultAttributesFinderFeature(session).find(test).getVersionId());
    new SDSDeleteFeature(session, fileid).delete(Arrays.asList(test, room), new DisabledLoginCallback(), new Delete.DisabledCallback());
    localFile.delete();
    session.close();
}
Also used : Delete(ch.cyberduck.core.features.Delete) SDSDeleteFeature(ch.cyberduck.core.sds.SDSDeleteFeature) TestProtocol(ch.cyberduck.core.TestProtocol) TransferAction(ch.cyberduck.core.transfer.TransferAction) Node(ch.cyberduck.core.sds.io.swagger.client.model.Node) TransferOptions(ch.cyberduck.core.transfer.TransferOptions) DownloadTransfer(ch.cyberduck.core.transfer.DownloadTransfer) TransferStatus(ch.cyberduck.core.transfer.TransferStatus) SDSAttributesFinderFeature(ch.cyberduck.core.sds.SDSAttributesFinderFeature) DisabledTransferErrorCallback(ch.cyberduck.core.transfer.DisabledTransferErrorCallback) Path(ch.cyberduck.core.Path) DisabledProgressListener(ch.cyberduck.core.DisabledProgressListener) DisabledNotificationService(ch.cyberduck.core.notification.DisabledNotificationService) DefaultTemporaryFileService(ch.cyberduck.core.local.DefaultTemporaryFileService) DisabledStreamListener(ch.cyberduck.core.io.DisabledStreamListener) StatusOutputStream(ch.cyberduck.core.io.StatusOutputStream) Local(ch.cyberduck.core.Local) SDSMultipartWriteFeature(ch.cyberduck.core.sds.SDSMultipartWriteFeature) Host(ch.cyberduck.core.Host) SDSNodeIdProvider(ch.cyberduck.core.sds.SDSNodeIdProvider) DisabledTransferPrompt(ch.cyberduck.core.transfer.DisabledTransferPrompt) DefaultAttributesFinderFeature(ch.cyberduck.core.shared.DefaultAttributesFinderFeature) ByteArrayInputStream(java.io.ByteArrayInputStream) DisabledLoginCallback(ch.cyberduck.core.DisabledLoginCallback) UploadTransfer(ch.cyberduck.core.transfer.UploadTransfer) DownloadTransfer(ch.cyberduck.core.transfer.DownloadTransfer) Transfer(ch.cyberduck.core.transfer.Transfer) SDSDirectoryFeature(ch.cyberduck.core.sds.SDSDirectoryFeature) AlphanumericRandomStringService(ch.cyberduck.core.AlphanumericRandomStringService) TransferSpeedometer(ch.cyberduck.core.transfer.TransferSpeedometer) TransferItem(ch.cyberduck.core.transfer.TransferItem) SHA256ChecksumCompute(ch.cyberduck.core.io.SHA256ChecksumCompute) DisabledConnectionCallback(ch.cyberduck.core.DisabledConnectionCallback) StreamCopier(ch.cyberduck.core.io.StreamCopier) AbstractSDSTest(ch.cyberduck.core.sds.AbstractSDSTest) IntegrationTest(ch.cyberduck.test.IntegrationTest) Test(org.junit.Test)

Example 4 with SDSAttributesFinderFeature

use of ch.cyberduck.core.sds.SDSAttributesFinderFeature in project cyberduck by iterate-ch.

the class SDSSingleTransferWorkerTest method testTransferredSizeRepeat.

@Test
public void testTransferredSizeRepeat() throws Exception {
    final SDSNodeIdProvider fileid = new SDSNodeIdProvider(session);
    final Local local = new Local(System.getProperty("java.io.tmpdir"), UUID.randomUUID().toString());
    // chunk size 32768
    final byte[] content = new byte[98305];
    new Random().nextBytes(content);
    final OutputStream out = local.getOutputStream(false);
    IOUtils.write(content, out);
    out.close();
    final AtomicBoolean failed = new AtomicBoolean();
    final BytecountStreamListener counter = new BytecountStreamListener();
    final SDSSession conn = new SDSSession(session.getHost().withCredentials(new Credentials(System.getProperties().getProperty("sds.user"), System.getProperties().getProperty("sds.key"))), new DisabledX509TrustManager(), new DefaultX509KeyManager()) {

        @Override
        @SuppressWarnings("unchecked")
        public <T> T _getFeature(final Class<T> type) {
            if (type == Upload.class) {
                return (T) new DefaultUploadFeature(new SDSMultipartWriteFeature(this, fileid) {

                    @Override
                    public HttpResponseOutputStream<Node> write(final Path file, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException {
                        final HttpResponseOutputStream<Node> proxy = super.write(file, status, callback);
                        if (failed.get()) {
                            // Second attempt successful
                            return proxy;
                        }
                        return new HttpResponseOutputStream<Node>(new CountingOutputStream(proxy) {

                            @Override
                            protected void afterWrite(final int n) throws IOException {
                                super.afterWrite(n);
                                if (this.getByteCount() >= 42768L) {
                                    // Buffer size
                                    assertEquals(32768L, counter.getSent());
                                    failed.set(true);
                                    throw new SocketTimeoutException();
                                }
                            }
                        }, new SDSAttributesAdapter(session), status) {

                            @Override
                            public Node getStatus() throws BackgroundException {
                                return proxy.getStatus();
                            }
                        };
                    }
                });
            }
            return super._getFeature(type);
        }
    };
    conn.open(Proxy.DIRECT, new DisabledHostKeyCallback(), new DisabledLoginCallback(), new DisabledCancelCallback());
    conn.login(Proxy.DIRECT, new DisabledLoginCallback(), new DisabledCancelCallback());
    final Path room = new SDSDirectoryFeature(conn, fileid).mkdir(new Path(new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory, Path.Type.volume)), new TransferStatus());
    final Path test = new Path(room, UUID.randomUUID().toString(), EnumSet.of(Path.Type.file));
    final Transfer t = new UploadTransfer(session.getHost(), test, local);
    assertTrue(new SingleTransferWorker(conn, conn, t, new TransferOptions(), new TransferSpeedometer(t), new DisabledTransferPrompt() {

        @Override
        public TransferAction prompt(final TransferItem file) {
            return TransferAction.overwrite;
        }
    }, new DisabledTransferErrorCallback(), new DisabledProgressListener(), counter, new DisabledLoginCallback(), new DisabledNotificationService()) {
    }.run(session));
    local.delete();
    assertTrue(t.isComplete());
    assertEquals(content.length, new SDSAttributesFinderFeature(conn, fileid).find(test).getSize());
    assertEquals(content.length, counter.getRecv(), 0L);
    assertEquals(content.length, counter.getSent(), 0L);
    assertTrue(failed.get());
    new SDSDeleteFeature(conn, fileid).delete(Arrays.asList(test, room), new DisabledLoginCallback(), new Delete.DisabledCallback());
}
Also used : Delete(ch.cyberduck.core.features.Delete) SDSDeleteFeature(ch.cyberduck.core.sds.SDSDeleteFeature) DisabledX509TrustManager(ch.cyberduck.core.ssl.DisabledX509TrustManager) TransferAction(ch.cyberduck.core.transfer.TransferAction) HttpResponseOutputStream(ch.cyberduck.core.http.HttpResponseOutputStream) OutputStream(java.io.OutputStream) CountingOutputStream(org.apache.commons.io.output.CountingOutputStream) StatusOutputStream(ch.cyberduck.core.io.StatusOutputStream) Node(ch.cyberduck.core.sds.io.swagger.client.model.Node) CountingOutputStream(org.apache.commons.io.output.CountingOutputStream) TransferOptions(ch.cyberduck.core.transfer.TransferOptions) SDSSession(ch.cyberduck.core.sds.SDSSession) Random(java.util.Random) TransferStatus(ch.cyberduck.core.transfer.TransferStatus) SDSAttributesFinderFeature(ch.cyberduck.core.sds.SDSAttributesFinderFeature) DisabledTransferErrorCallback(ch.cyberduck.core.transfer.DisabledTransferErrorCallback) Path(ch.cyberduck.core.Path) DisabledProgressListener(ch.cyberduck.core.DisabledProgressListener) DisabledNotificationService(ch.cyberduck.core.notification.DisabledNotificationService) Local(ch.cyberduck.core.Local) SDSMultipartWriteFeature(ch.cyberduck.core.sds.SDSMultipartWriteFeature) IOException(java.io.IOException) DefaultUploadFeature(ch.cyberduck.core.shared.DefaultUploadFeature) BytecountStreamListener(ch.cyberduck.core.BytecountStreamListener) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) SDSNodeIdProvider(ch.cyberduck.core.sds.SDSNodeIdProvider) DisabledTransferPrompt(ch.cyberduck.core.transfer.DisabledTransferPrompt) SocketTimeoutException(java.net.SocketTimeoutException) DisabledCancelCallback(ch.cyberduck.core.DisabledCancelCallback) DisabledHostKeyCallback(ch.cyberduck.core.DisabledHostKeyCallback) DisabledLoginCallback(ch.cyberduck.core.DisabledLoginCallback) UploadTransfer(ch.cyberduck.core.transfer.UploadTransfer) DownloadTransfer(ch.cyberduck.core.transfer.DownloadTransfer) Transfer(ch.cyberduck.core.transfer.Transfer) UploadTransfer(ch.cyberduck.core.transfer.UploadTransfer) SDSDirectoryFeature(ch.cyberduck.core.sds.SDSDirectoryFeature) AlphanumericRandomStringService(ch.cyberduck.core.AlphanumericRandomStringService) DisabledConnectionCallback(ch.cyberduck.core.DisabledConnectionCallback) ConnectionCallback(ch.cyberduck.core.ConnectionCallback) TransferSpeedometer(ch.cyberduck.core.transfer.TransferSpeedometer) HttpResponseOutputStream(ch.cyberduck.core.http.HttpResponseOutputStream) DefaultX509KeyManager(ch.cyberduck.core.ssl.DefaultX509KeyManager) TransferItem(ch.cyberduck.core.transfer.TransferItem) Credentials(ch.cyberduck.core.Credentials) SDSAttributesAdapter(ch.cyberduck.core.sds.SDSAttributesAdapter) AbstractSDSTest(ch.cyberduck.core.sds.AbstractSDSTest) IntegrationTest(ch.cyberduck.test.IntegrationTest) Test(org.junit.Test)

Example 5 with SDSAttributesFinderFeature

use of ch.cyberduck.core.sds.SDSAttributesFinderFeature in project cyberduck by iterate-ch.

the class SDSSingleTransferWorkerTest method testTransferredSizeRepeatFailureOnClose.

@Test
public void testTransferredSizeRepeatFailureOnClose() throws Exception {
    final SDSNodeIdProvider fileid = new SDSNodeIdProvider(session);
    final Local local = new Local(System.getProperty("java.io.tmpdir"), UUID.randomUUID().toString());
    // chunk size 32768
    final byte[] content = new byte[98305];
    new Random().nextBytes(content);
    final OutputStream out = local.getOutputStream(false);
    IOUtils.write(content, out);
    out.close();
    final AtomicBoolean failed = new AtomicBoolean();
    final SDSSession conn = new SDSSession(session.getHost().withCredentials(new Credentials(System.getProperties().getProperty("sds.user"), System.getProperties().getProperty("sds.key"))), new DisabledX509TrustManager(), new DefaultX509KeyManager()) {

        @Override
        @SuppressWarnings("unchecked")
        public <T> T _getFeature(final Class<T> type) {
            if (type == Upload.class) {
                return (T) new DefaultUploadFeature<>(new SDSMultipartWriteFeature(this, fileid) {

                    @Override
                    public HttpResponseOutputStream<Node> write(final Path file, final TransferStatus status, final ConnectionCallback callback) throws BackgroundException {
                        final HttpResponseOutputStream<Node> proxy = super.write(file, status, callback);
                        if (failed.get()) {
                            // Second attempt successful
                            return proxy;
                        }
                        return new HttpResponseOutputStream<Node>(new CountingOutputStream(proxy) {

                            @Override
                            public void close() throws IOException {
                                if (!failed.get()) {
                                    failed.set(true);
                                    throw new SocketTimeoutException();
                                }
                                super.close();
                            }
                        }, new SDSAttributesAdapter(session), status) {

                            @Override
                            public Node getStatus() throws BackgroundException {
                                return proxy.getStatus();
                            }
                        };
                    }
                });
            }
            return super._getFeature(type);
        }
    };
    conn.open(Proxy.DIRECT, new DisabledHostKeyCallback(), new DisabledLoginCallback(), new DisabledCancelCallback());
    conn.login(Proxy.DIRECT, new DisabledLoginCallback(), new DisabledCancelCallback());
    final Path room = new SDSDirectoryFeature(conn, fileid).mkdir(new Path(new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory, Path.Type.volume)), new TransferStatus());
    final Path test = new Path(room, UUID.randomUUID().toString(), EnumSet.of(Path.Type.file));
    final Transfer t = new UploadTransfer(session.getHost(), test, local);
    final BytecountStreamListener counter = new BytecountStreamListener();
    assertTrue(new SingleTransferWorker(conn, conn, t, new TransferOptions(), new TransferSpeedometer(t), new DisabledTransferPrompt() {

        @Override
        public TransferAction prompt(final TransferItem file) {
            return TransferAction.overwrite;
        }
    }, new DisabledTransferErrorCallback(), new DisabledProgressListener(), counter, new DisabledLoginCallback(), new DisabledNotificationService()) {
    }.run(conn));
    local.delete();
    assertTrue(t.isComplete());
    assertEquals(98305L, counter.getSent(), 0L);
    assertTrue(failed.get());
    assertEquals(98305L, new SDSAttributesFinderFeature(conn, fileid).find(test).getSize());
    new SDSDeleteFeature(conn, fileid).delete(Arrays.asList(test, room), new DisabledLoginCallback(), new Delete.DisabledCallback());
}
Also used : Delete(ch.cyberduck.core.features.Delete) SDSDeleteFeature(ch.cyberduck.core.sds.SDSDeleteFeature) DisabledX509TrustManager(ch.cyberduck.core.ssl.DisabledX509TrustManager) TransferAction(ch.cyberduck.core.transfer.TransferAction) HttpResponseOutputStream(ch.cyberduck.core.http.HttpResponseOutputStream) OutputStream(java.io.OutputStream) CountingOutputStream(org.apache.commons.io.output.CountingOutputStream) StatusOutputStream(ch.cyberduck.core.io.StatusOutputStream) Node(ch.cyberduck.core.sds.io.swagger.client.model.Node) CountingOutputStream(org.apache.commons.io.output.CountingOutputStream) TransferOptions(ch.cyberduck.core.transfer.TransferOptions) SDSSession(ch.cyberduck.core.sds.SDSSession) Random(java.util.Random) TransferStatus(ch.cyberduck.core.transfer.TransferStatus) SDSAttributesFinderFeature(ch.cyberduck.core.sds.SDSAttributesFinderFeature) DisabledTransferErrorCallback(ch.cyberduck.core.transfer.DisabledTransferErrorCallback) Path(ch.cyberduck.core.Path) DisabledProgressListener(ch.cyberduck.core.DisabledProgressListener) DisabledNotificationService(ch.cyberduck.core.notification.DisabledNotificationService) Local(ch.cyberduck.core.Local) SDSMultipartWriteFeature(ch.cyberduck.core.sds.SDSMultipartWriteFeature) IOException(java.io.IOException) BytecountStreamListener(ch.cyberduck.core.BytecountStreamListener) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) SDSNodeIdProvider(ch.cyberduck.core.sds.SDSNodeIdProvider) DisabledTransferPrompt(ch.cyberduck.core.transfer.DisabledTransferPrompt) SocketTimeoutException(java.net.SocketTimeoutException) DisabledCancelCallback(ch.cyberduck.core.DisabledCancelCallback) DisabledHostKeyCallback(ch.cyberduck.core.DisabledHostKeyCallback) DisabledLoginCallback(ch.cyberduck.core.DisabledLoginCallback) UploadTransfer(ch.cyberduck.core.transfer.UploadTransfer) DownloadTransfer(ch.cyberduck.core.transfer.DownloadTransfer) Transfer(ch.cyberduck.core.transfer.Transfer) UploadTransfer(ch.cyberduck.core.transfer.UploadTransfer) SDSDirectoryFeature(ch.cyberduck.core.sds.SDSDirectoryFeature) AlphanumericRandomStringService(ch.cyberduck.core.AlphanumericRandomStringService) DisabledConnectionCallback(ch.cyberduck.core.DisabledConnectionCallback) ConnectionCallback(ch.cyberduck.core.ConnectionCallback) TransferSpeedometer(ch.cyberduck.core.transfer.TransferSpeedometer) HttpResponseOutputStream(ch.cyberduck.core.http.HttpResponseOutputStream) DefaultX509KeyManager(ch.cyberduck.core.ssl.DefaultX509KeyManager) TransferItem(ch.cyberduck.core.transfer.TransferItem) Credentials(ch.cyberduck.core.Credentials) SDSAttributesAdapter(ch.cyberduck.core.sds.SDSAttributesAdapter) AbstractSDSTest(ch.cyberduck.core.sds.AbstractSDSTest) IntegrationTest(ch.cyberduck.test.IntegrationTest) Test(org.junit.Test)

Aggregations

DisabledConnectionCallback (ch.cyberduck.core.DisabledConnectionCallback)6 DisabledLoginCallback (ch.cyberduck.core.DisabledLoginCallback)6 Path (ch.cyberduck.core.Path)6 Delete (ch.cyberduck.core.features.Delete)6 AbstractSDSTest (ch.cyberduck.core.sds.AbstractSDSTest)6 SDSAttributesFinderFeature (ch.cyberduck.core.sds.SDSAttributesFinderFeature)6 SDSDeleteFeature (ch.cyberduck.core.sds.SDSDeleteFeature)6 SDSMultipartWriteFeature (ch.cyberduck.core.sds.SDSMultipartWriteFeature)6 SDSNodeIdProvider (ch.cyberduck.core.sds.SDSNodeIdProvider)6 Node (ch.cyberduck.core.sds.io.swagger.client.model.Node)6 TransferItem (ch.cyberduck.core.transfer.TransferItem)6 TransferStatus (ch.cyberduck.core.transfer.TransferStatus)6 IntegrationTest (ch.cyberduck.test.IntegrationTest)6 Test (org.junit.Test)6 Credentials (ch.cyberduck.core.Credentials)5 AlphanumericRandomStringService (ch.cyberduck.core.AlphanumericRandomStringService)3 DisabledProgressListener (ch.cyberduck.core.DisabledProgressListener)3 Host (ch.cyberduck.core.Host)3 Local (ch.cyberduck.core.Local)3 StatusOutputStream (ch.cyberduck.core.io.StatusOutputStream)3