package com.orange.csr;

import java.io.*;
import java.util.EnumSet;
import java.util.Properties;

/**
 * Created by DTBR6182 on 2015-08-28.
 */
public class readProperty {
    public static void main(String[] args) {
        Properties prop = null;
        InputStream input = null;

        try {
            prop = new Properties();
            String filename = "config.properties";
            input = readProperty.class.getClassLoader().getResourceAsStream( filename );
            if(input==null){
                System.out.println("Sorry, unable to find " + filename);
                return;
            }

            //load a properties file from class path, inside static method
            prop.load(input);

            //get the property value and print it out
            System.out.println(prop.getProperty("BROWSER"));


        } catch (IOException ex) {
            ex.printStackTrace();
        } finally{
            if(input!=null){
                try {
                    input.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }

    }
}
