Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can an Eclipse plugin access the project directory?

Is there a way to get the directory of a project in Eclipse? We are writing a plugin that will allow the user to select files, and then run some processes on those files. I would ideally like to be able to get all the files with a certain extension, but that is not necessary.

like image 446
Milhous Avatar asked Oct 28 '08 02:10

Milhous


1 Answers

sure:

ResourcesPlugin.getWorkspace().getRoot().getProjects()

will get you a list of all the projects in the workspace. you can easily iterate to find the one you want. At that point, you can look for certain files by extensions, etc.

like image 166
AdamC Avatar answered Oct 07 '22 11:10

AdamC