|
@@ -6,6 +6,7 @@ import java.io.FileInputStream;
|
|
|
import java.io.IOException;
|
|
|
import java.io.InputStream;
|
|
|
import java.io.InputStreamReader;
|
|
|
+import java.util.Map.Entry;
|
|
|
import java.util.Properties;
|
|
|
import java.util.Set;
|
|
|
|
|
@@ -123,7 +124,20 @@ public class PropertiesUtil {
|
|
|
BufferedReader reader = null;
|
|
|
try {
|
|
|
reader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
|
|
|
- props.load(reader);
|
|
|
+ Properties temp = new Properties();
|
|
|
+ temp.load(reader);
|
|
|
+ for (Entry<Object, Object> entry : temp.entrySet()) {
|
|
|
+ Object key = entry.getKey();
|
|
|
+ Object value = entry.getValue();
|
|
|
+ if (key instanceof String) {
|
|
|
+ key = ((String) key).trim();
|
|
|
+ }
|
|
|
+ if (value instanceof String) {
|
|
|
+ value = ((String) value).trim();
|
|
|
+ }
|
|
|
+ props.put(key, value);
|
|
|
+ }
|
|
|
+
|
|
|
} catch (IOException e) {
|
|
|
throw new ExamCloudRuntimeException(e);
|
|
|
} finally {
|