Search in sources :

Example 66 with AsciiRandomStringService

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

the class B2ObjectListServiceTest method testDisplayFolderInBucketMissingPlaceholder.

@Test
public void testDisplayFolderInBucketMissingPlaceholder() throws Exception {
    final Path bucket = new Path(String.format("test-%s", new AsciiRandomStringService().random()), EnumSet.of(Path.Type.directory, Path.Type.volume));
    final B2VersionIdProvider fileid = new B2VersionIdProvider(session);
    new B2DirectoryFeature(session, fileid).mkdir(bucket, new TransferStatus());
    final Path folder1 = new Path(bucket, "1-d", EnumSet.of(Path.Type.directory));
    final Path file1 = new Path(folder1, "2-f", EnumSet.of(Path.Type.file));
    new B2TouchFeature(session, fileid).touch(file1, new TransferStatus());
    final AttributedList<Path> list = new B2ObjectListService(session, fileid).list(bucket, new DisabledListProgressListener());
    assertEquals(1, list.size());
    assertEquals(folder1, list.iterator().next());
    new B2DeleteFeature(session, fileid).delete(Arrays.asList(bucket, file1), new DisabledLoginCallback(), new Delete.DisabledCallback());
}
Also used : Path(ch.cyberduck.core.Path) Delete(ch.cyberduck.core.features.Delete) AsciiRandomStringService(ch.cyberduck.core.AsciiRandomStringService) DisabledListProgressListener(ch.cyberduck.core.DisabledListProgressListener) DisabledLoginCallback(ch.cyberduck.core.DisabledLoginCallback) TransferStatus(ch.cyberduck.core.transfer.TransferStatus) Test(org.junit.Test) IntegrationTest(ch.cyberduck.test.IntegrationTest)

Aggregations

AsciiRandomStringService (ch.cyberduck.core.AsciiRandomStringService)66 Path (ch.cyberduck.core.Path)64 Test (org.junit.Test)64 TransferStatus (ch.cyberduck.core.transfer.TransferStatus)61 IntegrationTest (ch.cyberduck.test.IntegrationTest)56 Delete (ch.cyberduck.core.features.Delete)52 DisabledLoginCallback (ch.cyberduck.core.DisabledLoginCallback)51 DisabledConnectionCallback (ch.cyberduck.core.DisabledConnectionCallback)22 DisabledListProgressListener (ch.cyberduck.core.DisabledListProgressListener)18 AlphanumericRandomStringService (ch.cyberduck.core.AlphanumericRandomStringService)12 Host (ch.cyberduck.core.Host)8 ByteArrayInputStream (java.io.ByteArrayInputStream)8 StreamCopier (ch.cyberduck.core.io.StreamCopier)7 DisabledProgressListener (ch.cyberduck.core.DisabledProgressListener)6 NullLocal (ch.cyberduck.core.NullLocal)5 NullTransferSession (ch.cyberduck.core.NullTransferSession)5 SimplePathPredicate (ch.cyberduck.core.SimplePathPredicate)5 TestProtocol (ch.cyberduck.core.TestProtocol)5 DisabledStreamListener (ch.cyberduck.core.io.DisabledStreamListener)5 DefaultHomeFinderService (ch.cyberduck.core.shared.DefaultHomeFinderService)5