public static IPath getFilterPath(String filePath, IProject project) {
        IPath path = new Path(filePath);
        if (path.isAbsolute()) {
            return path;
        }
        if (project != null) {
            // try first project relative location
            IPath newPath = project.getLocation().append(path);
            if (newPath.toFile().exists()) {
                return newPath;
            }
        }

        // try to resolve relative to workspace (if we use workspace properties
        // for project)
        IPath wspLocation = ResourcesPlugin.getWorkspace().getRoot().getLocation();
        IPath newPath = wspLocation.append(path);
        if (newPath.toFile().exists()) {
            return newPath;
        }

        // something which we have no idea what it can be (or missing/wrong file
        // path)
        return path;
    }
public static IPath getFilterPath ( String filePath , IProject project ) { IPath path = new Path ( filePath ) ; if ( path . isAbsolute ( ) ) { return path ; } if ( project != null ) { IPath newPath = project . getLocation ( ) . append ( path ) ; if ( newPath . toFile ( ) . exists ( ) ) { return newPath ; } } IPath wspLocation = ResourcesPlugin . getWorkspace ( ) . getRoot ( ) . getLocation ( ) ; IPath newPath = wspLocation . append ( path ) ; if ( newPath . toFile ( ) . exists ( ) ) { return newPath ; } return path ; }
Checks the given path and convert it to absolute path if it is specified
relative to the given project or workspace

@param filePath
project relative OR workspace relative OR absolute OS file
path (1.3.8+ version)
@param project
might be null (only for workspace relative or absolute paths)
@return absolute path which matches given relative or absolute path,
never null