public function setLocation($locationPath)
    {
        $locationPath = realpath($locationPath);
        if (!$locationPath || !is_dir($locationPath)) {
            throw new \Exception("The directory '$locationPath' does not exist.");
        }

        $this->location = $locationPath . DIRECTORY_SEPARATOR;
    }