You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.1 KiB
35 lines
1.1 KiB
package com.fr.plugin.third.party.jsdjjed.schedule.utils; |
|
|
|
import com.fr.io.utils.ResourceIOUtils; |
|
import com.fr.log.FineLoggerFactory; |
|
import com.fr.stable.StringUtils; |
|
|
|
import java.io.IOException; |
|
import java.io.InputStream; |
|
import java.util.Properties; |
|
|
|
public class PropertiesUtils { |
|
//获取配置文件 |
|
private static Properties getProperties() { |
|
InputStream is = ResourceIOUtils.read("/resources/minxing_push_message.properties"); |
|
Properties properties = new Properties(); |
|
try { |
|
properties.load(is); |
|
} catch (IOException e) { |
|
FineLoggerFactory.getLogger().error("JSD:>>get properties error! ",e.getMessage()); |
|
} |
|
return properties; |
|
} |
|
|
|
public static String getPro(String key) { |
|
Properties properties = PropertiesUtils.getProperties(); |
|
String value = properties.get(key)==null?"":properties.get(key).toString(); |
|
if ( StringUtils.isEmpty(value)) { |
|
FineLoggerFactory.getLogger().error("JSD:>>[{}] is null or empty!",key); |
|
} |
|
return value; |
|
} |
|
|
|
|
|
|
|
}
|
|
|