package com.ygy.test;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
public class demo1 {
public static void main(String[] args) throws IOException {
InputStream in = ClassLoader.getSystemResourceAsStream("a.test");
Properties prop = new Properties();
prop.load(in);
String property = prop.getProperty("kafka.topics");
System.out.println(property);
}
}
在resource a.test中内容为
kafka.topics=calllog
运行得到calllog