Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: LGPL 

import java.util.Enumeration;

import java.util.Properties;
import java.util.ResourceBundle;

public class Main {
    public static Properties convertResourceBundleToProperties(ResourceBundle resource) {
        Properties properties = new Properties();

        Enumeration<String> keys = resource.getKeys();
        while (keys.hasMoreElements()) {
            String key = keys.nextElement();
            properties.put(key, resource.getString(key));
            //System.out.println("key: '" + key + "' value: '" + properties.get(key) + "'");
        }

        return properties;
    }
}