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

io.castle.client.internal.config.PropertiesReader Maven / Gradle / Ivy

Go to download

Castle adds real-time monitoring of your authentication stack, instantly notifying you and your users on potential account hijacks.

There is a newer version: 2.4.2
Show newest version
package io.castle.client.internal.config;

import javax.annotation.Nonnull;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class PropertiesReader {

    public Properties loadPropertiesFromStream(Properties loaded, @Nonnull InputStream resourceAsStream) {

        try (final InputStream streamFromFile = resourceAsStream) {
            loaded.load(streamFromFile);
        } catch (IOException e) {
            //OK, no file configuration, create a empty new properties just for security against side effects of the
            // failed load operation
            return new Properties();
        }
        return loaded;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy