Code example :

  1. package com.file.properties;
  2.  
  3. import java.io.FileInputStream;
  4. import java.util.Properties;
  5.  
  6. public class ReadProperties {
  7.  
  8. Properties prop;
  9.  
  10. public ReadProperties(String path) {
  11. prop = new Properties();
  12. try{
  13. FileInputStream fs = new FileInputStream(path);
  14. prop.load(fs);
  15. }catch(Exception e){
  16.  
  17. }
  18. }
  19.  
  20. public String getProperty(String key) {
  21. return prop.getProperty(key);
  22. }
  23.  
  24. // public static void main(String[] args) {
  25. // ReadProperties readProperties = new ReadProperties("D:\\SoapUIStudy\\application.properties");
  26. // System.out.println(readProperties.getProperty("name"));
  27. // }
  28. }

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

  1. package com.file.properties
  2.  
  3. def path = "D:\\SoapUIStudy\\application.properties"
  4.  
  5. ReadProperties p = new ReadProperties(path)
  6. 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. 最佳C/C++编辑器 source insight3

    C/C++嵌入式代码编辑器source insight3下载地址 http://www.sourceinsight.com/eval.html 注册码:SI3US-361500-17409

  2. java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy

    java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy at sun.reflect.an ...

  3. MSMQ向远程服务器发送消息----错误总结

    一:路径错误(Path)错误 如果向远程服务器发送消息,请使用格式名的形式,如: FormatName:Direct=TCP:121.0.0.1\\private$\\queueFormatName: ...

  4. 大数据之 ZooKeeper原理及其在Hadoop和HBase中的应用

    ZooKeeper是一个开源的分布式协调服务,由雅虎创建,是Google Chubby的开源实现.分布式应用程序可以基于ZooKeeper实现诸如数据发布/订阅.负载均衡.命名服务.分布式协调/通知. ...

  5. django创建第一个项目helloworld

    环境:centos 7,已安装python 3.6环境 1.安装django并创建django第一个项目 1.1.使用pip安装django# pip install Django或指定安装版本# p ...

  6. NLTK在自然语言处理

    nltk-data.zip 本文主要是总结最近学习的论文.书籍相关知识,主要是Natural Language Pracessing(自然语言处理,简称NLP)和Python挖掘维基百科Infobox ...

  7. 转转转--oracle 去重并按时间排序取第一条

    select t.* from (select a.*, row_number() over(partition by 需要分组的字段 order by 更新时间 desc) rw from 表 a) ...

  8. Java 数组类型转字符串类型

    Java手册 String public String() 初始化一个新创建的 String 对象,使其表示一个空字符序列.注意,由于 String 是不可变的,所以无需使用此构造方法. String ...

  9. 接口测试“八重天”---HttpClient

    HTTP协议在互联网无处不在,在前面的章节中记录了‘接口本质即协议’,因此,接口测试首先了解的便是协议,其发送数据包和接收数据包的过程,其次便是如何在测试中去发送去解析,不论是通过代码还是工具也好,抽 ...

  10. Solr Facet 统计查询

    一)概述 Facet是solr的高级搜索功能之一,可以给用户提供更友好的搜索体验.在搜索关键字的同时,能够按照Facet的字段进行分组并统计.例如下图所示,你上淘宝,输入“电脑”进行搜索,就会出现品牌 ...