@Override
    public Path mkdir(final Path folder, final TransferStatus status) throws BackgroundException {
        try {
            if(containerService.isContainer(folder)) {
                // Create container at top level
                session.getClient().createContainer(regionService.lookup(
                    new SwiftLocationFeature.SwiftRegion(status.getRegion())), folder.getName());
                return folder;
            }
            else {
                status.setMime(DIRECTORY_MIME_TYPE);
                status.setLength(0L);
                new DefaultStreamCloser().close(writer.write(folder, status, new DisabledConnectionCallback()));
                return folder.withAttributes(status.getResponse());
            }
        }
        catch(GenericException e) {
            throw new SwiftExceptionMappingService().map("Cannot create folder {0}", e, folder);
        }
        catch(IOException e) {
            throw new DefaultIOExceptionMappingService().map("Cannot create folder {0}", e, folder);
        }
    }
@Test
    public void testCreatePlaceholder() throws Exception {
        final AtomicBoolean put = new AtomicBoolean();
        final String parentname = new AlphanumericRandomStringService().random();
        final String name = new AlphanumericRandomStringService().random();
        session.withListener(new TranscriptListener() {
            @Override
            public void log(final Type request, final String message) {
                switch(request) {
                    case request:
                        if(("PUT /v1/MossoCloudFS_59113590-c679-46c3-bf62-9d7c3d5176ee/test.cyberduck.ch/" + parentname + "/" + name + " HTTP/1.1").equals(message)) {
                            put.set(true);
                        }
                }
            }
        });
        final Path container = new Path("/test.cyberduck.ch", EnumSet.of(Path.Type.volume, Path.Type.directory));
        container.attributes().setRegion("IAD");
        final SwiftDirectoryFeature feature = new SwiftDirectoryFeature(session, new SwiftRegionService(session), new SwiftWriteFeature(session, new SwiftRegionService(session)));
        final Path parent = feature.mkdir(new Path(container, parentname, EnumSet.of(Path.Type.directory)), new TransferStatus());
        final Path placeholder = feature.mkdir(new Path(parent, name, EnumSet.of(Path.Type.directory)), new TransferStatus());
        assertTrue(put.get());
        assertTrue(new SwiftFindFeature(session).find(placeholder));
        assertTrue(new DefaultFindFeature(session).find(placeholder));
        assertEquals(placeholder.attributes().getChecksum(), new SwiftAttributesFinderFeature(session).find(placeholder).getChecksum());
        assertTrue(new SwiftObjectListService(session, new SwiftRegionService(session)).list(placeholder, new DisabledListProgressListener()).isEmpty());
        assertEquals(1, new SwiftObjectListService(session, new SwiftRegionService(session)).list(parent, new DisabledListProgressListener()).size());
        new SwiftDeleteFeature(session).delete(Arrays.asList(placeholder, parent), new DisabledLoginCallback(), new Delete.DisabledCallback());
        assertFalse(new SwiftFindFeature(session).find(placeholder));
    }