package com.tcl.customerapi;

import androidx.annotation.NonNull;

import java.io.File;
import java.io.FileInputStream;
import java.util.Properties;

public class MyPropterties {

	
	private String mName ;
	Properties properties;
	public MyPropterties(@NonNull String name){
	    mName = name ;
	    properties = new Properties();
	    init();
	}
	private void init(){
	    FileInputStream inputStream =null;
	    try {
	        inputStream = new FileInputStream(new File(mName));
	        properties.load(inputStream);
	    }catch (Exception e){
	        e.printStackTrace();
	    }finally {
	        if(inputStream!=null){
	            try {
	                inputStream.close();
	            }catch (Exception e){
	                e.printStackTrace();
	            }
	        }
	    }
	}
	public String getProperty(String key) {
	    return properties.getProperty(key);
	}
	public String getProperty(String key, String defaultValue) {
	    return properties.getProperty(key,defaultValue);
	}
}
