public static Properties loadProperties()

in solution/ack/solutions/IAM/OIDC/java_spring/src/main/java/org/hz/minigroup/common/CommonConstants.java [68:99]


    public static Properties loadProperties() {

        Properties properties = new Properties();
        try {
            File file = null;

            String configPath = new Object() {
                public String getPath() {
                    return this.getClass().getResource("/oidc.properties").getPath();
                }
            }.getPath();

            if (StringUtils.isNotBlank(configPath)) {
                file = new File(configPath);
            }
            if (StringUtils.isBlank(configPath) || !file.exists()) {
                logger.info("[1]can not find config file[-D]:" + configPath);
                throw new RuntimeException("can not find config file!");
            }

            InputStream ins = new FileInputStream(file);
            InputStreamReader reader = new InputStreamReader(ins, "UTF-8");
            properties.load(reader);
            ins.close();
            reader.close();
            logger.info("load config file:" + file.getAbsolutePath());
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            System.exit(0);
        }
        return properties;
    }