use of org.eclipse.linuxtools.internal.rpm.core.SpecfileVisitor in project linuxtools by eclipse.
the class RPMProject method getSpecFile.
/**
* Returns the .spec file of this project.
*
* @return The .spec file or null if one is not found.
*/
public IResource getSpecFile() {
IContainer specsFolder = getConfiguration().getSpecsFolder();
IResource file = null;
SpecfileVisitor specVisitor = new SpecfileVisitor();
try {
specsFolder.accept(specVisitor);
List<IResource> installedSpecs = specVisitor.getSpecFiles();
if (installedSpecs.size() > 0) {
file = installedSpecs.get(0);
}
} catch (CoreException e) {
// ignore, failed to find .spec file.
}
return file;
}
Aggregations