public static Properties openProperties ( final String propertyFileName ) throws IOException { if ( propertyFileName == null ) { return null ; } InputStream inputStream = null ; try { inputStream = Profile . class . getResourceAsStream ( propertyFileName ) ; if ( inputStream != null ) { // file could be opened Properties properties = new Properties ( ) ; properties . load ( inputStream ) ; return properties ; } else { // file doesn't exist return null ; } } finally { if ( inputStream != null ) { inputStream . close ( ) ; } } }
Loads properties from resources .