public class ReadProps { public static void main (String[] args) { ReadProps readProps = new ReadProps(); readProps.readFile("test.properties"); } private void readFile (String fileName) { try { InputStream is = getClass().getResourceAsStream(fileName); Properties props = new Properties(); props.load(is); } catch (IOException ex) { ex.printStackTrace(); } } }
Tuesday, June 21, 2011
How to read property file in java?
Labels:
Java