public void applyProperties(Swarm swarm) throws IOException {
        URL propsUrl = get(PROPERTIES_URL);

        if (propsUrl != null) {
            Properties urlProps = new Properties();
            urlProps.load(propsUrl.openStream());

            for (String name : urlProps.stringPropertyNames()) {
                swarm.withProperty(name, urlProps.getProperty(name));
            }
        }

        Properties props = get(PROPERTY);

        for (String name : props.stringPropertyNames()) {
            swarm.withProperty(name, props.getProperty(name));
        }

        if (get(BIND) != null) {
            swarm.withProperty(SwarmProperties.BIND_ADDRESS, get(BIND));
        }

    }
public void applyProperties ( Swarm swarm ) throws IOException { URL propsUrl = get ( PROPERTIES_URL ) ; if ( propsUrl != null ) { Properties urlProps = new Properties ( ) ; urlProps . load ( propsUrl . openStream ( ) ) ; for ( String name : urlProps . stringPropertyNames ( ) ) { swarm . withProperty ( name , urlProps . getProperty ( name ) ) ; } } Properties props = get ( PROPERTY ) ; for ( String name : props . stringPropertyNames ( ) ) { swarm . withProperty ( name , props . getProperty ( name ) ) ; } if ( get ( BIND ) != null ) { swarm . withProperty ( SwarmProperties . BIND_ADDRESS , get ( BIND ) ) ; } }
Apply properties to the system properties.

<p>Applies values stored through the <code>Key.PROPERTIES</code>,
<code>Key.PROPERTIES_URL</code> or <code>Key.BIND</code> options.

@throws IOException If a URL is attempted to be read and fails.