-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Labels
Description
Examples :
/**
* Writes a String to a file creating the file if it does not exist using the default encoding for the VM.
*
* @deprecated 2.5 use {@link #writeStringToFile(File, String, Charset, boolean)} instead (and specify the appropriate encoding)
*/
@Deprecated
public static void writeStringToFile(final File file, final String data, final boolean append) throws IOException {
writeStringToFile(file, data, Charset.defaultCharset(), append);
}
@Deprecated
public static void writeStringToFile(final File file, final String data) throws IOException {
writeStringToFile(file, data, Charset.defaultCharset(), false);
}
@Deprecated
public static String readFileToString(final File file) throws IOException {
return readFileToString(file, Charset.defaultCharset());
}
@Deprecated
public static List<String> readLines(final File file)
And many others : https://github.com/apache/commons-io/blob/master/src/main/java/org/apache/commons/io/FileUtils.java
Charset should be configurable. Ideally, it should accept :
- Use StandardCharsets whenever possible
- Charsets by name such as Windows-1252
Similar issue : openrewrite/rewrite-migrate-java#99
See also : openrewrite/rewrite#1724
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Recipes Wanted