List of usage examples for org.springframework.core.io.support PropertiesLoaderUtils fillProperties
static void fillProperties(Properties props, EncodedResource resource, PropertiesPersister persister) throws IOException
From source file:org.springframework.core.io.support.PropertiesLoaderSupport.java
/** * Load properties into the given instance. * @param props the Properties instance to load into * @throws IOException in case of I/O errors * @see #setLocations// w ww. j a va 2 s. c o m */ protected void loadProperties(Properties props) throws IOException { if (this.locations != null) { for (Resource location : this.locations) { if (logger.isDebugEnabled()) { logger.debug("Loading properties file from " + location); } try { PropertiesLoaderUtils.fillProperties(props, new EncodedResource(location, this.fileEncoding), this.propertiesPersister); } catch (FileNotFoundException | UnknownHostException ex) { if (this.ignoreResourceNotFound) { if (logger.isInfoEnabled()) { logger.info("Properties resource not found: " + ex.getMessage()); } } else { throw ex; } } } } }