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

com.usmanhussain.sonora.ApplicationProperties Maven / Gradle / Ivy

Go to download

com.usmanhussain.sonora - Sonora allows accessibility and compatibility requirements to be automated within a DevOps, Agile or Waterfall (unfortunately) platform. Running inline with Selenium and Cucumber frameworks

The newest version!
package com.usmanhussain.sonora;

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

public class ApplicationProperties {

	Properties properties;

	public ApplicationProperties(String fileName) throws IOException {
		this.properties = readFile(fileName);
	}

	public Properties readFile(String fileName) {
		Properties properties = new Properties();
		try {
			InputStream inputStream = getClass().getClassLoader().getResourceAsStream(fileName);
			if (inputStream != null) {
				properties.load(inputStream);
			}
			inputStream.close();
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return properties;
	}

	public String getProperty(String property) {
		return this.properties.getProperty(property);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy