Java Properties Load from File loadRQGProperties()

Here you can find the source of loadRQGProperties()

Description

load RQG Properties

License

Apache License

Declaration

public static void loadRQGProperties() 

Method Source Code


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

import java.io.InputStream;
import java.util.*;

public class Main {
    public static Properties environment = new Properties();
    public static Properties rqg_environment = new Properties();
    public static boolean isRQGEnabled = false;

    public static void loadRQGProperties() {
        isRQGEnabled = true;/*from w  w w . jav a 2s  .  com*/
        String propertPath = getRQGConfig();
        rqg_environment = new Properties();
        InputStream stream = null;
        if (propertPath == null) {
            propertPath = "rqg_config.properties";
        }
        if (propertPath != null) {
            stream = ClassLoader.getSystemClassLoader().getResourceAsStream(propertPath);
        }
        try {
            if (stream != null) {
                rqg_environment.load(stream);
                System.out.print(rqg_environment.toString());
            }
        } catch (Exception ex) {
            ex.printStackTrace(System.err);
        }
    }

    public static String getRQGConfig() {
        return environment.getProperty("couchbasedb.test.rqg_config", "do_not_use");
    }
}

Related

  1. loadPropertiesInClassPath(String propertiesFileName)
  2. loadProvidersConfiguration(Class base, String confPropertiesName)
  3. loadPythonScript(String pythonScriptName)
  4. loadReader(Reader stream)
  5. loadRecursively(String propertiesFilename)
  6. loadSetting(InputStream in, String key)
  7. loadSettings(String propertiesFileName)
  8. loadStrictly(File file)
  9. loadSystemProperty(String evn, String fileName)