8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The contents of this file are subject to the terms
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * of the Common Development and Distribution License
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * (the License). You may not use this file except in
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * compliance with the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * You can obtain a copy of the License at
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * https://opensso.dev.java.net/public/CDDLv1.0.html or
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * See the License for the specific language governing
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * permission and limitations under the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * When distributing Covered Code, include this CDDL
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Header Notice in each file and include the License file
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * If applicable, add the following below the CDDL Header,
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * with the fields enclosed by brackets [] replaced by
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * your own identifying information:
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * "Portions Copyrighted [year] [name of copyright owner]"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * $Id: MergeProperties.java,v 1.6 2008/06/25 05:44:03 qcheng Exp $
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Merge two properties file into one.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private MergeProperties(String origProp, String prependProp, String outfile)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster for (Iterator i = p1Keys.iterator(); i.hasNext(); ) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster for (Iterator i = p2Keys.iterator(); i.hasNext(); ) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private Map getProperties(String propertyName) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ResourceBundle res = ResourceBundle.getBundle(propertyName);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster for (Enumeration e = res.getKeys(); e.hasMoreElements(); ) {
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster private void writeToFile(String filename, StringBuffer content)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Merges two properties files into one. The first argument is
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * the original properties file; the second is the one to prepend;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * and the third is the output filename.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * <code>key1=x (from original properties file)</code> and
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * <code>key1=y (from the other properties file)</code> will result in
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * <code>key1=x y</code>.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster new MergeProperties(args[0], args[1], args[2]);