Here you can find the source of getPrintWriter(File f)
public static PrintWriter getPrintWriter(File f)
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.FileOutputStream; import java.io.PrintWriter; public class Main { /** Get a PrintWriter for the specified file, throw RuntimeExcpetion * if any problems.//from w ww . j a va 2 s . c om */ public static PrintWriter getPrintWriter(File f) { try { return new PrintWriter(new FileOutputStream(f)); } catch (Exception ex) { throw new RuntimeException(ex); } } }