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

de.rwh.utils.jetty.PropertiesReader Maven / Gradle / Ivy

Go to download

Utility library for running an embedded Jetty with service provider based initialization of Spring and Jersey

The newest version!
package de.rwh.utils.jetty;

import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Properties;

public final class PropertiesReader
{
	private PropertiesReader()
	{
	}

	public static Properties read(Path propertiesFile, Charset encoding)
	{
		Properties properties = new Properties();

		try (Reader reader = new InputStreamReader(Files.newInputStream(propertiesFile), encoding))
		{
			properties.load(reader);
		}
		catch (IOException e)
		{
			throw new RuntimeException(e);
		}

		return properties;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy