protected function checkAndExtractModelFile()
    {
        if (!is_readable($file = $this->argument('modelfile'))) {
            throw new \InvalidArgumentException('Could not find the model.');
        } // if

        $archive = new \ZipArchive();

        if (!$archive->open(realpath($file))) {
            throw new \InvalidArgumentException('Could not open the model.');
        } // if

        $dir = sys_get_temp_dir() . DIRECTORY_SEPARATOR . uniqid() . DIRECTORY_SEPARATOR;

        if (!$archive->extractTo($dir)) {
            throw new \InvalidArgumentException('Could not extract the model.');
        } // if

        return $dir;
    }