public function validateExtension() {
        // if the allowed extension value is null, all file extensions are allowed
        if (is_null($this->allowedExtensions())) {
            return true;
        }
        
        // if the allowed extensions list is not an array or if the downloaded file
        // extension is not in the list of allowed extensions, throw an exception
        if (!is_array($this->allowedExtensions()) || !in_array($this->extension(), $this->allowedExtensions())) {
            throw new \Th\FileDownloader\Exceptions\DownloadException(\Th\FileDownloader::FILE_WRONG_EXTENSION);
        }
        
        // everything ok
        return true;
    }