@Override
    public Path mkdir(final Path folder, final TransferStatus status) throws BackgroundException {
        try {
            final FilesApi files = new FilesApi(session.getClient());
            final CreateFolderRequest request = new CreateFolderRequest();
            request.setName(folder.getName());
            request.setParentID(fileid.getFileId(folder.getParent()));
            final File f = files.filesCreateFolder(request);
            fileid.cache(folder, f.getId());
            return folder.withAttributes(new StoregateAttributesFinderFeature(session, fileid).toAttributes(f));
        }
        catch(ApiException e) {
            throw new StoregateExceptionMappingService(fileid).map("Cannot create folder {0}", e, folder);
        }
    }
@Test
    public void testCreateDirectory() throws Exception {
        final StoregateIdProvider nodeid = new StoregateIdProvider(session);
        final Path folder = new StoregateDirectoryFeature(session, nodeid).mkdir(
                new Path(String.format("/My files/%s", new AlphanumericRandomStringService().random()), EnumSet.of(Path.Type.directory)), new TransferStatus());
        assertTrue(new StoregateFindFeature(session, nodeid).find(folder));
        // Can create again regardless if exists
        new StoregateDirectoryFeature(session, nodeid).mkdir(folder, new TransferStatus());
        new StoregateDeleteFeature(session, nodeid).delete(Collections.singletonList(folder), new DisabledLoginCallback(), new Delete.DisabledCallback());
        assertFalse(new DefaultFindFeature(session).find(folder));
    }