package com.frascu.bot.newsbot.telegram;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;
import org.apache.log4j.Logger;

public class BotConfig {

	private static final Logger LOGGER = Logger.getLogger(BotConfig.class);

	private static Properties prop;

	static { // load a properties file
		prop = new Properties();
		try {
			prop.load(new FileInputStream("config.properties"));
		} catch (IOException e) {
			LOGGER.error("Reading parameters from configuration file.", e);
		}
	}

	public static final String TOKEN = prop.getProperty("token");
	public static final String ADMIN = prop.getProperty("admin");
	public static final String NAME = prop.getProperty("name");

	private BotConfig() {
		super();
	}
}

@@ -37,16 +37,38 @@
 ram;%0D%0A%0D%0A
+import java.io.File;%0D%0A
 import j
@@ -397,67 +397,227 @@
 %0D%0A%09%09
-try %7B%0D%0A%09%09%09prop.load(new FileInputStream(%22config.properties%22
+File file = new File(%22config.properties%22);%0D%0A%09%09try %7B%0D%0A%09%09%09file = new File(%22config.properties%22);%0D%0A%09%09%09prop.load(new FileInputStream(file));%0D%0A%09%09%09LOGGER.info(%22Properties read from configuration file: %22 + file.getAbsolutePath(
 ));%0D
@@ -667,32 +667,56 @@
 or(%22
-Reading parameter
+Error!!! Impossible to read propertie
 s from 
+the 
 conf
@@ -733,13 +733,59 @@
 file
-.%22, e
+: %22 + file.getAbsolutePath(), e);%0D%0A%09%09%09System.exit(0
 );%0D%0A

handle the error if the file does not exist