* @return the found filter or null
* @throws CoreException
*/
public static Filter loadFilter(final IProject project) throws CoreException {
FilterLocator filterLocator = Activator.getDefault().getFilterLocator();
IPath filterPath = findFilterPath(project);
if (filterPath == null) {
return null;
}
IFile filterFile = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(filterPath);
Filter filter = null;
if (filterFile != null && filterFile.exists()) {
InputStream contents = filterFile.getContents();
try {
filter = filterLocator.loadFilter(contents);
} catch (IOException e) {
throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID,
"Failed loading filter file for project " + project.getName()
+ " from location " + filterFile, e));
} finally {