package in.gov.digilocker.uidai.services.properties;

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

import org.springframework.stereotype.Service;

@Service
public class UIDAIProps {
	private String uidaiCertPath;
	private String uidaiServiceUrl;
	private String uidaiPIDVer;
	private String encodingType;
	
	
	public UIDAIProps() {
		Properties uidaiProp = new java.util.Properties();		
	    try {
	      InputStream uidaiInputStream = getClass().getClassLoader().getResourceAsStream("uidai-services.properties");
	      uidaiProp.load(uidaiInputStream);
	    }catch (Exception e) {
	      throw new RuntimeException(e.getMessage());
	    }
	    this.uidaiCertPath= uidaiProp.getProperty("uidai.cer.file.path");
	    this.uidaiServiceUrl= uidaiProp.getProperty("uidai.service.url");
	    this.uidaiPIDVer= uidaiProp.getProperty("uidai.api.pid.ver");
	    this.encodingType= uidaiProp.getProperty("uidai.data.encoding.type");
	}
	
	public String getUidaiCertPath() {
		return uidaiCertPath;
	}
	
	public String getUidaiServiceUrl() {
		return uidaiServiceUrl;
	}

	public String getUidaiPIDVer() {
		return uidaiPIDVer;
	}

	public String getEncodingType() {
		return encodingType;
	}	
}