I have thousands of xml files in different sub directories under one root folder. My requirement is to search for a text in all these xml files irrespective of their location in the xml file.
Currently I am using BufferedReader class to read these xml files (my code looks like below)
while ((currentLine = br.readLine()) != null) {
if (currentLine.contains("myTargetString")) {
temp = currentLine;
myArraylist.add(temp );
}
But I know that there should some best way to search through these xml files, but cant figure out the best API or way.
I get one string as an input and my program should be able to search through all the xml files and return the file names. By using this BufferedReader it is taking much time.
Any ideas would be helpful.