summaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-base/archiva-artifact-converter/src
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-09-15 21:38:31 +0000
committerOlivier Lamy <olamy@apache.org>2012-09-15 21:38:31 +0000
commit73509cab5c05663ca330ec4ea9b6f508c2921521 (patch)
treec8fad2eaa4ab9798ad5bac4104baae00b5da76f5 /archiva-modules/archiva-base/archiva-artifact-converter/src
parent833d272ab4200f032d456a72e1e316ed64acd304 (diff)
downloadarchiva-73509cab5c05663ca330ec4ea9b6f508c2921521.tar.gz
archiva-73509cab5c05663ca330ec4ea9b6f508c2921521.zip
prefer Charset.defaultCharset() over a hardcoded charset
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1385188 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-base/archiva-artifact-converter/src')
-rw-r--r--archiva-modules/archiva-base/archiva-artifact-converter/src/main/java/org/apache/archiva/converter/artifact/LegacyToDefaultConverter.java6
-rw-r--r--archiva-modules/archiva-base/archiva-artifact-converter/src/test/java/org/apache/archiva/converter/artifact/LegacyToDefaultConverterTest.java4
2 files changed, 5 insertions, 5 deletions
diff --git a/archiva-modules/archiva-base/archiva-artifact-converter/src/main/java/org/apache/archiva/converter/artifact/LegacyToDefaultConverter.java b/archiva-modules/archiva-base/archiva-artifact-converter/src/main/java/org/apache/archiva/converter/artifact/LegacyToDefaultConverter.java
index c777b32a1..83a1f4cff 100644
--- a/archiva-modules/archiva-base/archiva-artifact-converter/src/main/java/org/apache/archiva/converter/artifact/LegacyToDefaultConverter.java
+++ b/archiva-modules/archiva-base/archiva-artifact-converter/src/main/java/org/apache/archiva/converter/artifact/LegacyToDefaultConverter.java
@@ -210,7 +210,7 @@ public class LegacyToDefaultConverter
}
// Even if the checksums for the POM are invalid we should still convert the POM
- contents = FileUtils.readFileToString( file, Charset.forName( "UTF-8" ) );
+ contents = FileUtils.readFileToString( file, Charset.defaultCharset() );
}
catch ( IOException e )
{
@@ -226,7 +226,7 @@ public class LegacyToDefaultConverter
boolean matching = false;
if ( !force && targetFile.exists() )
{
- String targetContents = FileUtils.readFileToString( targetFile, Charset.forName( "UTF-8" ) );
+ String targetContents = FileUtils.readFileToString( targetFile, Charset.defaultCharset() );
matching = targetContents.equals( contents );
}
if ( force || !matching )
@@ -327,7 +327,7 @@ public class LegacyToDefaultConverter
File checksumFile = new File( file.getParentFile(), fileName );
if ( checksumFile.exists() )
{
- String checksum = FileUtils.readFileToString( checksumFile, Charset.forName( "UTF-8" ) );
+ String checksum = FileUtils.readFileToString( checksumFile, Charset.defaultCharset() );
try
{
digester.verify( file, checksum );
diff --git a/archiva-modules/archiva-base/archiva-artifact-converter/src/test/java/org/apache/archiva/converter/artifact/LegacyToDefaultConverterTest.java b/archiva-modules/archiva-base/archiva-artifact-converter/src/test/java/org/apache/archiva/converter/artifact/LegacyToDefaultConverterTest.java
index f6544f655..2ab82c6a9 100644
--- a/archiva-modules/archiva-base/archiva-artifact-converter/src/test/java/org/apache/archiva/converter/artifact/LegacyToDefaultConverterTest.java
+++ b/archiva-modules/archiva-base/archiva-artifact-converter/src/test/java/org/apache/archiva/converter/artifact/LegacyToDefaultConverterTest.java
@@ -985,9 +985,9 @@ public class LegacyToDefaultConverterTest
throws IOException
{
String expectedContent = normalizeString(
- org.apache.commons.io.FileUtils.readFileToString( expectedPomFile, Charset.forName( "UTF-8" ) ) );
+ org.apache.commons.io.FileUtils.readFileToString( expectedPomFile, Charset.defaultCharset() ) );
String targetContent =
- normalizeString( org.apache.commons.io.FileUtils.readFileToString( pomFile, Charset.forName( "UTF-8" ) ) );
+ normalizeString( org.apache.commons.io.FileUtils.readFileToString( pomFile, Charset.defaultCharset() ) );
assertEquals( "Check file match between " + expectedPomFile + " and " + pomFile, expectedContent,
targetContent );
}