zoukankan      html  css  js  c++  java
  • 读配置文件property文件



    import java.io.IOException;
    import java.util.Properties;

    import org.springframework.core.io.support.PropertiesLoaderUtils;

    /**
    * Description: 读取配置文件http地址配置<br>
    */
    public class ConfigFileUtils {

    /**
    * 读取authconfig.properties
    *
    * @param nodeName
    * @return
    */
    public static String getAuthconfig(String nodeName) {
    String configName = "application.properties";
    String result = pubReadConfig(configName, nodeName);
    if (result == null) {
    result = pubReadConfig("prop/" + configName, nodeName);
    }
    return result;
    }

    /**
    * 通用读取方法
    *
    * @param configName
    * @param nodeName
    * @return
    */
    public static String pubReadConfig(String configName, String nodeName) {
    Properties props = new Properties();
    while (true) {
    try {
    props = PropertiesLoaderUtils.loadAllProperties(configName);
    return (String) props.get(nodeName);
    } catch (IOException e) {
    System.out.println(e.getMessage());
    }
    }
    }
    }
  • 相关阅读:
    css布局模型
    HTML元素分类
    《水经注》卷三十五
    《水经注》卷二十八
    沧浪之水
    网页布局基础
    IndexError: tuple index out of range
    树回归-CART
    树回归-CART
    支持向量机SVM
  • 原文地址:https://www.cnblogs.com/duyinqiang/p/7601490.html
Copyright © 2011-2022 走看看