Suppose I have a program running throughout the text. The text is backed up to the project by the .txt file, but I need this program to go through not one text but a bunch of different ones. Is it possible to create a folder in which there will be a bunch of different texts in pdf format or something else and that the program would understand that new texts appeared there and read them too? Tell me how to implement this and how best to do it.
|
1 answer
If you want to be notified of changes to files in a folder, you can use WatchService ( tutorial ).
If you want to enable the user to select multiple files for processing, then you can use FileDialog or JFileChooser in the multiple file selection mode.
For reading PDF there are several libraries, choose to your taste. The same applies to other file formats.
|