public function checkContainerForWrite($container)
    {
        $container = static::addContainerToName($container, '');
        if (!is_dir($container)) {
            if (!mkdir($container, 0777, true)) {
                throw new InternalServerErrorException('Failed to create container.');
            }
        }
    }