public static Properties prefixProperties(Properties props,String prefix){
  Properties prefixProps=new Properties();
  for (  String key : props.stringPropertyNames()) {
    if (key.startsWith(prefix)) {
      String keyWithoutPrefix=key.substring(prefix.length());
      prefixProps.setProperty(keyWithoutPrefix,props.getProperty(key));
    }
  }
  return prefixProps;
}

public static Properties prefixProperties ( Properties props , String prefix ) { Properties prefixProps = new Properties ( ) ; for ( String key : props . stringPropertyNames ( ) ) { if ( key . startsWith ( prefix ) ) { String keyWithoutPrefix = key . substring ( prefix . length ( ) ) ; prefixProps . setProperty ( keyWithoutPrefix , props . getProperty ( key ) ) ; } } return prefixProps ; }
extract only the properties that match a prefix , and with the prefix removed .
