Search in sources :

Example 26 with DisabledPasswordCallback

use of ch.cyberduck.core.DisabledPasswordCallback in project cyberduck by iterate-ch.

the class GoogleStorageFindFeatureTest method testDeleted.

@Test
public void testDeleted() throws Exception {
    final Path container = new Path("cyberduck-test-eu", EnumSet.of(Path.Type.directory, Path.Type.volume));
    final Path test = new GoogleStorageTouchFeature(session).touch(new Path(container, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file)), new TransferStatus());
    assertNotNull(test.attributes().getVersionId());
    assertTrue(new GoogleStorageFindFeature(session).find(test));
    new GoogleStorageDeleteFeature(session).delete(Collections.singletonList(test), new DisabledPasswordCallback(), new Delete.DisabledCallback());
    assertFalse(new GoogleStorageFindFeature(session).find(test));
}
Also used : Path(ch.cyberduck.core.Path) Delete(ch.cyberduck.core.features.Delete) TransferStatus(ch.cyberduck.core.transfer.TransferStatus) AlphanumericRandomStringService(ch.cyberduck.core.AlphanumericRandomStringService) DisabledPasswordCallback(ch.cyberduck.core.DisabledPasswordCallback) Test(org.junit.Test) IntegrationTest(ch.cyberduck.test.IntegrationTest)

Example 27 with DisabledPasswordCallback

use of ch.cyberduck.core.DisabledPasswordCallback in project cyberduck by iterate-ch.

the class SwiftMoveFeatureTest method testMove.

@Test
public void testMove() throws Exception {
    final Path home = new Path("/test.cyberduck.ch", EnumSet.of(Path.Type.volume, Path.Type.directory));
    final Path vault = new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory));
    final Path folder = new Path(vault, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory));
    final Path file = new Path(folder, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.file));
    final CryptoVault cryptomator = new CryptoVault(vault);
    cryptomator.create(session, new VaultCredentials("test"), new DisabledPasswordStore(), vaultVersion);
    final SwiftRegionService regionService = new SwiftRegionService(session);
    session.withRegistry(new DefaultVaultRegistry(new DisabledPasswordStore(), new DisabledPasswordCallback(), cryptomator));
    cryptomator.getFeature(session, Directory.class, new SwiftDirectoryFeature(session, regionService)).mkdir(folder, new TransferStatus());
    new CryptoTouchFeature<StorageObject>(session, new SwiftTouchFeature(session, regionService), new SwiftWriteFeature(session, regionService), cryptomator).touch(file, new TransferStatus());
    assertTrue(new CryptoFindFeature(session, new DefaultFindFeature(session), cryptomator).find(file));
    final Move move = cryptomator.getFeature(session, Move.class, new SwiftMoveFeature(session, regionService));
    // rename file
    final Path fileRenamed = new Path(folder, "f1", EnumSet.of(Path.Type.file));
    move.move(file, fileRenamed, new TransferStatus(), new Delete.DisabledCallback(), new DisabledConnectionCallback());
    assertFalse(new CryptoFindFeature(session, new SwiftFindFeature(session), cryptomator).find(file));
    assertTrue(new CryptoFindFeature(session, new SwiftFindFeature(session), cryptomator).find(fileRenamed));
    // rename folder
    final Path folderRenamed = new Path(vault, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory));
    move.move(folder, folderRenamed, new TransferStatus(), new Delete.DisabledCallback(), new DisabledConnectionCallback());
    assertFalse(new CryptoFindFeature(session, new SwiftFindFeature(session), cryptomator).find(folder));
    assertTrue(new CryptoFindFeature(session, new SwiftFindFeature(session), cryptomator).find(folderRenamed));
    final Path fileRenamedInRenamedFolder = new Path(folderRenamed, "f1", EnumSet.of(Path.Type.file));
    assertTrue(new CryptoFindFeature(session, new SwiftFindFeature(session), cryptomator).find(fileRenamedInRenamedFolder));
    cryptomator.getFeature(session, Delete.class, new SwiftDeleteFeature(session)).delete(Arrays.asList(fileRenamedInRenamedFolder, folderRenamed, vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
    session.close();
}
Also used : Delete(ch.cyberduck.core.features.Delete) SwiftWriteFeature(ch.cyberduck.core.openstack.SwiftWriteFeature) DefaultVaultRegistry(ch.cyberduck.core.vault.DefaultVaultRegistry) DefaultFindFeature(ch.cyberduck.core.shared.DefaultFindFeature) Move(ch.cyberduck.core.features.Move) SwiftDeleteFeature(ch.cyberduck.core.openstack.SwiftDeleteFeature) TransferStatus(ch.cyberduck.core.transfer.TransferStatus) Directory(ch.cyberduck.core.features.Directory) SwiftFindFeature(ch.cyberduck.core.openstack.SwiftFindFeature) Path(ch.cyberduck.core.Path) SwiftMoveFeature(ch.cyberduck.core.openstack.SwiftMoveFeature) VaultCredentials(ch.cyberduck.core.vault.VaultCredentials) StorageObject(ch.iterate.openstack.swift.model.StorageObject) SwiftTouchFeature(ch.cyberduck.core.openstack.SwiftTouchFeature) CryptoFindFeature(ch.cyberduck.core.cryptomator.features.CryptoFindFeature) SwiftDirectoryFeature(ch.cyberduck.core.openstack.SwiftDirectoryFeature) SwiftRegionService(ch.cyberduck.core.openstack.SwiftRegionService) DisabledLoginCallback(ch.cyberduck.core.DisabledLoginCallback) AlphanumericRandomStringService(ch.cyberduck.core.AlphanumericRandomStringService) DisabledPasswordStore(ch.cyberduck.core.DisabledPasswordStore) DisabledPasswordCallback(ch.cyberduck.core.DisabledPasswordCallback) DisabledConnectionCallback(ch.cyberduck.core.DisabledConnectionCallback) AbstractSwiftTest(ch.cyberduck.core.openstack.AbstractSwiftTest) Test(org.junit.Test) IntegrationTest(ch.cyberduck.test.IntegrationTest)

Example 28 with DisabledPasswordCallback

use of ch.cyberduck.core.DisabledPasswordCallback in project cyberduck by iterate-ch.

the class SwiftTouchFeatureTest method testTouchLongFilenameEncryptedDefaultFeature.

@Test
public void testTouchLongFilenameEncryptedDefaultFeature() throws Exception {
    assumeTrue(vaultVersion == CryptoVault.VAULT_VERSION_DEPRECATED);
    final Path home = new Path("/test.cyberduck.ch", EnumSet.of(Path.Type.volume, Path.Type.directory));
    final Path vault = new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory));
    final Path test = new Path(vault, new AlphanumericRandomStringService(130).random(), EnumSet.of(Path.Type.file));
    final CryptoVault cryptomator = new CryptoVault(vault);
    cryptomator.create(session, new VaultCredentials("test"), new DisabledPasswordStore(), vaultVersion);
    session.withRegistry(new DefaultVaultRegistry(new DisabledPasswordStore(), new DisabledPasswordCallback(), cryptomator));
    final SwiftRegionService regionService = new SwiftRegionService(session);
    final Path touch = new CryptoTouchFeature<>(session, new DefaultTouchFeature<>(new SwiftWriteFeature(session, regionService)), new SwiftWriteFeature(session, regionService), cryptomator).touch(test, new TransferStatus());
    assertTrue(new CryptoFindFeature(session, new DefaultFindFeature(session), cryptomator).find(test));
    cryptomator.getFeature(session, Delete.class, new SwiftDeleteFeature(session)).delete(Arrays.asList(test, vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
    session.close();
}
Also used : Path(ch.cyberduck.core.Path) Delete(ch.cyberduck.core.features.Delete) VaultCredentials(ch.cyberduck.core.vault.VaultCredentials) SwiftWriteFeature(ch.cyberduck.core.openstack.SwiftWriteFeature) CryptoFindFeature(ch.cyberduck.core.cryptomator.features.CryptoFindFeature) SwiftRegionService(ch.cyberduck.core.openstack.SwiftRegionService) DefaultTouchFeature(ch.cyberduck.core.shared.DefaultTouchFeature) DefaultVaultRegistry(ch.cyberduck.core.vault.DefaultVaultRegistry) DefaultFindFeature(ch.cyberduck.core.shared.DefaultFindFeature) SwiftDeleteFeature(ch.cyberduck.core.openstack.SwiftDeleteFeature) DisabledLoginCallback(ch.cyberduck.core.DisabledLoginCallback) TransferStatus(ch.cyberduck.core.transfer.TransferStatus) AlphanumericRandomStringService(ch.cyberduck.core.AlphanumericRandomStringService) DisabledPasswordStore(ch.cyberduck.core.DisabledPasswordStore) DisabledPasswordCallback(ch.cyberduck.core.DisabledPasswordCallback) AbstractSwiftTest(ch.cyberduck.core.openstack.AbstractSwiftTest) Test(org.junit.Test) IntegrationTest(ch.cyberduck.test.IntegrationTest)

Example 29 with DisabledPasswordCallback

use of ch.cyberduck.core.DisabledPasswordCallback in project cyberduck by iterate-ch.

the class SwiftDirectoryFeatureTest method testMakeDirectoryEncrypted.

@Test
public void testMakeDirectoryEncrypted() throws Exception {
    final Path home = new Path("/test.cyberduck.ch", EnumSet.of(Path.Type.volume, Path.Type.directory));
    final Path vault = new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory));
    final Path test = new Path(vault, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory));
    final CryptoVault cryptomator = new CryptoVault(vault);
    cryptomator.create(session, new VaultCredentials("test"), new DisabledPasswordStore(), vaultVersion);
    session.withRegistry(new DefaultVaultRegistry(new DisabledPasswordStore(), new DisabledPasswordCallback(), cryptomator));
    cryptomator.getFeature(session, Directory.class, new SwiftDirectoryFeature(session)).mkdir(test, new TransferStatus());
    assertTrue(new CryptoFindFeature(session, new DefaultFindFeature(session), cryptomator).find(test));
    cryptomator.getFeature(session, Delete.class, new SwiftDeleteFeature(session)).delete(Arrays.asList(test, vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
    session.close();
}
Also used : Path(ch.cyberduck.core.Path) Delete(ch.cyberduck.core.features.Delete) VaultCredentials(ch.cyberduck.core.vault.VaultCredentials) CryptoFindFeature(ch.cyberduck.core.cryptomator.features.CryptoFindFeature) SwiftDirectoryFeature(ch.cyberduck.core.openstack.SwiftDirectoryFeature) DefaultVaultRegistry(ch.cyberduck.core.vault.DefaultVaultRegistry) DefaultFindFeature(ch.cyberduck.core.shared.DefaultFindFeature) SwiftDeleteFeature(ch.cyberduck.core.openstack.SwiftDeleteFeature) DisabledLoginCallback(ch.cyberduck.core.DisabledLoginCallback) TransferStatus(ch.cyberduck.core.transfer.TransferStatus) AlphanumericRandomStringService(ch.cyberduck.core.AlphanumericRandomStringService) DisabledPasswordStore(ch.cyberduck.core.DisabledPasswordStore) DisabledPasswordCallback(ch.cyberduck.core.DisabledPasswordCallback) Directory(ch.cyberduck.core.features.Directory) AbstractSwiftTest(ch.cyberduck.core.openstack.AbstractSwiftTest) Test(org.junit.Test) IntegrationTest(ch.cyberduck.test.IntegrationTest)

Example 30 with DisabledPasswordCallback

use of ch.cyberduck.core.DisabledPasswordCallback in project cyberduck by iterate-ch.

the class SwiftDirectoryFeatureTest method testMakeDirectoryLongFilenameEncrypted.

@Test
public void testMakeDirectoryLongFilenameEncrypted() throws Exception {
    assumeTrue(vaultVersion == CryptoVault.VAULT_VERSION_DEPRECATED);
    final Path home = new Path("/test.cyberduck.ch", EnumSet.of(Path.Type.volume, Path.Type.directory));
    final Path vault = new Path(home, new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory));
    final Path test = new Path(vault, new AlphanumericRandomStringService(130).random(), EnumSet.of(Path.Type.directory));
    final CryptoVault cryptomator = new CryptoVault(vault);
    cryptomator.create(session, new VaultCredentials("test"), new DisabledPasswordStore(), vaultVersion);
    session.withRegistry(new DefaultVaultRegistry(new DisabledPasswordStore(), new DisabledPasswordCallback(), cryptomator));
    cryptomator.getFeature(session, Directory.class, new SwiftDirectoryFeature(session)).mkdir(test, new TransferStatus());
    assertTrue(new CryptoFindFeature(session, new DefaultFindFeature(session), cryptomator).find(test));
    cryptomator.getFeature(session, Delete.class, new SwiftDeleteFeature(session)).delete(Arrays.asList(test, vault), new DisabledLoginCallback(), new Delete.DisabledCallback());
    session.close();
}
Also used : Path(ch.cyberduck.core.Path) Delete(ch.cyberduck.core.features.Delete) VaultCredentials(ch.cyberduck.core.vault.VaultCredentials) CryptoFindFeature(ch.cyberduck.core.cryptomator.features.CryptoFindFeature) SwiftDirectoryFeature(ch.cyberduck.core.openstack.SwiftDirectoryFeature) DefaultVaultRegistry(ch.cyberduck.core.vault.DefaultVaultRegistry) DefaultFindFeature(ch.cyberduck.core.shared.DefaultFindFeature) SwiftDeleteFeature(ch.cyberduck.core.openstack.SwiftDeleteFeature) DisabledLoginCallback(ch.cyberduck.core.DisabledLoginCallback) TransferStatus(ch.cyberduck.core.transfer.TransferStatus) AlphanumericRandomStringService(ch.cyberduck.core.AlphanumericRandomStringService) DisabledPasswordStore(ch.cyberduck.core.DisabledPasswordStore) DisabledPasswordCallback(ch.cyberduck.core.DisabledPasswordCallback) Directory(ch.cyberduck.core.features.Directory) AbstractSwiftTest(ch.cyberduck.core.openstack.AbstractSwiftTest) Test(org.junit.Test) IntegrationTest(ch.cyberduck.test.IntegrationTest)

Aggregations

DisabledPasswordCallback (ch.cyberduck.core.DisabledPasswordCallback)250 Test (org.junit.Test)250 Path (ch.cyberduck.core.Path)236 TransferStatus (ch.cyberduck.core.transfer.TransferStatus)232 IntegrationTest (ch.cyberduck.test.IntegrationTest)223 Delete (ch.cyberduck.core.features.Delete)213 AlphanumericRandomStringService (ch.cyberduck.core.AlphanumericRandomStringService)203 DisabledLoginCallback (ch.cyberduck.core.DisabledLoginCallback)173 DefaultVaultRegistry (ch.cyberduck.core.vault.DefaultVaultRegistry)157 VaultCredentials (ch.cyberduck.core.vault.VaultCredentials)156 DisabledPasswordStore (ch.cyberduck.core.DisabledPasswordStore)152 CryptoFindFeature (ch.cyberduck.core.cryptomator.features.CryptoFindFeature)121 DisabledConnectionCallback (ch.cyberduck.core.DisabledConnectionCallback)84 DefaultFindFeature (ch.cyberduck.core.shared.DefaultFindFeature)76 CryptoAttributesFeature (ch.cyberduck.core.cryptomator.features.CryptoAttributesFeature)60 StreamCopier (ch.cyberduck.core.io.StreamCopier)60 InputStream (java.io.InputStream)54 DisabledListProgressListener (ch.cyberduck.core.DisabledListProgressListener)53 Directory (ch.cyberduck.core.features.Directory)52 Host (ch.cyberduck.core.Host)49