private function getPath($regionName = null) {
        $cachePath = $this->cachePath;

        if (!empty($regionName)) {
            $cachePath .= DIRECTORY_SEPARATOR . $regionName;
        }

        if (!is_dir($cachePath)) {
            if (!mkdir($cachePath, 0775, true)) {
                throw new \Exception('Unable to create cache directory "' . $cachePath . '".');
            }
        }
        elseif (!is_readable($cachePath) || !is_writable($cachePath)) {
            if (!chmod($this->getCachePath(), 0775)) {
                throw new \Exception('The path "' . $cachePath . '" must be readable and writeable.');
            }
        }

        return $cachePath;
    }