You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2016/06/07 09:56:21 UTC
[jira] [Resolved] (IO-509) FileUtils.readFileToString: null not
usable for default encoding
[ https://issues.apache.org/jira/browse/IO-509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sebb resolved IO-509.
---------------------
Resolution: Not A Problem
Cast the null to a Charset:
readFileToString(File, (Charset) null)
> FileUtils.readFileToString: null not usable for default encoding
> ----------------------------------------------------------------
>
> Key: IO-509
> URL: https://issues.apache.org/jira/browse/IO-509
> Project: Commons IO
> Issue Type: Bug
> Components: Utilities
> Affects Versions: 2.5
> Reporter: Lars W
>
> Since 2.5 FileUtils.readFileToString(File) is deprecated. readFileToString(File, Charset) should be used instead.
> The javadoc of readFileToString(File, Charset) says that, if the charset is null, the platform default charset will be used.
> But I cannot use readFileToString(File, null) to get that behaviour, since there also is readFileToString(File, String), so that readFileToString(File, null) is ambiguous.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)