在日常的脚本编写过程中,通常会获取配置文件中的配置项,以执行相应的业务逻辑。

小二上码。。。若有不足之处,敬请大神指正,不胜感激!

获取配置项值的源码如下所示:

     /**
* Get value from properties by key. Return null when the key not exist.
*
* @author Aaron.ffp
* @version V1.0.0: autoUISelenium main.java.aaron.java.tools FileUtils.java propertiesGetValue, 2014-11-20 16:31:22 Exp $
*
* @param prop : properties
* @param key : key
* @return String
*/
public String propertiesGetValue(Properties prop, String key){
String value = ""; if (this.propertiesKeyIsExist(prop, key)) {
value = prop.getProperty(key);
} else {
value = null;
} return value;
}

Java 获取 properties 配置文件源码

测试源码如下所示:

     /**
* Test : Get value from properties file by key
*
* @author Aaron.ffp
* @version V1.0.0: autoUISelenium test.java.aaron.java.tools FileUtilsTest.java test_propertiesGetValue, 2014-11-20 16:40:15 Exp $
*
*/
@Test
public void test_propertiesGetValue(){
this.message = "\n\n\nTEST:FileUtils.propertiesGetValue(Properties prop, String key)";
this.logger.debug(this.message); this.fu = new FileUtils();
String filename = this.constantslist.PROJECTHOME + this.constantslist.FILESEPARATOR +
"testng-temp" + this.constantslist.FILESEPARATOR + "propertiesRead.properties"; Properties prop = this.fu.propertiesRead(filename); // print-1
prop.list(System.out); System.out.println("\n\n"); Assert.assertEquals(this.fu.propertiesGetValue(prop, "host"), "127.0.0.1", "Test case failed.");
}

测试源码

执行结果如下所示:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAArAAAAFRCAIAAAAD1glbAAAgAElEQVR4nO2dyYGsvA5GKy4CIh6iYfVCeBkQjP8Fk2RLwgaqiup7zqqbwcjCw4egrNf4v/8nAAAA+Ld5IQgAAAAAQQAAAAAIAgAAAEAQAAAAQEIQAAAAQDIFwdC9JN0wpZRSGnuxyT2l73uxt9w+ZaVvpeU7+vGNtYY09tudPc9+z7ph7NvL2296P6p/o6K2o67bDwAAG2aEYOzFfDx0YuCdhq4Y+idxxNjvcqFm+/yPcdmxv6IJhu4ePXFXOd/irfZLSTENXc0Ebdkz9lp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QEAQAAACQEAQAAACQEAQAAACQEAQAAACQEAQAAACQEAQAAACQEAQAAACQEAQAAACQEAQAAACQEAQAAACQUvoPzzH7thdq5REAAAAASUVORK5CYII=" alt="" />

至此, Java学习-021-Properties 获取配置项对应的值 顺利完结,希望此文能够给初学 Java 的您一份参考。

最后,非常感谢亲的驻足,希望此文能对亲有所帮助。热烈欢迎亲一起探讨,共同进步。非常感谢! ^_^

Java学习-021-Properties 获取配置项对应的值的更多相关文章

  1. Java学习:Properties类

    Java学习:Properties类 学习目标 认识properties文件,理解其含义,会正确创建properties文件. 会使用java.util.Properties类来操作propertie ...

  2. Java学习-058-Jsoup爬虫获取中国所有的三级行政区划数据(三),处理二级编码缺失

    通过查看数据可知,直辖市或者某些三级行政区域没有对应的二级区域,为方便后续的地址使用,可自定义缺失的二级地址. 如下示例自定义的二级行政区域的名称为一级区域的名称,对应的源码如下所示: 将此段源码添加 ...

  3. Java 读取网络资源文件 获取文件大小 MD5校验值

    Java 读取网络资源文件 获取文件大小 MD5校验值 封装一个文件操作工具类: package c; import java.io.*; import java.net.HttpURLConnect ...

  4. Java学习-056-Jsoup爬虫获取中国所有的三级行政区划数据(一)

    在涉及地址服务时,经常需要用到地址信息的获取,而行政区划可能不定期的发生变化,所以我们需要获取最新的行政区划信息.因行政区划数据量较大,Java中可以使用Jsoup进行数据的获取.处理. 大家经常用到 ...

  5. Java学习-057-Jsoup爬虫获取中国所有的三级行政区划数据(二),并生成数据库 SQL 脚本插入语句

    多不废话,直接上马,小主您稳着... package com.fanfengping.zeus.uitl; import com.alibaba.fastjson.JSONObject; import ...

  6. Java学习-059-Jsoup爬虫获取中国所有的三级行政区划数据(四),生成相应的 JSON 数据并输出

    还是直接上马,对应的源码如下所示: 生成的三级行政区划部分 JSON 数据如下所示:

  7. Java反射机制二 获取方法的返回值或参数的泛型信息

    在使用反射机制时,我们经常需要知道方法的参数和返回值类型,很简单  ,下面上示例,示例中的两个方法非常相似 package deadLockThread; import java.lang.refle ...

  8. Java Scanner 类,获取用户输入的值

    Scanner 类使用步骤 1.导入java.util.Scanner import java.util.Scanner; 2.创建Scanner对象 Scanner scan = new Scann ...

  9. java 学习第二篇关系运算符和布尔值

    关系运算符,顾名思义.用来看什么关系.(也就是用来比较) 看下表 JAVA 关系运算符 a=6,b=5 关系运算符 举例 值 解释 > a>b true a大于b < a<b ...

随机推荐

  1. 新浪微博iOS客户端架构与优化之路

    新浪微博iOS客户端架构与优化之路   随着Facebook.Twitter.微博的崛起,向UGC.PGC.OGC,自媒体提供平台的内 容消费型App逐渐形成了独特的客户端架构模式.与电商和通讯工具类 ...

  2. FLTK 1.3.3 VS 2010 Configuration 配置

    Download FLTK 1.3.3 Download VS2010 I assume you've already installed VS2010 correctly. Compile the ...

  3. 4.用文本编辑器输入课堂上练习的Hello.java,并在JDK环境下编译和运行。请将程序编译、运行的结果截图,填入下框中。

    一开始报错是因为在文本框了的:用的是中文下的,应该用英文下的;

  4. Use a PowerShell Module to Easily Export Excel Data to CSV

    http://blogs.technet.com/b/heyscriptingguy/archive/2011/07/21/use-a-powershell-module-to-easily-expo ...

  5. int左移32位的行为未定义/Coverity

    int左移32位的行为未定义 Coverity 代码静态安全检测 Is Shifting more than 32 bits of a uint64_t integer on an x86 machi ...

  6. IE6 — 你若安好,便是晴天霹雳 [ 乱弹 ]

    为什么还有人在用IE6?估计和中国的盗版业有很大关系吧.小白的电脑启不来了,请人重装系统,一张古老的Ghost搞定,IE6便落地生根.今天碰到一例报告说某网站在IE6下丑陋吓人,无心无力去解决,于是来 ...

  7. vue model双向绑定

    view <div id='demo' class="container"> <input type="text" v-model='name ...

  8. laravel 外键schema RBAC

    $table->bigIncrements('id')  ;   Incrementing ID (primary key) using a " UNSIGNED BIG INTEGE ...

  9. nginx proxy_pass

    在nginx中配置proxy_pass时,如果是按照^~匹配路径时,要注意proxy_pass后的url最后的/,当加上了/,相当于是绝对根路径,则nginx不会把location中匹配的路径部分代理 ...

  10. struts1 plugin

    struts plugin 在struts.xml中注册之后,在系统启动之后调用 init 方法,通常在init方法中进行转化器的注册,在destory中移除转化器 1. struts文件 <p ...