drools-eclipse/org.guvnor.tools/src/org/guvnor/tools/utils/GuvnorMetadataUtils.java
public static IFile findGuvnorMetadata(IPath resource) {
        IFile res = null;
        IPath dir = resource.removeLastSegments(1);
        IPath mdpath = dir.append(".guvnorinfo").append("." + resource.lastSegment()); //$NON-NLS-1$ //$NON-NLS-2$
        IResource mdResource = Activator.getDefault().getWorkspace().
                                            getRoot().findMember(mdpath);
        if (mdResource != null
           && mdResource.exists()
           && mdResource instanceof IFile) {
            res = (IFile)mdResource;
        }
        return res;
    }
public static IFile findGuvnorMetadata(IPath resource) {
        IFile res = null;
        IPath dir = resource.removeLastSegments(1);
        IPath mdpath = dir.append(".guvnorinfo").append("." + resource.lastSegment()); //$NON-NLS-1$ //$NON-NLS-2$
        IResource mdResource = Activator.getDefault().getWorkspace().
                                            getRoot().findMember(mdpath);
        if (mdResource != null
           && mdResource.exists()
           && mdResource instanceof IFile) {
            res = (IFile)mdResource;
        }
        return res;
    }
Finds the local Guvnor metadata file associated with a given resource.
@param resource The resource path to locate metadata for.
@return The metadata file for the given resource, null if metadata is not found.