Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Not A Problem
-
2.6
-
None
-
None
Description
FileUtils.writeStringToFile() method does not close the OutputStream. This can lead to running out of file descriptors, inability to write to the file a second time (Windows), and unpredictable file contents (Unix).
public static void writeStringToFile(final File file, final String data, final Charset encoding,
final boolean append) throws IOException {
try (OutputStream out = openOutputStream(file, append))
}
The stream is closed in version 2.5, but not in 2.6. It may have been introduced on the following commit: