Code example :

package com.file.properties;

import java.io.FileInputStream;
import java.util.Properties; public class ReadProperties { Properties prop; public ReadProperties(String path) {
prop = new Properties();
try{
FileInputStream fs = new FileInputStream(path);
prop.load(fs);
}catch(Exception e){ }
} public String getProperty(String key) {
return prop.getProperty(key);
} // public static void main(String[] args) {
// ReadProperties readProperties = new ReadProperties("D:\\SoapUIStudy\\application.properties");
// System.out.println(readProperties.getProperty("name"));
// }
}

Put jar to the tool's lib folder, eg: SoapUI,  use it by Groovy like this :

package com.file.properties

def path = "D:\\SoapUIStudy\\application.properties"

ReadProperties p = new ReadProperties(path)
log.info p.getProperty("name")

[Training Video - 6] [File Reading] Making a Jar file with eclispe, Importing custom jars in SoapUI的更多相关文章

  1. [Training Video - 6] [File Reading] [Java] Read Excel File Using Apache POI API

    读取以下两种格式的Excel : *.xls  and *.xlsx 用Apache POI API来实现,需要用到 HSSF 和 XSSF 的类库 HSSF is the POI Project's ...

  2. [Training Video - 6] [File Reading] [Java] Read Properties file

    package com.file.properties; import java.io.FileInputStream; import java.util.Properties; public cla ...

  3. [Training Video - 6] [File Reading] [Java] Create and Write Excel File Using Apache POI API

    package com.file.properties; import java.io.File; import java.io.FileNotFoundException; import java. ...

  4. eclipse 中的 jar file 和 runnable jar file的区别

    转自于:http://blog.csdn.net/lijiecong/article/details/6266234 java最难学的就是角落的东东了,不愧叫做java平台.搜索了一把总算明白了. 直 ...

  5. eclipse下提交job时报错mapred.JobClient: No job jar file set. User classes may not be found.

    错误信息: 11/10/14 13:52:07 WARN mapred.JobClient: Use GenericOptionsParser for parsing the arguments. A ...

  6. 现网环境业务不影响,但是tomcat启动一直有error日志,ERROR org.apache.catalina.startup.ContextConfig- Unable to process Jar entry [module-info.class] from Jar [jar:file:/home/iufs/apache-tomcat/webapps/iufs/WEB-INF/lib/asm

    完整的错误日志信息: 2019-03-19 15:30:42,021 [main] INFO org.apache.catalina.core.StandardEngine- Starting Ser ...

  7. eclipse 运行 mapreduce程序报错 No job jar file set. User classes may not be found. See JobConf(Class) or JobConf#setJar(String).

    报错信息 17/07/06 17:00:27 WARN mapred.JobClient: Use GenericOptionsParser for parsing the arguments. Ap ...

  8. An SPI class of type org.apache.lucene.codecs.PostingsFormat with name 'Lucene50' does not exist. You need to add the corresponding JAR file supporting this SPI to your classpath. The current classp

    背景介绍: 当ES中guava库与hive等组件的库冲突时,对Elasticsearch库进行shade,relocate解决库冲突问题. 当使用"org.apache.maven.plug ...

  9. org.apache.jasper.JasperException:Unable to read TLD "META-INF/c-1_0-rt.tld" from JAR file jstl-1.2.jar

    前两天把项目从eclipse EE版搬到MyEclipse中了.配置好jdk,确定build path中没有报错后,在tomcat中运行.结果,报错: org.apache.jasper.Jasper ...

随机推荐

  1. HDU 2154:跳舞毯

    跳舞毯 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submiss ...

  2. 软工2017第三周作业之找bug——测试报告

    作业要求来自:https://edu.cnblogs.com/campus/nenu/SWE2017FALL/homework/957 环境:windows7  cmd命令行 要求1 bug计分.阅读 ...

  3. java面试题6

    1.写一个冒泡排序的算法 升序排列: int[] nums = {5,6,9,10,20,30,28,27,15}; for(int i = 0;i<nums.length;i++){ for( ...

  4. L3-013 非常弹的球 (30 分)

    刚上高一的森森为了学好物理,买了一个“非常弹”的球.虽然说是非常弹的球,其实也就是一般的弹力球而已.森森玩了一会儿弹力球后突然想到,假如他在地上用力弹球,球最远能弹到多远去呢?他不太会,你能帮他解决吗 ...

  5. DesignPattern(三)结构型模式(上)

    结构型模式 结构型模式,顾名思义讨论的是类和对象的结构 ,主要用来处理类或对象的组合.它包括两种类型,一是类结构型模式,指的是采用继承机制来组合接口或实现:二是对象结构型模式,指的是通过组合对象的方式 ...

  6. PAT 1021 个位数统计 C语言

    1021. 个位数统计 (15) 给定一个k位整数N = dk-1*10k-1 + ... + d1*101 + d0 (0<=di<=9, i=0,...,k-1, dk-1>0) ...

  7. python3的eval和exec的区别与联系

    eval: 可以把字符串里的字符转换为可执行代码,但只支持一行字符.可以返回执行后得到的值.如下: f = "3+6+9+8"s = eval(f)print(s)输出: &quo ...

  8. Linux中的中断处理

    1. Linux中中断除了中断分层之外,还有一种就是中断线程化 存在意义:在Linux中,中断具有最高的优先级.不论在任何时刻,只要产生中断事件,内核将立即执行相应的中断处理程序,等到所有挂起的中断和 ...

  9. am335x内核初始化路径

    /arch/arm/mach-omap2/board_am335xevm.c中 1.myd_am335x_dev_cfg[]{ evm_nand_init() ... myir_gpio_init() ...

  10. Jmeter监控服务器的CPU

    1.Jmeter监控服务器的软件:链接: https://pan.baidu.com/s/1Ag75IXqR2XMe8RpZA4nvHg 密码: yki2 2.(1)Window版本 <1> ...