From dc283e9a97296454a537ea06ba3cf7e7a2df8906 Mon Sep 17 00:00:00 2001 From: lixuebo Date: Thu, 10 Oct 2019 15:26:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=B9=B3=E5=8F=B0=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/InterfacePlatformConfigure.java | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src_tenwa/com/tenwa/httpclient/resources/InterfacePlatformConfigure.java diff --git a/src_tenwa/com/tenwa/httpclient/resources/InterfacePlatformConfigure.java b/src_tenwa/com/tenwa/httpclient/resources/InterfacePlatformConfigure.java new file mode 100644 index 000000000..741ed4c87 --- /dev/null +++ b/src_tenwa/com/tenwa/httpclient/resources/InterfacePlatformConfigure.java @@ -0,0 +1,40 @@ +package com.tenwa.httpclient.resources; + +import java.io.IOException; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Properties; +import java.util.concurrent.ConcurrentHashMap; + +import com.amarsoft.are.ARE; + +public class InterfacePlatformConfigure { + private static Map attributes; + + public static void load() { + attributes = new ConcurrentHashMap(); + Properties prop = new Properties(); + try { + prop.load(InterfacePlatformConfigure.class.getResourceAsStream("/interfacePlatform.properties")); + for(Entry entry : prop.entrySet()) { + if(entry.getKey() == null || entry.getValue() == null) { + continue; + } + attributes.put(entry.getKey().toString(), entry.getValue().toString()); + } + } catch (IOException e) { + e.printStackTrace(); + ARE.getLog().error("init GPSConfigure info failed"); + } + ARE.getLog().info("init GPSConfigure info success"); + } + + public static void destroy() { + if(attributes != null) attributes.clear(); + } + + public static String get(String propName) { + if(attributes == null) load(); + return attributes.get(propName); + } +}