org.apache.commons.csv.CSVFormat.print(Path, Charset) should use NIO and

not convert the Path to a File.
This commit is contained in:
Gary Gregory 2016-08-23 14:40:49 -07:00
parent 5e9d2240ad
commit f7328ef02c
1 changed files with 2 additions and 1 deletions

View File

@ -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));
}
/**