protected function assertDirectory($filename)
    {
        $dirname = dirname($filename);
        if (!is_dir($dirname)) {
            if (is_file($dirname)) {
                throw new RawFileCacheException(sprintf('File with same name : %s', $dirname), RawFileCacheException::FILE_WITH_SAME_NAME);
            }
            @mkdir($dirname, $this->getOption('dir_mode', 0755), true);
            if (!is_dir($dirname)) {
                throw new RawFileCacheException(sprintf('Cannot create directory : %s', $dirname), RawFileCacheException::CANNOT_CREATE_DIRECTORY);
            }
        }
    }