commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (IO-509) FileUtils.readFileToString: null not usable for default encoding
Date Tue, 07 Jun 2016 09:56:21 GMT

     [ 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)

Mime
View raw message