路径位置如下
202111091739023.png

配置文件信息

ureport.disableFileProvider=false
ureport.debug=true
ureport.disableHttpSessionReportCache=false

ureport.fileStoreDir=D:/hussar/hussar_v8/hussar-web/src/main/resources/ureportfiles/odms
filePath = D:/DevelopKit/FILE
openOfficePath = D:/Program Files (x86)/OpenOffice 4/program/soffice.exe -headless -accept="socket,host=127.0.0.1,port=8100;urp;"
pdfPath = D:/PDF/
fpPath = D:/fenpian
pythonPath = D:/pythoncode/
dataReaderName = DWDataReaderLib64.dll

代码示例

package com.jxdinfo.hussar.util;

import org.junit.Test;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
* @ClassName PropertiesUtil
* @Description 获取文件的配置项, 返回配置文件对象
* @Author Zhangyuhan
* @Date 2021/11/9
* @Version 1.0
*/
public class PropertiesUtil {
@Test
public void test() {
Properties properties = getProperties();
System.out.println(properties.get("filePath"));

}

public static Properties getProperties() {
Properties properties = new Properties();
// 使用ClassLoader加载properties配置文件生成对应的输入流
try (InputStream in = PropertiesUtil.class.getClassLoader().getResourceAsStream("ureport.properties");) {
// 使用properties对象加载输入流
properties.load(in);
} catch (IOException e) {
e.printStackTrace();
}
return properties;
}
}