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


Java Properties.list方法代码示例

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


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

示例1: addVersionInfo

import java.util.Properties; //导入方法依赖的package包/类
public void addVersionInfo() {
    Properties props = new Properties();
    // when running from webstart  we are not allowed to open a file on the local file system, but we can
    // get a the contents of a resource, which in this case is the echo'ed date stamp written by ant on the last build
    ClassLoader cl = this.getClass().getClassLoader(); // get this class'es class loader
    addLogInfo("\nLoading version info from resource " + AEViewerAboutDialog.VERSION_FILE);
    URL versionURL = cl.getResource(AEViewerAboutDialog.VERSION_FILE); // get a URL to the time stamp file
    addLogInfo("\nVersion URL=" + versionURL + "\n");

    if (versionURL != null) {
        try {
            Object urlContents = versionURL.getContent();
            BufferedReader in = null;
            if (urlContents instanceof InputStream) {
                props.load((InputStream) urlContents);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        ByteArrayOutputStream baos = new ByteArrayOutputStream(2048);
        PrintWriter ps = new PrintWriter(baos);
        props.list(ps);
        ps.flush();
        try {
            addLogInfo("\n" + baos.toString("UTF-8"));
        } catch (UnsupportedEncodingException ex) {
            System.err.println("cannot encode version information in LoggingWindow.addVersionInfo: " + ex.toString());
        }
    } else {
        props.setProperty("version", "missing file " + AEViewerAboutDialog.VERSION_FILE + " in jAER.jar");
    }

}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:34,代码来源:LoggingWindow.java

示例2: main

import java.util.Properties; //导入方法依赖的package包/类
public static void main(String[] args) {
    Solution solution = new Solution();
    Properties properties = solution.getProperties("4.JavaCollections/src/com/javarush/task/task31/task3109/properties.xml");
    properties.list(System.out);

    properties = solution.getProperties("4.JavaCollections/src/com/javarush/task/task31/task3109/properties.txt");
    properties.list(System.out);

    properties = solution.getProperties("4.JavaCollections/src/com/javarush/task/task31/task3109/notExists");
    properties.list(System.out);
}
 
开发者ID:avedensky,项目名称:JavaRushTasks,代码行数:12,代码来源:Solution.java

示例3: main

import java.util.Properties; //导入方法依赖的package包/类
public static void main(String[] args) throws IOException {
	SourceStream src = new FileSourceStream("UTF-8", args[0]);
	Properties defaultConfig = new Properties();
	Properties options = new Properties();
	readConfig(src, defaultConfig, options);
	defaultConfig.list(System.err);
	options.list(System.err);
}
 
开发者ID:Bibliome,项目名称:alvisnlp,代码行数:9,代码来源:TestReadConfig.java

示例4: setUpClientVM

import java.util.Properties; //导入方法依赖的package包/类
public void setUpClientVM(String host, int port, boolean cacheServerSslenabled,
    boolean cacheServerSslRequireAuth, String keyStore, String trustStore, boolean subscription) {

  Properties gemFireProps = new Properties();

  String cacheServerSslprotocols = "any";
  String cacheServerSslciphers = "any";

  String keyStorePath =
      TestUtil.getResourcePath(CacheServerSSLConnectionDUnitTest.class, keyStore);
  String trustStorePath =
      TestUtil.getResourcePath(CacheServerSSLConnectionDUnitTest.class, trustStore);
  // using new server-ssl-* properties
  gemFireProps.put(SERVER_SSL_ENABLED, String.valueOf(cacheServerSslenabled));
  gemFireProps.put(SERVER_SSL_PROTOCOLS, cacheServerSslprotocols);
  gemFireProps.put(SERVER_SSL_CIPHERS, cacheServerSslciphers);
  gemFireProps.put(SERVER_SSL_REQUIRE_AUTHENTICATION, String.valueOf(cacheServerSslRequireAuth));

  gemFireProps.put(SERVER_SSL_KEYSTORE_TYPE, "jks");
  gemFireProps.put(SERVER_SSL_KEYSTORE, keyStorePath);
  gemFireProps.put(SERVER_SSL_KEYSTORE_PASSWORD, "password");
  gemFireProps.put(SERVER_SSL_TRUSTSTORE, trustStorePath);
  gemFireProps.put(SERVER_SSL_TRUSTSTORE_PASSWORD, "password");

  StringWriter sw = new StringWriter();
  PrintWriter writer = new PrintWriter(sw);
  gemFireProps.list(writer);
  System.out.println("Starting client ds with following properties \n" + sw.getBuffer());

  ClientCacheFactory clientCacheFactory = new ClientCacheFactory(gemFireProps);
  clientCacheFactory.setPoolSubscriptionEnabled(subscription).addPoolServer(host, port);
  clientCache = clientCacheFactory.create();

  ClientRegionFactory<String, String> regionFactory =
      clientCache.createClientRegionFactory(ClientRegionShortcut.PROXY);
  Region<String, String> region = regionFactory.create("serverRegion");
  assertNotNull(region);
}
 
开发者ID:ampool,项目名称:monarch,代码行数:39,代码来源:CacheServerSSLConnectionDUnitTest.java

示例5: setUpServerVM

import java.util.Properties; //导入方法依赖的package包/类
@SuppressWarnings("rawtypes")
public void setUpServerVM(boolean cacheServerSslenabled) throws Exception {
  Properties gemFireProps = new Properties();

  String cacheServerSslprotocols = "any";
  String cacheServerSslciphers = "any";
  boolean cacheServerSslRequireAuth = false;
  gemFireProps.put(SERVER_SSL_ENABLED, String.valueOf(cacheServerSslenabled));
  gemFireProps.put(SERVER_SSL_PROTOCOLS, cacheServerSslprotocols);
  gemFireProps.put(SERVER_SSL_CIPHERS, cacheServerSslciphers);
  gemFireProps.put(SERVER_SSL_REQUIRE_AUTHENTICATION, String.valueOf(cacheServerSslRequireAuth));

  String keyStore = TestUtil.getResourcePath(SSLNoClientAuthDUnitTest.class, DEFAULT_STORE);
  String trustStore = TestUtil.getResourcePath(SSLNoClientAuthDUnitTest.class, DEFAULT_STORE);
  gemFireProps.put(SERVER_SSL_KEYSTORE_TYPE, "jks");
  gemFireProps.put(SERVER_SSL_KEYSTORE, keyStore);
  gemFireProps.put(SERVER_SSL_KEYSTORE_PASSWORD, "password");
  gemFireProps.put(SERVER_SSL_TRUSTSTORE, trustStore);
  gemFireProps.put(SERVER_SSL_TRUSTSTORE_PASSWORD, "password");

  StringWriter sw = new StringWriter();
  PrintWriter writer = new PrintWriter(sw);
  gemFireProps.list(writer);
  System.out.println("Starting cacheserver ds with following properties \n" + sw);
  createCache(gemFireProps);

  RegionFactory factory = cache.createRegionFactory(RegionShortcut.REPLICATE);
  Region r = factory.create("serverRegion");
  r.put("serverkey", "servervalue");
}
 
开发者ID:ampool,项目名称:monarch,代码行数:31,代码来源:SSLNoClientAuthDUnitTest.java

示例6: setUpClientVM

import java.util.Properties; //导入方法依赖的package包/类
public void setUpClientVM(String host, int port, boolean cacheServerSslenabled,
    boolean cacheServerSslRequireAuth, String keyStore, String trustStore) {

  Properties gemFireProps = new Properties();

  String cacheServerSslprotocols = "any";
  String cacheServerSslciphers = "any";

  String keyStorePath = TestUtil.getResourcePath(SSLNoClientAuthDUnitTest.class, keyStore);
  String trustStorePath = TestUtil.getResourcePath(SSLNoClientAuthDUnitTest.class, trustStore);
  // using new server-ssl-* properties
  gemFireProps.put(SERVER_SSL_ENABLED, String.valueOf(cacheServerSslenabled));
  gemFireProps.put(SERVER_SSL_PROTOCOLS, cacheServerSslprotocols);
  gemFireProps.put(SERVER_SSL_CIPHERS, cacheServerSslciphers);
  gemFireProps.put(SERVER_SSL_REQUIRE_AUTHENTICATION, String.valueOf(cacheServerSslRequireAuth));

  gemFireProps.put(SERVER_SSL_KEYSTORE_TYPE, "jks");
  gemFireProps.put(SERVER_SSL_KEYSTORE, keyStorePath);
  gemFireProps.put(SERVER_SSL_KEYSTORE_PASSWORD, "password");
  gemFireProps.put(SERVER_SSL_TRUSTSTORE, trustStorePath);
  gemFireProps.put(SERVER_SSL_TRUSTSTORE_PASSWORD, "password");

  StringWriter sw = new StringWriter();
  PrintWriter writer = new PrintWriter(sw);
  gemFireProps.list(writer);
  System.out.println("Starting client ds with following properties \n" + sw.getBuffer());

  ClientCacheFactory clientCacheFactory = new ClientCacheFactory(gemFireProps);
  clientCacheFactory.addPoolServer(host, port);
  clientCache = clientCacheFactory.create();

  ClientRegionFactory<String, String> regionFactory =
      clientCache.createClientRegionFactory(ClientRegionShortcut.PROXY);
  Region<String, String> region = regionFactory.create("serverRegion");
  assertNotNull(region);
}
 
开发者ID:ampool,项目名称:monarch,代码行数:37,代码来源:SSLNoClientAuthDUnitTest.java


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