Package java.util

Examples of java.util.Properties.entrySet()


                is = FileLoader.loadFileAsStream(ALTERNATIVE_SHORTCUTS);
                Properties lproperties = new Properties();

                lproperties.load(is);
                alternateShortcutMap = new HashMap<String, String>();
                for (Entry<Object, Object> entry : lproperties.entrySet()) {
                    alternateShortcutMap.put((String)entry.getKey(), (String)entry.getValue());
                }
            } catch (IOException e) {
                logger.error("Failed to load alternateShortcutMap", e);
                throw new WebApplicationException(e);
View Full Code Here


        private static void override(PersistenceUnitInfo info, String prefix) {

            Properties overrides = ConfigurationFactory.getSystemProperties(prefix, "PersistenceUnit");

            for (Map.Entry<Object, Object> entry : overrides.entrySet()) {
                final String property = (String) (prefix.equalsIgnoreCase(info.name) ? entry.getKey() : prefix + "." + entry.getKey());
                final String value = (String) entry.getValue();

                if (info.properties.containsKey(property)){
                    logger.debug("Overriding persistence-unit "+info.name +" property " + property + "="+value);
View Full Code Here

    private void loadPropertiesDeclaredConfiguration(final Openejb openejb) {

        final Properties sysProps = new Properties(System.getProperties());
        sysProps.putAll(SystemInstance.get().getProperties());

        for (final Map.Entry<Object, Object> entry : sysProps.entrySet()) {

            final Object o = entry.getValue();
            if (!(o instanceof String)) continue;
            if (!((String) o).startsWith("new://")) continue;
View Full Code Here

                    }

                    logger.debug("[" + key + "=" + value + "]");
                }

                for (final Map.Entry<Object, Object> entry : overrides.entrySet()) {
                    final Object key = entry.getKey();
                    Object value = entry.getValue();

                    if (key instanceof String && "password".equalsIgnoreCase((String) key)) {
                        value = "<hidden>";
View Full Code Here

        // Override with system properties
        final String prefix = serviceName + ".";
        final Properties sysProps = new Properties(System.getProperties());
        sysProps.putAll(SystemInstance.get().getProperties());
        for (Iterator iterator1 = sysProps.entrySet().iterator(); iterator1.hasNext();) {
            final Map.Entry entry1 = (Map.Entry) iterator1.next();
            final Object value = entry1.getValue();
            String key = (String) entry1.getKey();
            if (value instanceof String && key.startsWith(prefix)) {
                key = key.replaceFirst(prefix, "");
View Full Code Here

        }
    }

    private static void applyOverrides(final Properties properties) {
        final Properties system = SystemInstance.get().getProperties();
        for (final Map.Entry<Object, Object> entry : system.entrySet()) {
            final String key = entry.getKey().toString();
            if (key.startsWith("log4j.") && !key.equals("log4j.configuration")) {
                properties.put(key, entry.getValue());
            }
        }
View Full Code Here

            InputStream stream = userFile.toURL().openStream();
            Properties tmpUsers = new Properties();
            tmpUsers.load(stream);
            stream.close();

            for (Iterator iterator = tmpUsers.entrySet().iterator(); iterator.hasNext();) {
                Map.Entry entry = (Map.Entry) iterator.next();
                users.put(entry.getValue(), entry.getKey());
            }

            Properties temp = new Properties();
View Full Code Here

            props.load(defaultProfilesFile);
        } finally {
            defaultProfilesFile.close();
        }
        Map<String, ExecutionEnvironmentProfile> profiles = new HashMap<String, ExecutionEnvironmentProfile>();
        for (Entry<Object, Object> prop : props.entrySet()) {
            String propName = (String) prop.getKey();
            if (propName.endsWith(".pkglist")) {
                String profileName = propName.substring(0, propName.length() - 8);
                if (!profiles.containsKey(profileName)) {
                    loadProfile(props, profiles, profileName);
View Full Code Here

                    ByteArrayInputStream is = new ByteArrayInputStream(text.getBytes());
                    Properties p = new Properties();
                    p.load(is);

                    Map result = new MapOfSets(p.size());
                    for (Iterator iterator = p.entrySet().iterator(); iterator.hasNext();) {
                        Map.Entry entry = (Map.Entry) iterator.next();
                        Set values = new HashSet(Arrays.asList(((String) entry.getValue()).split(",")));
                        result.put(entry.getKey(), values);
                    }
                    setValue(result);
View Full Code Here

        Properties properties = new Properties();
        properties.load(propertyStream);
        propertyStream.close();
       
        Iterator<Map.Entry<Object, Object>> keys =
          properties.entrySet().iterator();
        while (keys.hasNext())
        {
          Map.Entry<Object, Object> entry = keys.next();
          String key = (String) entry.getKey();
          String localName = (String) entry.getValue();
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.