Package org.switchyard.common.io.pull

Examples of org.switchyard.common.io.pull.PropertiesPuller


        if (location.startsWith("classpath:")) {
            location = location.replaceFirst("classpath:", "");
        } else if (location.startsWith("file:")) {
            location = location.replaceFirst("file:", "");
        }
        Properties userGroups = new PropertiesPuller().pullPath(location, PathType.values());
        init(userGroups);
    }
View Full Code Here


            urls = Classes.getResources("/org/switchyard/common/io/resource/resourceType.properties", loader);
        } catch (Throwable t) {
            LOGGER.fatal(t.getMessage());
            urls = Collections.emptyList();
        }
        PropertiesPuller props_puller = new PropertiesPuller();
        for (URL url : urls) {
            try {
                Properties props = props_puller.pull(url);
                for (Object key : props.keySet()) {
                    String name = (String)key;
                    StringTokenizer st = new StringTokenizer(props.getProperty(name), "|");
                    String description = st.hasMoreTokens() ? Strings.trimToNull(st.nextToken()) : null;
                    Set<String> extensions = st.hasMoreTokens() ? Strings.uniqueSplitTrimToNull(st.nextToken(), ",") : null;
View Full Code Here

    /**
     * Creates a new PrivateCrypto with the specified map.
     * @param map the map
     */
    public PrivateCrypto(Map<String, String> map) {
        this(new PropertiesPuller().pull(map));
    }
View Full Code Here

    }

    private Properties getRolesProperties() {
        String rolesPropertiesFile = getOption("rolesProperties", false);
        if (rolesPropertiesFile != null) {
            return new PropertiesPuller().pullPath(rolesPropertiesFile, getClass(), PathType.values());
        }
        return null;
    }
View Full Code Here

    /**
     * Creates a new PublicCrypto with the specified map.
     * @param map the map
     */
    public PublicCrypto(Map<String, String> map) {
        this(new PropertiesPuller().pull(map));
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    @Override
    public Descriptor pull(InputStream stream) throws IOException {
        return pull(new PropertiesPuller().pull(stream));
    }
View Full Code Here

     * @param reader a Reader of the resource
     * @return the resource, or null if not found
     * @throws IOException if a problem occurred
     */
    public Descriptor pull(Reader reader) throws IOException {
        return pull(new PropertiesPuller().pull(reader));
    }
View Full Code Here

    private void loadProperies() {
        _loadProperties = null;
        String propsPath = getLoad();
        if (propsPath != null) {
            PropertiesType propsType = propsPath.endsWith(".xml") ? PropertiesType.XML : PropertiesType.PROPERTIES;
            PropertiesPuller propsPuller = new PropertiesPuller(propsType);
            Properties props = propsPuller.pullPath(propsPath, getClass(), PathType.values());
            if (props != null) {
                _loadProperties = props;
            }
        }
    }
View Full Code Here

     * Adds discovered default properties using the specified classloader.
     * @param loader the classloader to use to look up the default properties
     */
    public void addDefaultProperties(ClassLoader loader) {
        Properties props = new Properties();
        PropertiesPuller props_puller = new PropertiesPuller();
        try {
            List<URL> urls = Classes.getResources(DEFAULT_PROPERTIES, loader);
            for (URL url : urls) {
                Properties url_props = props_puller.pull(url);
                Enumeration<?> pn_enum = url_props.propertyNames();
                while (pn_enum.hasMoreElements()) {
                    String pn = (String)pn_enum.nextElement();
                    props.setProperty(pn, url_props.getProperty(pn));
                }
View Full Code Here

TOP

Related Classes of org.switchyard.common.io.pull.PropertiesPuller

Copyright © 2018 www.massapicom. 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.