public static Properties filterProperties(Properties properties,String prefix){
  Properties ret=new Properties();
  if (properties != null && prefix != null) {
    prefix=prefix.endsWith(".") ? prefix : prefix + ".";
    for (    String name : properties.stringPropertyNames()) {
      String newName=removeLeadingDots(name);
      if (newName.startsWith(prefix)) {
        newName=newName.length() > prefix.length() ? newName.substring(prefix.length()) : "";
        newName=removeLeadingDots(newName);
        if (newName.length() > 0) {
          ret.setProperty(newName,properties.getProperty(name));
        }
      }
    }
  }
  return ret;
}

public static Properties filterProperties ( Properties properties , String prefix ) { Properties ret = new Properties ( ) ; if ( properties != null && prefix != null ) { prefix = prefix . endsWith ( "." ) ? prefix : prefix + "." ; for ( String name : properties . stringPropertyNames ( ) ) { String newName = removeLeadingDots ( name ) ; if ( newName . startsWith ( prefix ) ) { newName = newName . length ( ) > prefix . length ( ) ? newName . substring ( prefix . length ( ) ) : "" ; newName = removeLeadingDots ( newName ) ; if ( newName . length ( ) > 0 ) { ret . setProperty ( newName , properties . getProperty ( name ) ) ; } } } } return ret ; }
filters the given properties with the given prefix token . keep in mind you cannot filter the last token . any property name that leads to an empty string is ignored
