Code example for Preferences

Methods: flushgetputputInt

0
	public static final String KEY_VIEW_CONVERT_PRODUCT_CODE = "view.convert.product.code";
 
	public SwingClientPreferences(){ 
		p = Preferences.userNodeForPackage(SwingClientPreferences.class);
		try{ 
			String factoryInitial = p.get(KEY_NAMING_FACTORY_INITIAL, null);
			if(factoryInitial == null){
				Properties jndi = ResourceLoader.getInstance().getProperties("jndi.properties");
				p.put(KEY_NAMING_FACTORY_INITIAL, jndi.getProperty(InitialContext.INITIAL_CONTEXT_FACTORY));
				p.put(KEY_NAMING_PROVIDER_URL, jndi.getProperty(InitialContext.PROVIDER_URL));
				p.putInt(KEY_HEALTHCHECK_INTERVAL, 60000);
				p.putInt(KEY_RECONNECT_INTERVAL, 10000);
				p.flush();
			} 
			String websocketUrl = p.get(KEY_WEBSOCKET_URL, null);
			if(websocketUrl == null){
				Properties websocket = ResourceLoader.getInstance().getProperties("websocket.properties");
				p.put(KEY_WEBSOCKET_URL, websocket.getProperty(KEY_WEBSOCKET_URL));
				p.flush();
			} 
		}catch(Exception e){
			throw new Error(e);
		} 
	} 
Stop searching for code, let great code find you!  Add Codota to your java IDE