package cn.itcast.crm.service.test;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Enumeration;
import java.util.Properties;
public class Test {
public static void main(String[] args) throws FileNotFoundException, IOException {
Properties properties = new Properties();
FileInputStream fileInputStream = new FileInputStream(
"src/test/java/cn/itcast/crm/service/test/test.properties");
properties.load(fileInputStream);
Enumeration fileName = properties.propertyNames();
while (fileName.hasMoreElements()) {
String key = (String) fileName.nextElement();
String value = properties.getProperty(key);
System.out.println(key + " , " + value);
}
}
}
直接创建test.properties的配置文件,copy文件的全路径。