当前位置: 首页>>代码示例>>Java>>正文


Java Ini.store方法代码示例

本文整理汇总了Java中org.ini4j.Ini.store方法的典型用法代码示例。如果您正苦于以下问题:Java Ini.store方法的具体用法?Java Ini.store怎么用?Java Ini.store使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.ini4j.Ini的用法示例。


在下文中一共展示了Ini.store方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: write

import org.ini4j.Ini; //导入方法依赖的package包/类
/**
 * Write the object to a Writer.
 *
 * @param out
 *          Stream to write object out to.
 */
public void write(Writer out) throws IOException {
  Ini configIni = new Ini();
  Section section = configIni.add(SECTION_NAME);

  section.put("algorithm", algorithm.toString());
  section.put("provider", provider);
  section.put("destination", destination.toString());
  if (destinationTable != null) {
    section.put("table", destinationTable);
  }
  if (defaultVisibility != null) {
    section.put("defaultVisibility", new String(defaultVisibility, VISIBILITY_CHARSET));
  }

  configIni.store(out);
}
 
开发者ID:mit-ll,项目名称:PACE,代码行数:23,代码来源:SignatureConfig.java

示例2: testWithStrictOperator

import org.ini4j.Ini; //导入方法依赖的package包/类
@Test public void testWithStrictOperator() throws Exception
{
    Config cfg = new Config();

    cfg.setStrictOperator(true);
    Ini ini = new Ini();
    Ini.Section sec = ini.add(Dwarfs.PROP_BASHFUL);

    sec.put(Dwarf.PROP_AGE, DwarfsData.bashful.age);
    ini.setConfig(cfg);
    StringWriter writer = new StringWriter();

    ini.store(writer);
    StringBuilder exp = new StringBuilder();

    exp.append(IniParser.SECTION_BEGIN);
    exp.append(Dwarfs.PROP_BASHFUL);
    exp.append(IniParser.SECTION_END);
    exp.append(NL);
    exp.append(Dwarf.PROP_AGE);
    exp.append('=');
    exp.append(DwarfsData.bashful.age);
    exp.append(NL);
    exp.append(NL);
    assertEquals(exp.toString(), writer.toString());
}
 
开发者ID:JetBrains,项目名称:intellij-deps-ini4j,代码行数:27,代码来源:IniFormatterTest.java

示例3: createUserConfFile

import org.ini4j.Ini; //导入方法依赖的package包/类
private void createUserConfFile(Ca ca,
		Map<String, String> subjAlt) throws Exception {
	
	File f = new File(ca.getUserConfFileName());
	Ini confFile = new Ini(f);
	Ini.Section sect;
	sect = confFile.get("v3_req");
		sect.put("basicConstraints", "CA:FALSE");
		sect.put("keyUsage", "cRLSign, digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment, keyAgreement, keyCertSign, cRLSign");
		sect.put("subjectKeyIdentifier", "hash");
		sect.put("certificatePolicies", "@polsection");
	sect = confFile.get("v3_ca"); 
		sect.put("basicConstraints", "critical,CA:FALSE");
		sect.put("keyUsage", "digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment, keyAgreement, keyCertSign, cRLSign");
		sect.put("authorityKeyIdentifier", "keyid,issuer:always");
		sect.put("certificatePolicies", "@polsection");
		sect.put("subjectAltName", "@subject_alt_section");
	sect = confFile.get("subject_alt_section");
		sect.clear();
		for (String key : subjAlt.keySet()) {
			sect.put(key, subjAlt.get(key));
		}
	confFile.store();
}
 
开发者ID:robsonsmartins,项目名称:fiap-mba-java-projects,代码行数:25,代码来源:IcpBrasilDAO.java

示例4: createCaConfFile

import org.ini4j.Ini; //导入方法依赖的package包/类
@Override
protected void createCaConfFile(Ca rootCa, Ca ca, String crlURI,
		String cpsURI, String subject) throws Exception {
	
	super.createCaConfFile(rootCa, ca, crlURI, cpsURI, subject);
	File f = new File(ca.getConfFileName());
	Ini confFile = new Ini(f);
	Ini.Section sect;
	sect = confFile.get("v3_req");
		sect.put("certificatePolicies", "@polsection1, @polsection2");
	sect = confFile.get("v3_ca");
		sect.put("authorityKeyIdentifier", "keyid,issuer:always");
		sect.put("certificatePolicies", "@polsection1, @polsection2");
	sect = confFile.add("polsection1"); 
		sect.put("policyIdentifier", cpsCaA1);
		sect.put("CPS.1", "\"" + cpsURI + "\"");
	sect = confFile.add("polsection2"); 
		sect.put("policyIdentifier", cpsCaA3);
		sect.put("CPS.1", "\"" + cpsURI + "\"");
	confFile.store();
}
 
开发者ID:robsonsmartins,项目名称:fiap-mba-java-projects,代码行数:22,代码来源:CaDAO.java

示例5: createHandleManagerDeployCfg

import org.ini4j.Ini; //导入方法依赖的package包/类
private File createHandleManagerDeployCfg(
		final AuthToken shockAdminToken,
		final String allowedUser,
		final URL authServiceURL)
		throws IOException {
	final File iniFile = tempDir.resolve("handleManager.cfg").toFile();
	if (iniFile.exists()) {
		iniFile.delete();
	}
	
	final Ini ini = new Ini();
	final Section hm = ini.add("HandleMngr");
	hm.add("handle-service-url", "http://localhost:" + handleServicePort);
	hm.add("service-host", "localhost");
	hm.add("service-port", "" + handleManagerPort);
	hm.add("auth-service-url", authServiceURL.toString());
	hm.add("admin-token", shockAdminToken.getToken());
	hm.add("allowed-users", allowedUser);
	
	ini.store(iniFile);
	return iniFile;
}
 
开发者ID:kbase,项目名称:workspace_deluxe,代码行数:23,代码来源:HandleServiceController.java

示例6: createHandleServiceDeployCfg

import org.ini4j.Ini; //导入方法依赖的package包/类
private File createHandleServiceDeployCfg(
		final MySQLController mysql,
		final String shockHost,
		final URL authServiceURL) throws IOException {
	final File iniFile = tempDir.resolve("handleService.cfg").toFile();
	if (iniFile.exists()) {
		iniFile.delete();
	}
	
	final Ini ini = new Ini();
	final Section hs = ini.add(HANDLE_SERVICE_NAME);
	hs.add("self-url", "http://localhost:" + handleServicePort);
	hs.add("service-port", "" + handleServicePort);
	hs.add("service-host", "localhost");
	hs.add("auth-service-url", authServiceURL.toString());
	hs.add("default-shock-server", shockHost);
	
	hs.add("mysql-host", "127.0.0.1");
	hs.add("mysql-port", "" + mysql.getServerPort());
	hs.add("mysql-user", USER);
	hs.add("mysql-pass", PWD);
	hs.add("data-source", "dbi:mysql:" + DB);
	
	ini.store(iniFile);
	return iniFile;
}
 
开发者ID:kbase,项目名称:workspace_deluxe,代码行数:27,代码来源:HandleServiceController.java

示例7: overrideBuckconfig

import org.ini4j.Ini; //导入方法依赖的package包/类
public static void overrideBuckconfig(
    ProjectWorkspace projectWorkspace,
    Map<String, ? extends Map<String, String>> buckconfigOverrides)
    throws IOException {
  String config = projectWorkspace.getFileContents(".buckconfig");
  Ini ini = new Ini(new StringReader(config));
  for (Map.Entry<String, ? extends Map<String, String>> section :
      buckconfigOverrides.entrySet()) {
    for (Map.Entry<String, String> entry : section.getValue().entrySet()) {
      ini.put(section.getKey(), entry.getKey(), entry.getValue());
    }
  }
  StringWriter writer = new StringWriter();
  ini.store(writer);
  Files.write(projectWorkspace.getPath(".buckconfig"), writer.toString().getBytes(UTF_8));
}
 
开发者ID:facebook,项目名称:buck,代码行数:17,代码来源:TestDataHelper.java

示例8: storeSession

import org.ini4j.Ini; //导入方法依赖的package包/类
/**Stores a session with all back end modules and the Splitter's configuration**/
public void storeSession(int sessionNumber){
    try{
        String dbPath = System.getProperty("user.home")+"/.nubisave/nubisavemount/data/.nubisave_database"+sessionNumber;
        //store the back end modules:
        File dir = new File(dataDir+"/.nubisave_session_"+sessionNumber);
        dir.mkdirs();
        Nubisave.services.storeToDatabase(dataDir+"/.nubisave_session_"+sessionNumber);
        FileUtil.copy(new File(new PropertiesUtil("nubi.properties").getProperty("splitter_database_location")+".db"), new File(dbPath));
        Ini splitterConfig = new Ini(new File(configurationFilePath));
        splitterConfig.put("splitter", "save", sessionNumber);
        System.out.println( "gui db path: "+"/.nubisave_database"+sessionNumber);
        splitterConfig.put("database", "path", "/.nubisave_database"+sessionNumber);
        splitterConfig.store();

    } catch(Exception e){
        System.err.println("Splitter.storeSession(int sessionNumber): Failed to configure Splitter "+" - "+e.getMessage()==null?e.getMessage():"");
    }
}
 
开发者ID:joe42,项目名称:nubisave,代码行数:20,代码来源:Splitter.java

示例9: write

import org.ini4j.Ini; //导入方法依赖的package包/类
/**
 * Write the object to a Writer.
 *
 * @param out
 *          Stream to write object out to.
 */
public void write(Writer out) throws IOException {
  Ini configIni = new Ini();

  for (FieldEncryptorConfig config : fieldEncryptorConfigs) {
    config.write(configIni);
  }

  configIni.store(out);
}
 
开发者ID:mit-ll,项目名称:PACE,代码行数:16,代码来源:EncryptionConfig.java

示例10: verify

import org.ini4j.Ini; //导入方法依赖的package包/类
private void verify(Ini ini, IniHandler mock) throws Exception
{
    StringWriter writer = new StringWriter();

    ini.store(writer);
    IniParser parser = new IniParser();

    parser.parse(new StringReader(writer.toString()), mock);
    EasyMock.verify(mock);
}
 
开发者ID:JetBrains,项目名称:intellij-deps-ini4j,代码行数:11,代码来源:IniFormatterTest.java

示例11: main

import org.ini4j.Ini; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception
{
    Ini ini = new Ini();
    DwarfBean doc = new DwarfBean();

    doc.setAge(123);
    doc.setHeight(111);
    doc.setWeight(22.1);
    doc.setHomePage(new URI("http://foo.bar"));
    ini.add("doc").from(doc);
    ini.store(System.out);
}
 
开发者ID:JetBrains,项目名称:intellij-deps-ini4j,代码行数:13,代码来源:FromSample.java

示例12: save

import org.ini4j.Ini; //导入方法依赖的package包/类
private static void save(Ini ini) throws IOException {
    String homeDir = getSaveDirectory();
    if (homeDir != null) {
        File propsFile = new File(homeDir, PREFERENCES_NAME);
        ini.store(propsFile);
    }
}
 
开发者ID:jub77,项目名称:grafikon,代码行数:8,代码来源:AppPreferences.java

示例13: createUserConfFile

import org.ini4j.Ini; //导入方法依赖的package包/类
protected void createUserConfFile(Ca rootCa, Ca ca, String crlURI,
		String cpsURI, String subject) throws Exception {
	
	createConfFile(ca.getUserConfFileName(), rootCa, ca, crlURI, cpsURI, subject);
	
	File f = new File(ca.getUserConfFileName());
	Ini confFile = new Ini(f);
	Ini.Section sect;
	sect = confFile.get("v3_req");
		sect.put("basicConstraints", "CA:FALSE");
		sect.put("keyUsage", "cRLSign, digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment, keyAgreement, keyCertSign, cRLSign");
		sect.put("subjectKeyIdentifier", "hash");
		sect.put("crlDistributionPoints", "URI:" + crlURI);
		sect.put("certificatePolicies", "@polsection");
		sect.put("extendedKeyUsage", "serverAuth, clientAuth, codeSigning, emailProtection, timeStamping, 1.3.6.1.4.1.311.20.2.2");
	sect = confFile.get("v3_ca"); 
		sect.put("basicConstraints", "critical,CA:FALSE");
		sect.put("keyUsage", "digitalSignature,	nonRepudiation, keyEncipherment, dataEncipherment");
		sect.put("authorityKeyIdentifier", "keyid,issuer:always");
		sect.put("crlDistributionPoints", "URI:" + crlURI);
		sect.put("certificatePolicies", "@polsection");
		sect.put("extendedKeyUsage", "serverAuth, clientAuth, codeSigning, emailProtection, timeStamping, 1.3.6.1.4.1.311.20.2.2");
		sect.put("subjectAltName", "@subject_alt_section");
	sect = confFile.get("polsection"); 
		sect.put("policyIdentifier", cpsCaA3);
		sect.put("CPS.1", "\"" + cpsURI + "\"");
	sect = confFile.get("req"); 
		sect.put("default_bits", "1024");
	sect = confFile.add("subject_alt_section");
		sect.put("subjectAltName", "");
	confFile.store();
}
 
开发者ID:robsonsmartins,项目名称:fiap-mba-java-projects,代码行数:33,代码来源:RootCaDAO.java

示例14: createEcpfConfFile

import org.ini4j.Ini; //导入方法依赖的package包/类
private void createEcpfConfFile(Ca ca,
		Map<String, String> subjAlt) throws Exception {

	createUserConfFile(ca, subjAlt);
	File f = new File(ca.getUserConfFileName());
	Ini confFile = new Ini(f);
	Ini.Section sect;
	sect = confFile.get("v3_req");
		sect.put("extendedKeyUsage", ECPF_EXTENDED_KEY_USAGE);
	sect = confFile.get("v3_ca"); 
		sect.put("extendedKeyUsage", ECPF_EXTENDED_KEY_USAGE);
	sect = confFile.get("polsection"); 
		sect.put("policyIdentifier", cpsCaA3PF);
	confFile.store();
}
 
开发者ID:robsonsmartins,项目名称:fiap-mba-java-projects,代码行数:16,代码来源:IcpBrasilDAO.java

示例15: createEcnpjConfFile

import org.ini4j.Ini; //导入方法依赖的package包/类
private void createEcnpjConfFile(Ca ca,
		Map<String, String> subjAlt) throws Exception {
	
	createUserConfFile(ca, subjAlt);
	File f = new File(ca.getUserConfFileName());
	Ini confFile = new Ini(f);
	Ini.Section sect;
	sect = confFile.get("v3_req");
		sect.put("extendedKeyUsage", ECNPJ_EXTENDED_KEY_USAGE);
	sect = confFile.get("v3_ca"); 
		sect.put("extendedKeyUsage", ECNPJ_EXTENDED_KEY_USAGE);
	sect = confFile.get("polsection"); 
		sect.put("policyIdentifier", cpsCaA3PJ);
	confFile.store();
}
 
开发者ID:robsonsmartins,项目名称:fiap-mba-java-projects,代码行数:16,代码来源:IcpBrasilDAO.java


注:本文中的org.ini4j.Ini.store方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。