public static Properties loadFromResource ( ServletContext servletContext , String resource ) throws IOException { Properties props = new Properties ( ) ; InputStream in = servletContext . getResourceAsStream ( resource ) ; if ( in == null ) throw new LocalizedIOException ( accessor , "PropertiesUtils.readProperties.resourceNotFound" , resource ) ; try { props . load ( in ) ; } finally { in . close ( ) ; } return props ; }
Loads properties from a web resource .