Here you can find the source of getContent(Path path)
public static String getContent(Path path) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.IOException; import java.nio.file.Path; import java.util.stream.Collectors; public class Main { public static String getContent(Path path) throws IOException { String textReturned = null; textReturned = java.nio.file.Files.lines(path).collect(Collectors.joining()); return textReturned; }// w ww.ja v a 2 s. c om }