org.h2.server.web.WebServer.saveProperties()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(125)

本文整理了Java中org.h2.server.web.WebServer.saveProperties()方法的一些代码示例,展示了WebServer.saveProperties()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebServer.saveProperties()方法的具体详情如下:
包路径:org.h2.server.web.WebServer
类名称:WebServer
方法名:saveProperties

WebServer.saveProperties介绍

[英]Save the settings to the properties file.
[中]将设置保存到属性文件中。

代码示例

代码示例来源:origin: com.h2database/h2

/**
 * Save the command history to the properties file.
 *
 * @param commandHistory the history
 */
public void saveCommandHistoryList(ArrayList<String> commandHistory) {
  StringBuilder sb = new StringBuilder();
  for (String s : commandHistory) {
    if (sb.length() > 0) {
      sb.append(';');
    }
    sb.append(s.replace("\\", "\\\\").replace(";", "\\;"));
  }
  commandHistoryString = sb.toString();
  saveProperties(null);
}

代码示例来源:origin: com.h2database/h2

private String settingRemove() {
  String setting = attributes.getProperty("name", "");
  server.removeSetting(setting);
  ArrayList<ConnectionInfo> settings = server.getSettings();
  if (!settings.isEmpty()) {
    attributes.put("setting", settings.get(0));
  }
  server.saveProperties(null);
  return "index.do";
}

代码示例来源:origin: com.h2database/h2

/**
 * Save the current connection settings to the properties file.
 *
 * @return the file to open afterwards
 */
private String settingSave() {
  ConnectionInfo info = new ConnectionInfo();
  info.name = attributes.getProperty("name", "");
  info.driver = attributes.getProperty("driver", "");
  info.url = attributes.getProperty("url", "");
  info.user = attributes.getProperty("user", "");
  server.updateSetting(info);
  attributes.put("setting", info.name);
  server.saveProperties(null);
  return "index.do";
}

代码示例来源:origin: com.h2database/h2

private String adminSave() {
  try {
    Properties prop = new SortedProperties();
    int port = Integer.decode((String) attributes.get("port"));
    prop.setProperty("webPort", String.valueOf(port));
    server.setPort(port);
    boolean allowOthers = Utils.parseBoolean((String) attributes.get("allowOthers"), false, false);
    prop.setProperty("webAllowOthers", String.valueOf(allowOthers));
    server.setAllowOthers(allowOthers);
    boolean ssl = Utils.parseBoolean((String) attributes.get("ssl"), false, false);
    prop.setProperty("webSSL", String.valueOf(ssl));
    server.setSSL(ssl);
    server.saveProperties(prop);
  } catch (Exception e) {
    trace(e.toString());
  }
  return admin();
}

代码示例来源:origin: com.eventsourcing/h2

/**
 * Save the command history to the properties file.
 *
 * @param commandHistory the history
 */
public void saveCommandHistoryList(ArrayList<String> commandHistory) {
  StringBuilder sb = new StringBuilder();
  for (String s : commandHistory) {
    if (sb.length() > 0) {
      sb.append(';');
    }
    sb.append(s.replace("\\", "\\\\").replace(";", "\\;"));
  }
  commandHistoryString = sb.toString();
  saveProperties(null);
}

代码示例来源:origin: org.wowtools/h2

/**
 * Save the command history to the properties file.
 *
 * @param commandHistory the history
 */
public void saveCommandHistoryList(ArrayList<String> commandHistory) {
  StringBuilder sb = new StringBuilder();
  for (String s : commandHistory) {
    if (sb.length() > 0) {
      sb.append(';');
    }
    sb.append(s.replace("\\", "\\\\").replace(";", "\\;"));
  }
  commandHistoryString = sb.toString();
  saveProperties(null);
}

代码示例来源:origin: com.eventsourcing/h2

private String settingRemove() {
  String setting = attributes.getProperty("name", "");
  server.removeSetting(setting);
  ArrayList<ConnectionInfo> settings = server.getSettings();
  if (settings.size() > 0) {
    attributes.put("setting", settings.get(0));
  }
  server.saveProperties(null);
  return "index.do";
}

代码示例来源:origin: org.wowtools/h2

private String settingRemove() {
  String setting = attributes.getProperty("name", "");
  server.removeSetting(setting);
  ArrayList<ConnectionInfo> settings = server.getSettings();
  if (settings.size() > 0) {
    attributes.put("setting", settings.get(0));
  }
  server.saveProperties(null);
  return "index.do";
}

代码示例来源:origin: org.wowtools/h2

/**
 * Save the current connection settings to the properties file.
 *
 * @return the file to open afterwards
 */
private String settingSave() {
  ConnectionInfo info = new ConnectionInfo();
  info.name = attributes.getProperty("name", "");
  info.driver = attributes.getProperty("driver", "");
  info.url = attributes.getProperty("url", "");
  info.user = attributes.getProperty("user", "");
  server.updateSetting(info);
  attributes.put("setting", info.name);
  server.saveProperties(null);
  return "index.do";
}

代码示例来源:origin: com.eventsourcing/h2

/**
 * Save the current connection settings to the properties file.
 *
 * @return the file to open afterwards
 */
private String settingSave() {
  ConnectionInfo info = new ConnectionInfo();
  info.name = attributes.getProperty("name", "");
  info.driver = attributes.getProperty("driver", "");
  info.url = attributes.getProperty("url", "");
  info.user = attributes.getProperty("user", "");
  server.updateSetting(info);
  attributes.put("setting", info.name);
  server.saveProperties(null);
  return "index.do";
}

代码示例来源:origin: org.wowtools/h2

private String adminSave() {
  try {
    Properties prop = new SortedProperties();
    int port = Integer.decode((String) attributes.get("port"));
    prop.setProperty("webPort", String.valueOf(port));
    server.setPort(port);
    boolean allowOthers = Boolean.parseBoolean(
        (String) attributes.get("allowOthers"));
    prop.setProperty("webAllowOthers", String.valueOf(allowOthers));
    server.setAllowOthers(allowOthers);
    boolean ssl = Boolean.parseBoolean(
        (String) attributes.get("ssl"));
    prop.setProperty("webSSL", String.valueOf(ssl));
    server.setSSL(ssl);
    server.saveProperties(prop);
  } catch (Exception e) {
    trace(e.toString());
  }
  return admin();
}

代码示例来源:origin: com.eventsourcing/h2

private String adminSave() {
  try {
    Properties prop = new SortedProperties();
    int port = Integer.decode((String) attributes.get("port"));
    prop.setProperty("webPort", String.valueOf(port));
    server.setPort(port);
    boolean allowOthers = Boolean.parseBoolean(
        (String) attributes.get("allowOthers"));
    prop.setProperty("webAllowOthers", String.valueOf(allowOthers));
    server.setAllowOthers(allowOthers);
    boolean ssl = Boolean.parseBoolean(
        (String) attributes.get("ssl"));
    prop.setProperty("webSSL", String.valueOf(ssl));
    server.setSSL(ssl);
    server.saveProperties(prop);
  } catch (Exception e) {
    trace(e.toString());
  }
  return admin();
}

相关文章