From f7328ef02c1825a60b8a81f7583cf8ef948c2d92 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Tue, 23 Aug 2016 14:40:49 -0700 Subject: [PATCH] org.apache.commons.csv.CSVFormat.print(Path, Charset) should use NIO and not convert the Path to a File. --- src/main/java/org/apache/commons/csv/CSVFormat.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/apache/commons/csv/CSVFormat.java b/src/main/java/org/apache/commons/csv/CSVFormat.java index eee099d5..44801f90 100644 --- a/src/main/java/org/apache/commons/csv/CSVFormat.java +++ b/src/main/java/org/apache/commons/csv/CSVFormat.java @@ -36,6 +36,7 @@ import java.io.Reader; import java.io.Serializable; import java.io.StringWriter; import java.nio.charset.Charset; +import java.nio.file.Files; import java.nio.file.Path; import java.sql.ResultSet; import java.sql.ResultSetMetaData; @@ -907,7 +908,7 @@ public final class CSVFormat implements Serializable { * @since 1.5 */ public CSVPrinter print(final Path out, Charset charset) throws IOException { - return print(out.toFile(), charset); + return print(Files.newBufferedWriter(out, charset)); } /**