Subversion Repositories SmartDukaan

Rev

Rev 21543 | Go to most recent revision | View as "text/plain" | Blame | Compare with Previous | Last modification | View Log | RSS feed

package com.spice.profitmandi.common;

import java.io.InputStream;
import java.util.Properties;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ResponseCodeHolder {

        private static final Logger log = LoggerFactory.getLogger(ResponseCodeHolder.class);
        private static final Properties properties = new Properties();
        static {
                final InputStream in = ResponseCodeHolder.class.getClassLoader().getResourceAsStream("response-codes.properties");
                try {
                        properties.load(in);
                } catch (Throwable e) {
                        log.error("Exception Code Properties could not be loaded", e);
                }
        }
        public static final String getMessage(String code) {
                String message = properties.getProperty(code) == null ? code : properties.getProperty(code);
                return message;
        }
}