接口平台定时任务
This commit is contained in:
parent
fbfb74b991
commit
dc283e9a97
@ -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<String, String> attributes;
|
||||
|
||||
public static void load() {
|
||||
attributes = new ConcurrentHashMap<String, String>();
|
||||
Properties prop = new Properties();
|
||||
try {
|
||||
prop.load(InterfacePlatformConfigure.class.getResourceAsStream("/interfacePlatform.properties"));
|
||||
for(Entry<Object, Object> 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);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user