package com.example.bot.spring;

import java.util.Arrays;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.IOException;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class DatabaseEngine {
	String search(String text) throws Exception {
		String result = null;
		BufferedReader br = null;
		FileReader fr = null;
		InputStreamReader isr = null;
		try {
			//fr = new FileReader(KitchenSinkController.createUri(dbFile));
//			fr = new FileReader(FILENAME);
//   		    br = new BufferedReader(fr);
			isr = new InputStreamReader(
                    this.getClass().getResourceAsStream(FILENAME));
			br = new BufferedReader(isr);
			String sCurrentLine;
			
			while (result != null && (sCurrentLine = br.readLine()) != null) {
				String[] parts = sCurrentLine.split(":");
				if (text.toLowerCase().equals(parts[0].toLowerCase())) {
					result = parts[1];
				}
			}
		} catch (IOException e) {
			log.info("IOException while reading file: {}", e.toString());
		} finally {
			try {
				if (br != null)
					br.close();
				if (isr != null)
					isr.close();
			} catch (IOException ex) {
				log.info("IOException while closing file: {}", ex.toString());
			}
		}
		if (result != null)
			return result;
		throw new Exception("NOT FOUND");
    }
	
	DatabaseEngine() {
		 //Resource resource = resourceLoader.getResource("classpath:" + FILENAME);
		 
	}

	private final String FILENAME = "/static/database.txt";

}
@@ -940,16 +940,48 @@
 ts%5B1%5D;%0D%0A
+%09%09%09%09%09log.info(%22Result Found%22);%0D%0A
 %09%09%09%09%7D%0D%0A%09
@@ -1337,16 +1337,49 @@
 esult;%0D%0A
+%09%09log.info(%22Result Not Found%22);%0D%0A
 %09%09throw 

test again