Java Properties putPrefixToProperties(String prefix, Properties pro)

Here you can find the source of putPrefixToProperties(String prefix, Properties pro)

Description

put Prefix To Properties

License

Open Source License

Declaration

static public Properties putPrefixToProperties(String prefix,
            Properties pro) 

Method Source Code

//package com.java2s;
//  it under the terms of the GNU Lesser General Public License as published by

import java.util.*;

public class Main {
    static public Properties putPrefixToProperties(String prefix,
            Properties pro) {//  w  w w.  ja va2 s.  c o m
        Enumeration en;
        Properties res = new Properties();

        en = pro.propertyNames();

        for (; en.hasMoreElements();) {
            String nom = (String) en.nextElement();

            res.setProperty(prefix + nom, pro.getProperty(nom));
        }

        return res;
    }
}

Related

  1. mergeSystemProperties(Properties properties)
  2. propertiesToJson(Properties properties)
  3. propertiesToMap(Properties props)
  4. putAll(final Map props, final Properties p)
  5. putAll(Properties properties, Map result)
  6. removeDots(Properties props)
  7. search(List properties, String term)
  8. setProperty(Properties props, String keyword, Object value)
  9. stringPropertyNames(Properties props, String prefix)