Search in sources :

Example 1 with CryptoVersionIdProvider

use of ch.cyberduck.core.cryptomator.features.CryptoVersionIdProvider in project cyberduck by iterate-ch.

the class B2ListServiceTest method testListCryptomator.

@Test
public void testListCryptomator() throws Exception {
    final Path home = new Path("test-cyberduck", EnumSet.of(Path.Type.volume, Path.Type.directory));
    final CryptoVault cryptomator = new CryptoVault(new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)));
    final Path vault = cryptomator.create(session, new VaultCredentials("test"), new DisabledPasswordStore(), vaultVersion);
    session.withRegistry(new DefaultVaultRegistry(new DisabledPasswordStore(), new DisabledPasswordCallback(), cryptomator));
    final B2VersionIdProvider fileid = new B2VersionIdProvider(session);
    assertTrue(new CryptoListService(session, new B2ListService(session, fileid), cryptomator).list(vault, new DisabledListProgressListener()).isEmpty());
    final Path test = new CryptoTouchFeature<BaseB2Response>(session, new DefaultTouchFeature<BaseB2Response>(new B2WriteFeature(session, fileid)), new B2WriteFeature(session, fileid), cryptomator).touch(new Path(vault, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus());
    test.attributes().setVersionId(new CryptoVersionIdProvider(session, fileid, cryptomator).getVersionId(test, new DisabledListProgressListener()));
    assertEquals(test, new CryptoListService(session, new B2ListService(session, fileid), cryptomator).list(vault, new DisabledListProgressListener()).get(0));
    cryptomator.getFeature(session, Delete.class, new B2DeleteFeature(session, fileid)).delete(Arrays.asList(test, vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
}
Also used : Path(ch.cyberduck.core.Path) Delete(ch.cyberduck.core.features.Delete) CryptoListService(ch.cyberduck.core.cryptomator.features.CryptoListService) VaultCredentials(ch.cyberduck.core.vault.VaultCredentials) DisabledListProgressListener(ch.cyberduck.core.DisabledListProgressListener) B2ListService(ch.cyberduck.core.b2.B2ListService) B2VersionIdProvider(ch.cyberduck.core.b2.B2VersionIdProvider) B2WriteFeature(ch.cyberduck.core.b2.B2WriteFeature) DefaultTouchFeature(ch.cyberduck.core.shared.DefaultTouchFeature) B2DeleteFeature(ch.cyberduck.core.b2.B2DeleteFeature) DefaultVaultRegistry(ch.cyberduck.core.vault.DefaultVaultRegistry) DisabledLoginCallback(ch.cyberduck.core.DisabledLoginCallback) TransferStatus(ch.cyberduck.core.transfer.TransferStatus) AlphanumericRandomStringService(ch.cyberduck.core.AlphanumericRandomStringService) BaseB2Response(synapticloop.b2.response.BaseB2Response) CryptoVersionIdProvider(ch.cyberduck.core.cryptomator.features.CryptoVersionIdProvider) DisabledPasswordStore(ch.cyberduck.core.DisabledPasswordStore) DisabledPasswordCallback(ch.cyberduck.core.DisabledPasswordCallback) AbstractB2Test(ch.cyberduck.core.b2.AbstractB2Test) Test(org.junit.Test) IntegrationTest(ch.cyberduck.test.IntegrationTest)

Aggregations

AlphanumericRandomStringService (ch.cyberduck.core.AlphanumericRandomStringService)1 DisabledListProgressListener (ch.cyberduck.core.DisabledListProgressListener)1 DisabledLoginCallback (ch.cyberduck.core.DisabledLoginCallback)1 DisabledPasswordCallback (ch.cyberduck.core.DisabledPasswordCallback)1 DisabledPasswordStore (ch.cyberduck.core.DisabledPasswordStore)1 Path (ch.cyberduck.core.Path)1 AbstractB2Test (ch.cyberduck.core.b2.AbstractB2Test)1 B2DeleteFeature (ch.cyberduck.core.b2.B2DeleteFeature)1 B2ListService (ch.cyberduck.core.b2.B2ListService)1 B2VersionIdProvider (ch.cyberduck.core.b2.B2VersionIdProvider)1 B2WriteFeature (ch.cyberduck.core.b2.B2WriteFeature)1 CryptoListService (ch.cyberduck.core.cryptomator.features.CryptoListService)1 CryptoVersionIdProvider (ch.cyberduck.core.cryptomator.features.CryptoVersionIdProvider)1 Delete (ch.cyberduck.core.features.Delete)1 DefaultTouchFeature (ch.cyberduck.core.shared.DefaultTouchFeature)1 TransferStatus (ch.cyberduck.core.transfer.TransferStatus)1 DefaultVaultRegistry (ch.cyberduck.core.vault.DefaultVaultRegistry)1 VaultCredentials (ch.cyberduck.core.vault.VaultCredentials)1 IntegrationTest (ch.cyberduck.test.IntegrationTest)1 Test (org.junit.Test)1