Exemplo n.º 1
0
 /**
  * Allow users to add to the default rc
  *
  * @param key
  * @param value
  * @param url null => not url specific
  */
 public static synchronized void add(String key, String value, String url) {
   if (key == null) return;
   if (!initialized) RC.initialize();
   Triple t = new Triple(key, value, url);
   dfaltRC.insert(t);
   // recompute well-knowns
   setWellKnown();
 }
Exemplo n.º 2
0
 public static synchronized void initialize() {
   if (!initialized) {
     initialized = true;
     RC.loadDefaults();
     RC.setWellKnown();
     RC.loadFromJava();
   }
 }
Exemplo n.º 3
0
 /** Record some well known parameters */
 static void setWellKnown() {
   if (dfaltRC.triplestore.size() == 0) return;
   // Walk the set of triples looking for those that have no url
   for (String key : dfaltRC.keySet()) {
     Triple triple = dfaltRC.lookup(key);
     if (triple.url == null) {
       RC.set(key, triple.value); // let set sort it out
     }
   }
 }
Exemplo n.º 4
0
  static void loadDefaults() {
    RC rc0 = new RC();
    String[] locations =
        new String[] {
          System.getProperty("user.home"), System.getProperty("user.dir"),
        };

    boolean found1 = false;
    for (String loc : locations) {
      if (loc == null) continue;
      String dir = loc.replace('\\', '/');
      if (dir.endsWith("/")) dir = dir.substring(0, dir.length() - 1);
      for (String rcpath : rcfilelist) {
        String filepath = loc + "/" + rcpath;
        if (rc0.load(filepath)) found1 = true;
      }
    }
    if (!found1) if (showlog) log.debug("No .rc file found");
    dfaltRC = rc0;
  }
Exemplo n.º 5
0
 public static boolean getAllowSelfSigned() {
   if (!initialized) RC.initialize();
   return allowSelfSigned;
 }
Exemplo n.º 6
0
 public static boolean getVerifyServer() {
   if (!initialized) RC.initialize();
   return verifyServer;
 }
Exemplo n.º 7
0
 public static boolean getUseGroups() {
   if (!initialized) RC.initialize();
   return useGroups;
 }
Exemplo n.º 8
0
 /**
  * Allow users to search the default rc
  *
  * @param key
  * @param url null => not url specific
  * @return value corresponding to key+url, or null if does not exist
  */
 public static synchronized String find(String key, String url) {
   if (key == null) return null;
   if (!initialized) RC.initialize();
   Triple t = dfaltRC.lookup(key, url);
   return (t == null ? null : t.value);
 }
Exemplo n.º 9
0
 static {
   RC.initialize();
 }