private IPath createRelativePath(IPath location,IResource resource){
  if (relativeVariable == null)   return location;
  if (relativeVariable.equals(ABSOLUTE_PATH))   return location;
  IPathVariableManager pathVariableManager=resource.getPathVariableManager();
  try {
    return URIUtil.toPath(pathVariableManager.convertToRelative(URIUtil.toURI(location),true,relativeVariable));
  }
 catch (  CoreException e) {
    return location;
  }
}

private IPath createRelativePath ( IPath location , IResource resource ) { if ( relativeVariable == null ) return location ; if ( relativeVariable . equals ( ABSOLUTE_PATH ) ) return location ; IPathVariableManager pathVariableManager = resource . getPathVariableManager ( ) ; try { return URIUtil . toPath ( pathVariableManager . convertToRelative ( URIUtil . toURI ( location ) , true , relativeVariable ) ) ; } catch ( CoreException e ) { return location ; } }
transform an absolute path uri to a relative path one ( i . e . from " c : \ foo \ bar \ file . txt " to " var \ file . txt " granted that the relativevariable is " var " and points to " c : \ foo \ bar \ " ) .
