Here you can find the source of getSubProperties(Properties src, String prefix)
public static Properties getSubProperties(Properties src, String prefix)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static Properties getSubProperties(Properties src, String prefix) { Properties persistenceProps = new Properties(); for (String key : src.stringPropertyNames()) { if (key.startsWith(prefix)) { String value = src.getProperty(key); persistenceProps.setProperty(key, value); }//from w w w.java 2 s. c o m } return persistenceProps; } }