Code example for PropertyResourceBundle

0
 
    public static ResourceBundle retrievePropertyBundle(String bundleName) {
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        InputStream is = cl.getResourceAsStream(bundleName + ".properties");
        try { 
            return new PropertyResourceBundle(is);
        } catch (IOException e) {
            throw new AgoravaException("Didn't found Agorava properties file", e);
        } 
    } 
 
    @Override 
    public Map<String, String> getProperties() {
        return null; 
    } 
 
    @Override 
    public String getPropertyValue(String key) {
        return resourceBundle.containsKey(key) ? resourceBundle.getString(key) : null;
    }