I'm trying to write code that checks whether the Acrobat xx.x folder is present on a user's PC, where xx.x
represents a potential Acrobat version number, such as Acrobat 10.0 or Acrobat 11.1. Meaning I do not know what xx.x will be. The answer found here seems to assume I know what value the wildcard takes, but I don't in my case.
The purpose is to eventually write .js files into the directory ...\Program Files\Adobe\Acrobat xx.x\Acrobat\Javascripts
So far I identify whether 32/64-bit OS is installed and set the Program Files path into progFiles
. Assuming that Adobe is installed, I then need to use this path in order to determine whether Acrobat xx.x is a subfolder such as:
folderToFind = new File(progFiles + "\\Adobe\\"+"\\Acrobat 11.1");
where 11.1
may take the form of any number from 0.1 to 99.9. I then can identify its existence with:
if (folderToFind.exists())
{
System.out.println("Acrobat folder found");
}
An obvious approach is to create a loop, checking whether each and every possibility exists. This seems redundant and unnecessary. I'm hoping there's a more efficient approach such as:
if (progFiles + "\\Adobe\\"+"\\Acrobat **.*\\Acrobat\\Javascripts".exists()){
// ...
}
Any ideas? Thank you