code to refactor auto-imports in a given java file [on hold]

We have two selenium frameworks. I wanted to migrate the old framework into the new one. The imports location have been changed in the new framework. I have been given a task to refactor all the auto-imports in the all .java files present inside a folder. The code should be able to fetch the class and the path from the library in the new framework. Any recommendations ?? Is there an Eclipse API to do refactor the Auto-Imports in many java files. i cant manually go and press ctrl+shift+O inside all the .java files.