Java Preference initEnv(String key, String value)

Here you can find the source of initEnv(String key, String value)

Description

init Env

License

Apache License

Declaration

public static void initEnv(String key, String value) 

Method Source Code

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

import java.util.Map;

import java.util.prefs.Preferences;

public class Main {

    public static void initEnv(String key, String value) {
        Preferences preferences = Preferences.systemRoot().node(
                "/ice_water");
        if (key == null || "".equals(key.trim())) {
            key = "dev_java_mode";
        }/*ww  w .j  a  v a 2 s  . c  o m*/
        preferences.put(key, value);
    }

    public static <K, V> Map<K, V> put(Map<K, V> map, K key, V value) {
        V valueOld = map.get(key);
        if (valueOld == null) {
            map.put(key, value);
        }
        return map;
    }
}

Related

  1. classFor(Object obj)
  2. clearPreference(Object context)
  3. count(Preferences preferences, String preferenceName)
  4. createNode(String path)
  5. hasEnv(String key, String value)
  6. keyExists(String className, String prefName)
  7. readAllReg(String path)
  8. savePreference(String key, Object value)
  9. userNodeForClass(Class clazz)