Here you can find the source of writeFile(File file, String content)
public static void writeFile(File file, String content)
//package com.java2s; /*/*from w ww .j a v a 2s . c om*/ * Copyright (c) 2013, FPX and/or its affiliates. All rights reserved. * Use, Copy is subject to authorized license. */ import java.io.*; public class Main { public static void writeFile(File file, String content) { FileWriter fw = null; try { fw = new FileWriter(file); fw.write(content); fw.close(); } catch (IOException e) { e.printStackTrace(); } finally { try { if (fw != null) { fw.close(); } } catch (IOException e) { } } } }