propertiesファイルの読み込み
大した内容じゃないけど、すぐに忘れるのでメモ。
LoadProperties.java
package jp.gr.java_conf.ksino.sample; import java.io.FileInputStream; import java.io.InputStreamReader; import java.util.Properties; public class LoadProperties { public static void main(String[] args) throws Exception { FileInputStream fis = new FileInputStream( "testvalues.properties"); InputStreamReader reader = new InputStreamReader(fis, "UTF-8"); Properties properties = new Properties(); properties.load(reader); String key = "12345"; if (properties.containsKey(key)) { System.out.println(properties.getProperty(key)); } } }
testvalues.properties
12345=かきくけこ=さしすせそ&たちつてと=なにぬねの