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

com.trimble.id.PropertiesFileReader Maven / Gradle / Ivy

Go to download

Trimble Identity OAuth Client library holds the client classes that are used for communicating with Trimble Identity Service

The newest version!
package com.trimble.id;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;

public class PropertiesFileReader {

	private static Logger LOGGER = Logger.getLogger(PropertiesFileReader.class.getName());

	private static Properties properties = new Properties();

	static {

		InputStream inputStream = null;

		try {
			inputStream = PropertiesFileReader.class.getClassLoader().getResourceAsStream("sdk.properties");
			properties.load(inputStream);

		} catch (IOException ex) {
			LOGGER.log(Level.FINER, ex.getMessage(), ex);
			throw new SDKClientException(ex, ex.getCause(), ex.getMessage());

		} finally {
			if (inputStream != null) {
				try {
					inputStream.close();

				} catch (IOException ex) {
					LOGGER.log(Level.FINER, ex.getMessage(), ex);
				}
			}
		}
	}

	public static String getPropertyValue(String key) {
		return getProperties().getProperty(key);
	}

	public static Properties getProperties() {
		return properties;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy