Java examples for java.util:Properties File
get Properties By Input Stream
//package com.java2s; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.util.Properties; public class Main { public static Properties getPropertiesByInputStream(String propFileName) { Properties prop = new Properties(); InputStream input = null; try {// www .j av a 2s. co m input = new FileInputStream(propFileName); } catch (FileNotFoundException e) { e.printStackTrace(); } finally { try { prop.load(input); input.close(); } catch (IOException e) { e.printStackTrace(); } } return prop; } }