/** * Load a specified properties resource * @param resourceName the resourceName of the properties file * * @return the corresponding Properties object */ public static Properties loadProperties(String resourceName) { LOG.info("Finding properties file '" + resourceName + "'"); return loadProperties(new NonOverrideableProperties(), resourceName); }
/** * Load a specified properties resource * @param resourceName the resourceName of the properties file * * @return the corresponding Properties object */ public static Properties loadProperties(String resourceName) { LOG.info("Finding properties file '" + resourceName + "'"); return loadProperties(new NonOverrideableProperties(), resourceName); }
/** * Load a specified properties file * @param filename the filename of the properties file * @return the corresponding Properties object */ protected static Properties loadProperties(String filename) { Properties props = new NonOverrideableProperties(); try { ClassLoader loader = Util.class.getClassLoader(); InputStream is = loader.getResourceAsStream(filename); if (is == null) { LOG.error("Could not find file " + filename + " from " + loader); return null; } props.load(is); is.close(); } catch (IOException e) { throw new RuntimeException("Failed to load :" + filename, e); } return props; }
/** * Load a specified properties file * @param filename the filename of the properties file * @return the corresponding Properties object */ protected static Properties loadProperties(String filename) { Properties props = new NonOverrideableProperties(); try { ClassLoader loader = Util.class.getClassLoader(); InputStream is = loader.getResourceAsStream(filename); if (is == null) { LOG.error("Could not find file " + filename + " from " + loader); return null; } props.load(is); is.close(); } catch (IOException e) { throw new RuntimeException("Failed to load :" + filename, e); } return props; }