本文整理汇总了Java中org.springframework.core.io.support.PropertiesLoaderUtils.loadAllProperties方法的典型用法代码示例。如果您正苦于以下问题:Java PropertiesLoaderUtils.loadAllProperties方法的具体用法?Java PropertiesLoaderUtils.loadAllProperties怎么用?Java PropertiesLoaderUtils.loadAllProperties使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.core.io.support.PropertiesLoaderUtils
的用法示例。
在下文中一共展示了PropertiesLoaderUtils.loadAllProperties方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.springframework.core.io.support.PropertiesLoaderUtils; //导入方法依赖的package包/类
/**
* Load the lease config from properties, and init the lockConfigMap.
*/
@PostConstruct
public void init() {
try {
// Using default path if no specified
confPath = StringUtils.isBlank(confPath) ? DEFAULT_CONF_PATH : confPath;
// Load lock config from properties
Properties properties = PropertiesLoaderUtils.loadAllProperties(confPath);
// Build the lockConfigMap
for (Entry<Object, Object> propEntry : properties.entrySet()) {
DLockType lockType = EnumUtils.valueOf(DLockType.class, propEntry.getKey().toString());
Integer lease = Integer.valueOf(propEntry.getValue().toString());
if (lockType != null && lease != null) {
lockConfigMap.put(lockType, lease);
}
}
} catch (Exception e) {
throw new RuntimeException("Load distributed lock config fail", e);
}
}
示例2: loadAllProperties
import org.springframework.core.io.support.PropertiesLoaderUtils; //导入方法依赖的package包/类
public static void loadAllProperties(String propertyFileName) {
try {
Properties properties = PropertiesLoaderUtils.loadAllProperties(propertyFileName);
processProperties(properties);
} catch (IOException e) {
e.printStackTrace();
}
}
示例3: getVersionProperties
import org.springframework.core.io.support.PropertiesLoaderUtils; //导入方法依赖的package包/类
public Properties getVersionProperties() {
try {
return PropertiesLoaderUtils.loadAllProperties("/META-INF/version.properties");
} catch (IOException e) {
LOG.error("Unable to load version information", e);
return new Properties();
}
}
示例4: setup
import org.springframework.core.io.support.PropertiesLoaderUtils; //导入方法依赖的package包/类
@Before
public void setup() {
try {
appProperties = PropertiesLoaderUtils.loadAllProperties("application.properties");
}
catch (IOException e) {
}
List<String> jdbcProperties = new ArrayList<>();
for (Object key : appProperties.keySet()) {
jdbcProperties.add(key + "=" + appProperties.get(key));
}
this.jdbc = jdbcProperties.toArray(new String[0]);
}
开发者ID:spring-cloud-stream-app-starters,项目名称:jdbc,代码行数:14,代码来源:PgcopyBadErrorTableIntegrationTests.java