Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Waibel2015-06-03 08:54:44 -0400
committerFlorian Waibel2015-06-03 08:54:44 -0400
commite110de89fc24d5052d69aa2899bd661025cde3af (patch)
tree310b62728aaf6bf6e3e9a59c05ce6c6c909c0403
parent105e1dd3c482b6caeac8782344858917c9139572 (diff)
downloadorg.eclipse.virgo.medic-e110de89fc24d5052d69aa2899bd661025cde3af.tar.gz
org.eclipse.virgo.medic-e110de89fc24d5052d69aa2899bd661025cde3af.tar.xz
org.eclipse.virgo.medic-e110de89fc24d5052d69aa2899bd661025cde3af.zip
Replaces code using default encoding with code using explicitly UTF-8
-rw-r--r--org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/log/impl/config/StandardLoggingConfiguration.java21
1 files changed, 5 insertions, 16 deletions
diff --git a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/log/impl/config/StandardLoggingConfiguration.java b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/log/impl/config/StandardLoggingConfiguration.java
index 7e74f91..49d4c57 100644
--- a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/log/impl/config/StandardLoggingConfiguration.java
+++ b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/log/impl/config/StandardLoggingConfiguration.java
@@ -11,16 +11,17 @@
package org.eclipse.virgo.medic.log.impl.config;
+import static java.nio.charset.StandardCharsets.UTF_8;
+
import java.io.BufferedReader;
import java.io.File;
-import java.io.FileReader;
+import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import org.eclipse.virgo.medic.log.LoggingConfiguration;
-
class StandardLoggingConfiguration implements LoggingConfiguration {
private final String configuration;
@@ -49,26 +50,14 @@ class StandardLoggingConfiguration implements LoggingConfiguration {
}
private static String readConfiguration(URL configURL) throws IOException {
- BufferedReader reader = null;
- try {
- reader = new BufferedReader(new InputStreamReader(configURL.openStream()));
+ try (BufferedReader reader = new BufferedReader(new InputStreamReader(configURL.openStream(), UTF_8))) {
return readConfiguration(reader);
- } finally {
- if (reader != null) {
- reader.close();
- }
}
}
private static String readConfiguration(File configFile) throws IOException {
- BufferedReader reader = null;
- try {
- reader = new BufferedReader(new FileReader(configFile));
+ try (BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(configFile), UTF_8))) {
return readConfiguration(reader);
- } finally {
- if (reader != null) {
- reader.close();
- }
}
}

Back to the top