@Override
    public Path mkdir(final Path folder, final TransferStatus status) throws BackgroundException {
        try {
            return folder.withAttributes(
                    new BrickAttributesFinderFeature(session).toAttributes(new FoldersApi(new BrickApiClient(session))
                            .postFoldersPath(StringUtils.removeStart(folder.getAbsolute(), String.valueOf(Path.DELIMITER)))));
        }
        catch(ApiException e) {
            throw new BrickExceptionMappingService().map("Cannot create folder {0}", e, folder);
        }
    }
@Test
    public void testMakeDirectory() throws Exception {
        final Path directory = new BrickDirectoryFeature(session).mkdir(
                new Path(new AlphanumericRandomStringService().random(), EnumSet.of(Path.Type.directory)), new TransferStatus());
        assertThrows(ConflictException.class, () -> new BrickDirectoryFeature(session).mkdir(directory, new TransferStatus()));
        new BrickDeleteFeature(session).delete(Collections.singletonList(directory), new DisabledLoginCallback(), new Delete.DisabledCallback());
    }