Package org.arch.config

Examples of org.arch.config.IniProperties


  static String googleHttpHostAlias = "GoogleHttp";
  static String googleHttpsHostAlias = "GoogleHttps";

  public static boolean init()
  {
    IniProperties cfg = SnovaConfiguration.getInstance().getIniProperties();
    if (cfg.getIntProperty("Google", "Enable", 1) == 0)
    {
      return false;
    }
    if (cfg.getBoolProperty("Google", "PreferIP", false))
    {
      googleHttpHostAlias = "GoogleHttpIP";
      googleHttpsHostAlias = "GoogleHttpsIP";
    }
    return true;
View Full Code Here


    }
  }

  public static boolean init()
  {
    IniProperties cfg = SnovaConfiguration.getInstance().getIniProperties();
    defaultProxy = cfg.getProperty("SPAC", "Default", "GAE");
    if (defaultProxy.equalsIgnoreCase("Auto"))
    {
      if (GAE.enable)
      {
        defaultProxy = "GAE";
      }
      else if (C4.enable)
      {
        defaultProxy = "C4";
      }
      else
      {
        defaultProxy = "Direct";
      }
    }
    if (cfg.getIntProperty("SPAC", "Enable", 1) == 0)
    {
      return false;
    }
    if (!loadSpacRules())
    {
View Full Code Here

   
  }
 
  private void updateProxyServiceMenus(List<Pair<JMenuItem, String>> list)
  {
    IniProperties cfg = SnovaConfiguration.getInstance().getIniProperties();
    for (Pair<JMenuItem, String> item : list)
    {
      String choice = item.second;
      if(choice.equals("SPAC")){
        choice = "Auto";
      }
      if (choice.endsWith(cfg.getProperty("SPAC", "Default")))
      {
        item.first.setIcon(ImageUtil.OK);
      }
      else
      {
View Full Code Here

  public static boolean  enable;
  public static boolean  spacEnbale  = true;
 
  private static void fetchGFWList()
  {
    IniProperties cfg = SnovaConfiguration.getInstance().getIniProperties();
    String gfwlist = MiscHelper.fetchContent(cfg.getProperty("SPAC",
            "GFWList"));
    if (null != gfwlist)
    {
      FileManager.writeFile(Base64.decode(gfwlist.trim()),
              "spac/snova-gfwlist.txt");
View Full Code Here

  }
 
  private static void initGFWList()
  {
    fetchGFWList();
    IniProperties cfg = SnovaConfiguration.getInstance().getIniProperties();
    String gfwlist = cfg.getProperty("SPAC", "GFWList");
    if (null == gfwlist)
    {
      return;
    }
    String content1 = FileManager.loadFile("spac/snova-gfwlist.txt");
View Full Code Here

  static String masterAppID = "snova-master";
  static String[] injectRange = null;

  public static boolean init()
  {
    IniProperties cfg = SnovaConfiguration.getInstance().getIniProperties();
    if (cfg.getIntProperty("GAE", "Enable", 1) == 0)
    {
      return false;
    }
    for (int i = 0;; i++)
    {
      String v = cfg.getProperty("GAE", "WorkerNode[" + i + "]");
      if (null == v || v.length() == 0)
      {
        break;
      }
      GAEServerAuth auth = new GAEServerAuth();
      if (!auth.parse(v.trim()))
      {
        logger.error("Failed to parse appid:" + v);
        break;
      }
      appids.add(auth);
    }
    if (appids.isEmpty() && (C4.enable))
    {
      return false;
    }
    masterAppID = cfg.getProperty("GAE", "MasterAppID", "snova-master");
    String tmp = cfg.getProperty("GAE", "InjectRange");
    if (!StringHelper.isEmptyString(tmp))
    {
      injectRange = tmp.split("[,|;|\\|]");
    }
    return true;
View Full Code Here

  {
    if (null != client)
    {
      return;
    }
    final IniProperties cfg = SnovaConfiguration.getInstance()
            .getIniProperties();
    Options options = new Options();
    options.maxIdleConnsPerHost = cfg.getIntProperty("GAE",
            "ConnectionPoolSize", 5);
    String proxy = cfg.getProperty("GAE", "Proxy");
    if (null != proxy)
    {
      final URL proxyUrl = new URL(proxy);
      options.proxyCB = new ProxyCallback()
      {
View Full Code Here

    if (proxyRequest.method.equalsIgnoreCase("GET"))
    {
      if (StringHelper.containsString(HttpHeaders.getHost(req),
              GAEConfig.injectRange) || injectRange)
      {
        IniProperties cfg = SnovaConfiguration.getInstance()
                .getIniProperties();
        rangeTask = new MultiRangeFetchTask();
        rangeTask.sessionID = local.getId();
        rangeTask.fetchLimit = cfg.getIntProperty("GAE",
                "RangeFetchLimitSize", 256 * 1024);
        rangeTask.fetchWorkerNum = cfg.getIntProperty("GAE",
                "RangeConcurrentFetcher", 3);
        rangeTask.asyncGet(proxyRequest, this);
        return;
      }

View Full Code Here

            length = rv.getLastBytePos() + 1;
          }
        }
        if (length > cv.getLastBytePos() + 1)
        {
          IniProperties cfg = SnovaConfiguration.getInstance()
                  .getIniProperties();
          rangeTask = new MultiRangeFetchTask();
          rangeTask.sessionID = local.getId();
          rangeTask.fetchLimit = cfg.getIntProperty("GAE",
                  "RangeFetchLimitSize", 256 * 1024);
          rangeTask.fetchWorkerNum = cfg.getIntProperty("GAE",
                  "RangeConcurrentFetcher", 3);
          rangeTask.setRangeCallback(this);
          rangeTask
                  .setRangeState(MultiRangeFetchTask.STATE_WAIT_HEAD_RES);
          rangeTask.processAsyncResponse(response);
View Full Code Here

    }
  }

  private Event wrapEvent(Event ev)
  {
    IniProperties cfg = SnovaConfiguration.getInstance().getIniProperties();
    EncryptType encType = EncryptType.valueOf(cfg.getProperty("GAE",
            "Encrypter", "SE1").toUpperCase());
    EncryptEvent enc = new EncryptEvent(encType, ev);
    return enc;
  }
View Full Code Here

TOP

Related Classes of org.arch.config.IniProperties

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.