changeset 806:fee42d7b2f33

merged.
author Raimund Renkert <raimund.renkert@intevation.de>
date Wed, 25 Nov 2015 13:35:12 +0100
parents a549700c338d (diff) 8249a76a1f6d (current diff)
children 54462abc373c 2b0d99fbeecc
files
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/de/intevation/lada/query/QueryTools.java	Fri Nov 20 11:30:59 2015 +0100
+++ b/src/main/java/de/intevation/lada/query/QueryTools.java	Wed Nov 25 13:35:12 2015 +0100
@@ -14,6 +14,7 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Scanner;
 
 import javax.json.Json;
 import javax.json.JsonArray;
@@ -43,14 +44,13 @@
     public static String readConfigFile(String file) {
         try {
             InputStream inputStream = QueryConfig.class.getResourceAsStream(file);
-            int ch;
-            StringBuilder builder = new StringBuilder();
-            while((ch = inputStream.read()) != -1) {
-                builder.append((char)ch);
-            }
-            return builder.toString();
+            Scanner scanner = new Scanner(inputStream, "UTF-8");
+            scanner.useDelimiter("\\A");
+            String configString = scanner.next();
+            scanner.close();
+            return configString;
         }
-        catch (IOException ioe) {
+        catch (Exception ioe) {
             ioe.printStackTrace();
             return null;
         }
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)