@Override
    public Path mkdir(final Path folder, final TransferStatus status) throws BackgroundException {
        try {
            final FileAttributes attrs;
            if(Permission.EMPTY != status.getPermission()) {
                attrs = new FileAttributes.Builder().withPermissions(Integer.parseInt(status.getPermission().getMode(), 8)).build();
            }
            else {
                attrs = FileAttributes.EMPTY;
            }
            session.sftp().makeDir(folder.getAbsolute(), attrs);
        }
        catch(IOException e) {
            throw new SFTPExceptionMappingService().map("Cannot create folder {0}", e, folder);
        }
        return folder;
    }
@Test
    public void testMakeDirectory() throws Exception {
        final Path test = new Path(new SFTPHomeDirectoryService(session).find(), UUID.randomUUID().toString(), EnumSet.of(Path.Type.directory));
        new SFTPDirectoryFeature(session).mkdir(test, new TransferStatus());
        assertTrue(new SFTPFindFeature(session).find(test));
        assertThrows(ConflictException.class, () -> new SFTPDirectoryFeature(session).mkdir(test, new TransferStatus()));
        new SFTPDeleteFeature(session).delete(Collections.<Path>singletonList(test), new DisabledLoginCallback(), new Delete.DisabledCallback());
    }