Java file address during processing of contents
I am passing in directory into java and it will search for few keywords in each file. Then i want to output the keyword with the file it came from. Is there a method that i can call after reading input from a str开发者_运维技巧ing and comparing it to know from which file it is?
The question is not very clear, but FileUtils in Commons IO has some methods that make reading the text from files trivial. Look at the lineIterator(...) and the readLines(...) methods.
精彩评论