package com.ds.listing.properties;

import java.io.IOException;
import java.util.Properties;

/**
 * Created by bithack on 3/31/15.
 */
public class UserProperties {
    private static UserProperties _instance = null;

    private Properties props;

    private boolean valid = true;

    protected UserProperties(){
        try {
            props = new Properties();
            props.load(getClass().getResourceAsStream("/META-INF/kmhenry.properties"));
        } catch (IOException e) {
            //squash error
            valid = false;
        }
    }

    public boolean isValid(){
        return valid;
    }

    public static UserProperties getInstance(){
        if(_instance == null){
            _instance = new UserProperties();
        }
        return _instance;
    }

    public String getValue(String key){
        return props.getProperty(key);
    }

}

@@ -85,16 +85,86 @@
 perties;
+%0Aimport javax.inject.Singleton;%0Aimport javax.annotation.PostConstruct;
 %0A%0A/**%0A *
@@ -199,16 +199,28 @@
 15.%0A */%0A
+ @Singleton%0A
 public c
@@ -245,61 +245,8 @@
 s %7B%0A
-    private static UserProperties _instance = null;%0A%0A
     
@@ -271,17 +271,16 @@
  props;%0A
-%0A
     priv
@@ -314,32 +314,44 @@
     
-protected UserProperties
+@PostConstruct%0A    private void init
 ()%7B%0A
@@ -528,35 +528,8 @@
 ) %7B%0A
-            //squash error%0A
     
@@ -594,24 +594,24 @@
  isValid()%7B%0A
+
         retu
@@ -631,176 +631,8 @@
  %7D%0A%0A
-    public static UserProperties getInstance()%7B%0A        if(_instance == null)%7B%0A            _instance = new UserProperties();%0A        %7D%0A        return _instance;%0A    %7D%0A%0A
     

Update UserProperties.java