I would like to add the path instead of the file name in BufferedReader? I want to use the path because I want the code to pickup any file that has the name "audit" in that specific folder.
So I am currently using this method below, but it only works when I add the absolute path.
`
public static void main(String[] args)
throws IOException {
List<String> stngFile = new ArrayList<String>();
BufferedReader bfredr = new BufferedReader(new FileReader
("file path"));
String text = bfredr.readLine();
while (text != null) {
stngFile.add(text);
text = bfredr.readLine();
}
bfredr.close();
String[] array = stngFile.toArray(new String[0]);
Arrays.toString(array);
for (String eachstring : array) {
System.out.println(eachstring);
}
}
`
I am new to programming any help is much appreciated. Thanks in advance.