public function save($directory)
    {
        if (empty($this->contents)) {
            return false;
        }

        if ($this->exists($directory)) {
            return true;
        }

        $compressedPath = $directory . DIRECTORY_SEPARATOR . $this->getOutputFileName();
        $this->removeOldVersions($directory);
        file_put_contents($compressedPath, $this->contents);
        $extracted = $this->resolver->extract($compressedPath, $directory);

        if ($extracted) {
            chmod("$directory/{$this->getExtractedName()}", 0777);
        }

        return $extracted;
    }