zoukankan      html  css  js  c++  java
  • 读取相关的配置

    String fileName = "shiro_base_auth.ini";
    ClassPathResource cp = new ClassPathResource(fileName);

    ini = new INI4j(cp.getFile());

    ------------------------------------------------------------------------

    // 读取相关的配置  配置文件必须放在src下

    ResourceBundle resourceBundle = ResourceBundle.getBundle("redis");
    int maxActive = Integer.parseInt(resourceBundle.getString("redis.pool.maxActive"));
    int maxIdle = Integer.parseInt(resourceBundle.getString("redis.pool.maxIdle"));
    int maxWait = Integer.parseInt(resourceBundle.getString("redis.pool.maxWait"));

    -------------------------------------------------------------------------

    public final static String DIR = PathConstants.class.getClassLoader().getResource("conf").getPath();
    public final static String baseConfig = DIR + File.separator + "jflow-path.properties";

    -------------------------------------------------------------------------------

    private static final Resource CONF_FILENAME = new ClassPathResource("fdfs_client.properties");;

    /** fdfs 访问的根Url **/
    private static String fastDFSUrl = "";

    public static String getFastDFSUrl(){
    try {
    IniFileReader iniReader = new IniFileReader(CONF_FILENAME.getFile().getAbsolutePath());
    fastDFSUrl = iniReader.getStrValue("fastDFSUrl");
    } catch (FileNotFoundException e) {
    e.printStackTrace();
    } catch (IOException e) {
    e.printStackTrace();
    }
    return fastDFSUrl;
    }

  • 相关阅读:
    基于任意深度学习+树状全库搜索的新一代推荐系统
    千人千面、个性化推荐,解读数据赋能商家背后的AI技术
    Graphics2D画图时背景颜色设置
    高校大数据实习实训平台需求
    B2B行业的支付的那些事。
    生成excel xls
    简单文件上传
    计时3秒后自动跳转到登录页
    jquery $换JQ
    用于二维数组排序
  • 原文地址:https://www.cnblogs.com/raphael5200/p/6481064.html
Copyright © 2011-2022 走看看