Q:

boolean always returning true

I am currently learning Java. I am making a program that fetches the html code of a given URL, which then saves the code as *.html. At the end of the code, I am trying to print a message as to whether the file has saved or not.
My problem is that the boolean that determines if the file has saved always returns true.
Here is my code:
public class URLClient {
protected URLConnection connection;

public static void main(String[] args){
    URLClient client = new URLClient();
    Scanner input = new Scanner(System.in);
    String urlInput;
    String fileName;

    System.out.print("Please enter the URL of the web page you would like to download: ");
    urlInput = input.next();

    System.out.println("Save file As: ");
    fileName = input.next();

    String webPage = client.getDocumentAt(urlInput);
    System.out.println(webPage);
    writeToFile(webPage, fileName);

}

public String getDocumentAt (String urlString){
    StringBuffer document = new StringBuffer();

    try{
        URL url = new URL(urlString);
        URLConnection conn = url.openConnection();
        BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));

        String line = null;
        while ((line = reader.readLine()) != null)
            document.append(line + "\n");
        reader.close();
    }catch (MalformedURLException e){
        System.out.println("Unable to connect to URL: " + urlString);
    }catch (IOException e){
        System.out.println("IOException when connectin to URL: " + urlString);
    }

    return document.toString();
}

public static void writeToFile(String content, String fileName){
    boolean saved = false;

    try{
        OutputStream outputStream = new FileOutputStream(new File(fileName));
        BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(outputStream));

        try{
            writer.write(content);
                   boolean saved = true;
        } finally {
            writer.close();
        }
    } catch (IOException e){
        System.out.println("Caught exception while processing file: " + e.getMessage());
    }

    if (saved)
        System.out.print("Successfully saved " + fileName + ".html");

}

}
The boolean is called "saved" and is in the writeToFile() method.
Any help would be much appreciated :)

A:

try {
    writer.write(content);
    saved = true; // no need to initialize again
} finally {
    writer.close();
}

