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

io.polaris.core.env.InternalProperties Maven / Gradle / Ivy

There is a newer version: 3.2.1
Show newest version
package io.polaris.core.env;

import java.io.InputStream;
import java.util.Properties;

import lombok.Getter;

/**
 * @author Qt
 * @since 1.8,  Apr 23, 2024
 */
class InternalProperties {
	public static final String INTERNAL_PROPERTIES_PATH = "META-INF/polaris/internal.properties";
	public static final InternalProperties INSTANCE = new InternalProperties();
	@Getter
	private Properties properties = new Properties();

	private InternalProperties() {
		try (InputStream in = InternalProperties.class.getClassLoader()
			.getResourceAsStream(INTERNAL_PROPERTIES_PATH)) {
			if (in != null) {
				properties.load(in);
			}
		} catch (Exception ignore) {
		}
	}

	public String getProperty(String key) {
		return properties.getProperty(key);
	}

	public String getProperty(String key, String defaultValue) {
		return properties.getProperty(key, defaultValue);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy