Revision: 4302
http://jamwiki.svn.sourceforge.net/jamwiki/?rev=4302&view=rev
Author: pitpalme
Date: 2013-03-06 20:27:09 +0000 (Wed, 06 Mar 2013)
Log Message:
-----------
Made file reading UTF-8 BOM safe
Changed ResourceUtil to make use of commons-io BOMInputStream for
reading files, so leading byte-order-marks are correctly filtered from
returned String.
To do this commons-io FileUtils.readFileToString is skipped and it's
direct usage of IOUtils is mimicked for wrapping files InputStream by
BOMInputStream.
Additionally differentiation between existing files and ClassPath
resource files when reading contents is removed.
Modified Paths:
--------------
wiki/branches/pitpalme/jamwiki-core/src/main/java/org/jamwiki/utils/ResourceUtil.java
wiki/branches/pitpalme/jamwiki-core/src/test/java/org/jamwiki/utils/ResourceUtilTest.java
Added Paths:
-----------
wiki/branches/pitpalme/jamwiki-core/src/test/resources/StartingPoints.us-ascii.txt
wiki/branches/pitpalme/jamwiki-core/src/test/resources/StartingPoints.utf8-bom.txt
wiki/branches/pitpalme/jamwiki-core/src/test/resources/StartingPoints.utf8.txt
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|