In a JSP project I am reading a file from directory. If i give the full path then i can easily read the file
BufferedReader br = new BufferedReader(new FileReader("C:\\ProjectFolderName\\files\\BB.key"));
but i don't want to write the full path instead i just want to give the folder name which contains the file, like bellow.
BufferedReader br = new BufferedReader(new FileReader("\\files\\BB.key"));
How to do this?
String currentDirectory = new File("").getAbsolutePath();
System.out.println(currentDirectory);
BufferedReader br = new BufferedReader(new FileReader(currentDirectory + "\\files\\BB.key"));
I tried the above still cant read from file
the print line gives the following output
INFO: C:\Program Files\NetBeans 7.3