public function saveToFile($content, $additionalPath = '')
    {
        $path = $this->realPath($additionalPath);
        
        // If the path does not exists create the directory
        $this->createTargetDirectory($path);
        
        // If the file exists but isn't writeable we need to throw an exception
        if (file_exists($path) && !is_writable($path)) {
            throw new Exception('The file "' . $path . '" isn\'t writable!');
        }
        
        return file_put_contents($path, $content);
    }