Here you can find the source of write(String location, String content)
public static File write(String location, String content) throws IOException
//package com.java2s; //License from project: Apache License import com.google.common.io.Files; import java.io.File; import java.io.IOException; import java.nio.charset.Charset; public class Main { public static File write(String location, String content) throws IOException { File file = new File(location); file.getParentFile().mkdirs();/*from w w w . j a va 2 s .com*/ Files.write(content, file, Charset.defaultCharset()); return file; } }