package common; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.Properties; public class MessageStream { /*プロパティファイル読み込みクラス*/ public Properties loadUtf8Properties(String resourceName) throws IOException { /*リソース元の読み込み選定*/ try (InputStream is = MessageStream.class.getResourceAsStream(resourceName); InputStreamReader isr = new InputStreamReader(is, "UTF-8"); BufferedReader reader = new BufferedReader(isr)) { Properties result = new Properties(); /*読み込み*/ result.load(reader); return result; } } }