Here you can find the source of load(String propsName)
Parameter | Description |
---|---|
propsName | a parameter |
Parameter | Description |
---|---|
Exception | an exception |
public static Properties load(String propsName) throws IOException
//package com.java2s; //License from project: Apache License import java.io.IOException; import java.net.URL; import java.util.Properties; public class Main { /**/*from ww w . j av a 2 s . c o m*/ * Load a properties file from the classpath. Thanks to: http://www.rgagnon.com/javadetails/java-0434.html * * @param propsName * * @return Properties * * @throws Exception */ public static Properties load(String propsName) throws IOException { Properties props = new Properties(); ClassLoader cl = Thread.currentThread().getContextClassLoader(); URL url = cl.getResource(propsName); props.load(url.openStream()); return props; } }