public function deleteFile()
    {
        if ($this->file) {
            if (file_exists($this->file)) {
                if (false === @unlink($this->file)) {
                    throw FileException::lastError();
                }
            }

            if (file_exists($this->file . '.pubkey')) {
                if (false === @unlink($this->file . '.pubkey')) {
                    throw FileException::lastError();
                }
            }

            $dir = dirname($this->file);

            if (file_exists($dir)) {
                if (false === @rmdir($dir)) {
                    throw FileException::lastError();
                }
            }

            $this->file = null;
        }
    }