Java tutorial
//package com.java2s; import java.io.File; import java.io.FileNotFoundException; import java.util.*; public class Main { private static String readTemplate(String templatePath) { try { return new Scanner(new File(templatePath)).useDelimiter("\\Z").next(); } catch (FileNotFoundException e) { System.err.println("Template \"" + templatePath + "\" not found"); } return null; } }