get Config Value from Java ResourceBundle - Android Android OS

Android examples for Android OS:Bundle Get

Description

get Config Value from Java ResourceBundle

Demo Code


//package com.book2s;
import java.util.ResourceBundle;

public class Main {
    private static final String CONF_PATH = "conf.system";
    private static ResourceBundle resourceBundle;

    public static String getConfigValue(String key) {
        return getResourceBundle().getString(key);
    }/*  www.ja v  a2  s  .  c  o m*/

    public static ResourceBundle getResourceBundle() {
        if (resourceBundle == null) {
            resourceBundle = ResourceBundle.getBundle(CONF_PATH);
        }
        return resourceBundle;
    }
}

Related Tutorials