All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.stormpath.sdk.impl.config.OptionalPropertiesSource Maven / Gradle / Ivy

Go to download

The Stormpath Java SDK core implemenation .jar is used at runtime to support API invocations. This implementation jar should be a runtime dependency only and should NOT be depended on at compile time by your code. The implementations within this jar can change at any time without warning - use it with runtime scope only.

There is a newer version: 2.0.4-okta
Show newest version
package com.stormpath.sdk.impl.config;

import com.stormpath.sdk.lang.Assert;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.LinkedHashMap;
import java.util.Map;

public class OptionalPropertiesSource implements PropertiesSource {

    private static final Logger log = LoggerFactory.getLogger(OptionalPropertiesSource.class);

    private final PropertiesSource propertiesSource;

    public OptionalPropertiesSource(PropertiesSource source) {
        Assert.notNull(source, "source cannot be null.");
        this.propertiesSource = source;
    }

    @Override
    public Map getProperties() {
        try {
            return propertiesSource.getProperties();
        } catch (Exception e) {
            log.debug("Unable to obtain properties from optional properties source {}", propertiesSource);
        }
        return new LinkedHashMap();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy