@Override
    public Path mkdir(final Path folder, final TransferStatus status) throws BackgroundException {
        try {
            final CreateFolderResult result = new DbxUserFilesRequests(session.getClient(folder.getParent()))
                .createFolderV2(containerService.getKey(folder), false);
            return folder.withAttributes(new DropboxAttributesFinderFeature(session).toAttributes(result.getMetadata()));
        }
        catch(DbxException e) {
            throw new DropboxExceptionMappingService().map("Cannot create folder {0}", e, folder);
        }
    }
@Test
    public void testDirectory() throws Exception {
        final Path home = new DefaultHomeFinderService(session).find();
        final Path level1 = new DropboxDirectoryFeature(session).mkdir(new Path(home,
                new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)), null);
        assertTrue(new DefaultFindFeature(session).find(level1));
        assertTrue(new DropboxFindFeature(session).find(level1));
        assertThrows(ConflictException.class, () -> new DropboxDirectoryFeature(session).mkdir(level1, new TransferStatus()));
        final Path level2 = new DropboxDirectoryFeature(session).mkdir(new Path(level1,
                new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)), null);
        assertTrue(new DefaultFindFeature(session).find(level2));
        assertTrue(new DropboxFindFeature(session).find(level2));
        new DropboxDeleteFeature(session).delete(Arrays.asList(level1), new DisabledLoginCallback(), new Delete.DisabledCallback());
    }