@Test public void read() throws IOException { final String writeHello = "Hello Test!!"; Path parentdir = Files.createTempDirectory("DIR"); Path parentdirfile1 = createTempFile(parentdir, "FILE_1", ".tmp"); Files.write(parentdirfile1, writeHello.getBytes()); String readReturn = FileUtils.read(parentdirfile1); assertThat(readReturn.equals(writeHello), is(true)); }
public static String read(Path file) { return read(file, Charset.defaultCharset()); }
FileUtils { public static String read(Path file) { return read(file, Charset.defaultCharset()); } }
FileUtils { public static String read(Path file) { return read(file, Charset.defaultCharset()); } private  FileUtils(); }
FileUtils { public static String read(Path file) { return read(file, Charset.defaultCharset()); } private  FileUtils(); static void delete(Path path); static void delete(Path path, String glob); static void deleteDir(Path dir, DeleteVisitor visitor); static void copy(Path source, Path target); static void copy(Path source, Path target, String glob); static void copy(CopyVisitor visitor); static void copyFile(Path source, Path target); static Path createFile(Path dir, String name); static Path createDirectories(Path dir); static String read(Path file); static String read(Path file, Charset charset); static List<Path> ls(Path dir); static void move(Path from, Path to); static void createSymbolicLink(Path link, Path targetFile); }
FileUtils { public static String read(Path file) { return read(file, Charset.defaultCharset()); } private  FileUtils(); static void delete(Path path); static void delete(Path path, String glob); static void deleteDir(Path dir, DeleteVisitor visitor); static void copy(Path source, Path target); static void copy(Path source, Path target, String glob); static void copy(CopyVisitor visitor); static void copyFile(Path source, Path target); static Path createFile(Path dir, String name); static Path createDirectories(Path dir); static String read(Path file); static String read(Path file, Charset charset); static List<Path> ls(Path dir); static void move(Path from, Path to); static void createSymbolicLink(Path link, Path targetFile);  }