目的:读取src下面的属性配置文件
ReadProperties.java
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;
public class ReadProperties {
public static void main(String[] args) throws IOException {
Properties properties = new Properties();
FileInputStream in = new FileInputStream("src/aksk.properties");
properties.load(in);
String ak = (String) properties.get("qiniu.ak");
System.out.println(ak);
in.close();
}
}
aksk.properties