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. java的堆和栈

    初始入门嗯:https://www.cnblogs.com/SaraMoring/p/5687466.html 堆空间:new出来的数组和对象,对象和数组没有引用指向它的时候,等待下一次垃圾回收 栈空 ...

  2. RHEL6安装Oracle 11g R2

    收藏PDF版质料请点这里:http://download.csdn.net/detail/jifeng3518/6464999 1.使用DVD做yum源1.1.新建dvd挂载目录[root@oracl ...

  3. vs2005+WinCE模拟器+ActiveSync调试WinCE程序

    来源:http://www.cnblogs.com/xjimmyshcn/archive/2011/07/19/2111087.html 一.WinCE 模拟器通过ActiveSync 6.1(即Wi ...

  4. ASI接口

    Asynchronous Serial Interface ,异步串行接口,用于传送码流的一个标准DVB接口. 在目前的DVB-C系统设备的传输接口有两种MPEG2视频码流传输接口标准:异步串行接口A ...

  5. Java 字符串 String

    什么是Java中的字符串 在 Java 中,字符串被作为 String 类型的对象处理. String 类位于 java.lang 包中.默认情况下,该包被自动导入所有的程序. 创建 String 对 ...

  6. 集群(heartbeat)搭建

    HA 即(high available cluster)高可用集群,又称双机热备,保证关键性业务的不间断提供服务. 如:两台机器A和B,正常情况A提供服务,B待命闲置:一但A宕机或服务宕掉,自动切换至 ...

  7. 怎么才知道你在使用的是不是中国电信CN2的线路

    原文:http://www.juzhenyun.org/helpview_66.html 首先你能从和电信的合同上确认是否为CN2线路 目前CN2的线路多为商业用途.公司用户申请中国电信的Intern ...

  8. windows8.1中组件服务DCOM配置里属性灰色不可修改的解决办法

    由于电脑升级,更换成了windows8.1的64位操作系统,今天遇到组件服务中DCOM配置里IIS Admin Service属性呈现灰色,不能修改. 查找官方文档,原来这是win8.1 x64的安全 ...

  9. Windows常用内容渗透命令

    假设现在已经拥有一台内网[域]机器,取名X-007. 1-1.内网[域]信息收集 A.本机X-007信息收集. [+]------用户列表[Windows用户列表/邮件用户/...] ----> ...

  10. 第十九课 golang中的下划线

    在 Golang 里, _ (下划线)是个特殊的标识符. 用在 import 在导包的时候,常见这个用法: 1 2 import _ "net/http/pprof" import ...