rkhachatryan commented on code in PR #25028:
URL: https://github.com/apache/flink/pull/25028#discussion_r1671875906
##########
flink-core/src/main/java/org/apache/flink/util/FileUtils.java:
##########
@@ -138,17 +140,27 @@ public static String readFile(File file, String
charsetName) throws IOException
return new String(bytes, charsetName);
}
+ public static String readFile(File file, Charset charset) throws
IOException {
+ byte[] bytes = readAllBytes(file.toPath());
+ return new String(bytes, charset);
+ }
+
public static String readFileUtf8(File file) throws IOException {
- return readFile(file, "UTF-8");
+ return readFile(file, StandardCharsets.UTF_8);
}
public static void writeFile(File file, String contents, String encoding)
throws IOException {
byte[] bytes = contents.getBytes(encoding);
Files.write(file.toPath(), bytes, StandardOpenOption.WRITE);
}
Review Comment:
I see, I misunderstood the change and was thinking that the usages of new
method replaced the old ones in this PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]