Package java.util

Examples of java.util.Properties.propertyNames()


                   
                    Properties props = new Properties();
                    fin = new FileInputStream(file);
                    props.load(fin);
                   
                    Enumeration names = props.propertyNames();
                    while(names.hasMoreElements()) {
                        String name =(String)names.nextElement();
                        properties.put(name, props.getProperty(name));
                    }
                }
View Full Code Here


    if(reseedOnStartup) {
      Properties sys = System.getProperties();
      EntropySource startupEntropy = new EntropySource();

      // Consume the system properties list
      for(Enumeration<?> enu = sys.propertyNames(); enu.hasMoreElements();) {
        String key = (String) enu.nextElement();
        consumeString(key);
        consumeString(sys.getProperty(key));
      }
View Full Code Here

        InputStream in = null;
        Properties props = new Properties();
        try {
            in = LogMessageLoader.class.getClassLoader().getResourceAsStream(Constants.LOG_MESSAGE_FILE);
            props.load(in);
            Enumeration<?> keys = props.propertyNames();
            while (keys.hasMoreElements()) {
                String key = (String) keys.nextElement();
                if (key.endsWith(LEVEL_KEY_END)) {
                    String messageId = LogMessageLoader.getMessageId(key, LEVEL_KEY_END);
                    manager.putLevel(messageId, props.getProperty(key));
View Full Code Here

  SuiteXmlNodeWriter writeSuiteProperties(XmlNode target, JUnitTest suite) {
    XmlNode propertiesNode = target.addNewNode(PROPERTIES);
    Properties properties = suite.getProperties();
    if (properties == null) return this;
    Enumeration<?> propertyNames = properties.propertyNames();
    while (propertyNames.hasMoreElements())
      writeProperty(propertiesNode, properties, (String)propertyNames.nextElement());
    return this;
  }
View Full Code Here

    Properties props = new Properties();
    try {
      InputStream in = ResourcesPlugin.getWorkspace().getRoot()
          .getFile(classFile).getContents();
      props.load(in);
      Enumeration en = props.propertyNames();
      while (en.hasMoreElements()) {
        String key = (String) en.nextElement();
        propList.add(new PropertyItem(key, props.getProperty(key)));
      }
    } catch (Exception e) {
View Full Code Here

   * effect on deadlock detection.  -tjb@sun.com (11/05/2007)
   */
   config.setLockTimeout(lockTimeoutMicros);
  config.setTransactional(true);
  config.setTxnWriteNoSync(!flushToDisk);
  for (Enumeration<?> names = propertiesWithDefaults.propertyNames();
       names.hasMoreElements(); )
  {
      Object key = names.nextElement();
      if (key instanceof String) {
    String property = (String) key;
View Full Code Here

            for (Map.Entry<String, String> entry : commandLineAttributes.entrySet()) {
                properties.setProperty(entry.getKey(), entry.getValue());
            }

            Enumeration propertyNames= properties.propertyNames();
            while (propertyNames.hasMoreElements()) {
                String property = (String) propertyNames.nextElement();
                bind(String.class).annotatedWith(Names.named(property)).toInstance(properties.getProperty(property));
            }
        } catch (IOException e) {
View Full Code Here

    {
        Properties systemProperties = System.getProperties();

        if ( systemProperties != null )
        {
            Enumeration propertyKeys = systemProperties.propertyNames();

            while ( propertyKeys.hasMoreElements() )
            {
                String key = (String) propertyKeys.nextElement();
View Full Code Here

        Properties systemProperties = System.getProperties();

        if ( systemProperties != null )
        {
            Enumeration<?> propertyKeys = systemProperties.propertyNames();

            while ( propertyKeys.hasMoreElements() )
            {
                String key = (String) propertyKeys.nextElement();
View Full Code Here

            properties.load(is);
          }
      }
     
      // Set system properties only if not already specified.
      Enumeration _enum = properties.propertyNames();
      while (_enum.hasMoreElements()) {
        String name = (String)_enum.nextElement();
        if (System.getProperty(name) == null) {
          System.setProperty(name, properties.getProperty(name));
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.