protected static Properties loadConfig ( String source , InputStream is ) { try { Properties p = new Properties ( ) ; p . load ( is ) ; // trim the value as it may have trailing white-space Set < String > keys = p . stringPropertyNames ( ) ; for ( String key : keys ) { p . setProperty ( key , p . getProperty ( key ) . trim ( ) ) ; } return p ; } catch ( IllegalArgumentException iae ) { throw iae ; } catch ( Exception ex ) { throw new IllegalArgumentException ( "Failed to load configuration from [" + source + "]" ) ; } }
Loads properties from the passed input stream