public static Properties getResourceAsProperties ( Class < ? > requestingClass , String resource ) throws ResourceMissingException , IOException { InputStream inputStream = null ; Properties props = null ; try { inputStream = getResourceAsStream ( requestingClass , resource ) ; props = new Properties ( ) ; props . load ( inputStream ) ; } finally { if ( inputStream != null ) inputStream . close ( ) ; } return props ; }
Get the contents of a URL as a java . util . Properties object