@Test public void testAsBufferedWriter() throws Exception { Path tempPath = FileUtil.createTempFile(); try (BufferedWriter bw = FileUtil.asBufferedWriter(tempPath.toString())) { assertThat(bw).isNotNull(); } try (BufferedWriter bw = FileUtil.asBufferedWriter(tempPath)) { assertThat(bw).isNotNull(); } }
public static BufferedWriter asBufferedWriter(String fileName) throws IOException { Validate.notBlank(fileName, "filename is blank"); return Files.newBufferedWriter(getPath(fileName), Charsets.UTF_8); }
FileUtil { public static BufferedWriter asBufferedWriter(String fileName) throws IOException { Validate.notBlank(fileName, "filename is blank"); return Files.newBufferedWriter(getPath(fileName), Charsets.UTF_8); } }
FileUtil { public static BufferedWriter asBufferedWriter(String fileName) throws IOException { Validate.notBlank(fileName, "filename is blank"); return Files.newBufferedWriter(getPath(fileName), Charsets.UTF_8); }  }
FileUtil { public static BufferedWriter asBufferedWriter(String fileName) throws IOException { Validate.notBlank(fileName, "filename is blank"); return Files.newBufferedWriter(getPath(fileName), Charsets.UTF_8); }  static byte[] toByteArray(final File file); static String toString(final File file); static List<String> toLines(final File file); static void write(final CharSequence data, final File file); static void append(final CharSequence data, final File file); static InputStream asInputStream(String fileName); static InputStream asInputStream(File file); static InputStream asInputStream(Path path); static OutputStream asOutputStream(String fileName); static OutputStream asOutputStream(File file); static OutputStream asOutputStream(Path path); static BufferedReader asBufferedReader(String fileName); static BufferedReader asBufferedReader(Path path); static BufferedWriter asBufferedWriter(String fileName); static BufferedWriter asBufferedWriter(Path path); static void copy(@NotNull File from, @NotNull File to); static void copy(@NotNull Path from, @NotNull Path to); static void copyFile(@NotNull File from, @NotNull File to); static void copyFile(@NotNull Path from, @NotNull Path to); static void copyDir(@NotNull File from, @NotNull File to); static void copyDir(@NotNull Path from, @NotNull Path to); static void moveFile(@NotNull File from, @NotNull File to); static void moveFile(@NotNull Path from, @NotNull Path to); static void moveDir(@NotNull File from, @NotNull File to); static void touch(String filePath); static void touch(File file); static void deleteFile(@Nullable File file); static void deleteFile(@Nullable Path path); static void deleteDir(Path dir); static void deleteDir(File dir); static boolean isDirExists(String dirPath); static boolean isDirExists(Path dirPath); static boolean isDirExists(File dir); static void makesureDirExists(String dirPath); static void makesureDirExists(File file); static void makesureDirExists(Path dirPath); static void makesureParentDirExists(File file); static boolean isFileExists(String fileName); static boolean isFileExists(File file); static boolean isFileExists(Path path); static Path createTempDir(); static Path createTempFile(); static Path createTempFile(String prefix, String suffix); static String getFileName(@NotNull String fullName); static String getFileExtension(File file); static String getFileExtension(String fullName); }
FileUtil { public static BufferedWriter asBufferedWriter(String fileName) throws IOException { Validate.notBlank(fileName, "filename is blank"); return Files.newBufferedWriter(getPath(fileName), Charsets.UTF_8); }  static byte[] toByteArray(final File file); static String toString(final File file); static List<String> toLines(final File file); static void write(final CharSequence data, final File file); static void append(final CharSequence data, final File file); static InputStream asInputStream(String fileName); static InputStream asInputStream(File file); static InputStream asInputStream(Path path); static OutputStream asOutputStream(String fileName); static OutputStream asOutputStream(File file); static OutputStream asOutputStream(Path path); static BufferedReader asBufferedReader(String fileName); static BufferedReader asBufferedReader(Path path); static BufferedWriter asBufferedWriter(String fileName); static BufferedWriter asBufferedWriter(Path path); static void copy(@NotNull File from, @NotNull File to); static void copy(@NotNull Path from, @NotNull Path to); static void copyFile(@NotNull File from, @NotNull File to); static void copyFile(@NotNull Path from, @NotNull Path to); static void copyDir(@NotNull File from, @NotNull File to); static void copyDir(@NotNull Path from, @NotNull Path to); static void moveFile(@NotNull File from, @NotNull File to); static void moveFile(@NotNull Path from, @NotNull Path to); static void moveDir(@NotNull File from, @NotNull File to); static void touch(String filePath); static void touch(File file); static void deleteFile(@Nullable File file); static void deleteFile(@Nullable Path path); static void deleteDir(Path dir); static void deleteDir(File dir); static boolean isDirExists(String dirPath); static boolean isDirExists(Path dirPath); static boolean isDirExists(File dir); static void makesureDirExists(String dirPath); static void makesureDirExists(File file); static void makesureDirExists(Path dirPath); static void makesureParentDirExists(File file); static boolean isFileExists(String fileName); static boolean isFileExists(File file); static boolean isFileExists(Path path); static Path createTempDir(); static Path createTempFile(); static Path createTempFile(String prefix, String suffix); static String getFileName(@NotNull String fullName); static String getFileExtension(File file); static String getFileExtension(String fullName);  }