I load some files from a folder which have names file 1.pdf
, file 2.pdf
etc
I want to load them all to my program. If I new the total number of them, I would do sth like:
for(int i=1; i<=100; i++){
File pdfFile = new File("file "+i+".pdf");
//...
}
But I don't know the total number.. What would be the condition so when there is no other file, then exit ?
do{
File pdfFile = new File("file "+i+".pdf");
//...
}while(//there are files...)