path = new Path(Platform.asLocalURL(url).getFile());
  public void addVariable(String variableName, String pluginID) throws JETException  {    try    {      Bundle bundle = Platform.getBundle(pluginID);      String requires = (String)bundle.getHeaders().get(Constants.BUNDLE_CLASSPATH);      ManifestElement[] elements = ManifestElement.parseHeader(Constants.BUNDLE_CLASSPATH, requires);      for (int i = 0; i < elements.length; ++i)      {        ManifestElement element = elements[i];        try        {          IPath path = null;          URL url = Platform.inDevelopmentMode() ? null : bundle.getEntry(element.getValue());          if (url == null)          {            URL classpathURL = bundle.getEntry(".classpath");            if (classpathURL == null)            {              url = bundle.getEntry(element.getValue());            }            else            {              DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();              documentBuilderFactory.setNamespaceAware(true);              documentBuilderFactory.setValidating(false);              try              {                DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();                Document document = documentBuilder.parse(new InputSource(classpathURL.toString()));                for (Node child = document.getDocumentElement().getFirstChild(); child != null; child = child.getNextSibling())                {                  if (child.getNodeType() == Node.ELEMENT_NODE)                  {                    Element classpathEntryElement = (Element)child;                    if ("classpathentry".equals(classpathEntryElement.getNodeName()) &&                        "output".equals(classpathEntryElement.getAttribute("kind")))                    {                      URI uri = URI.createURI(classpathEntryElement.getAttribute("path")).resolve(URI.createURI(classpathURL.toString()));                      IWorkspace workspace = ResourcesPlugin.getWorkspace();                      IProject project = workspace.getRoot().getProject(getProjectName());                      if (!project.exists())                      {                        project.create(new NullProgressMonitor());                      }                      if (!project.isOpen())                      {                        project.open(new NullProgressMonitor());                      }                      IFolder folder = project.getFolder("." + pluginID);                      if (!folder.exists())                      {                        folder.createLink                          (new Path(CommonPlugin.asLocalURI(uri).toFileString()).removeTrailingSeparator(),                           IResource.ALLOW_MISSING_LOCAL,                            new NullProgressMonitor());                      }                      folder.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());                      path = folder.getFullPath();                                            break;                    }                  }                }              }              catch (Exception exception)              {                CodeGenPlugin.INSTANCE.log(exception);              }            }          }          else          {            path = new Path(Platform.asLocalURL(url).getFile());          }           if (path != null && !path.equals(JavaCore.getClasspathVariable(variableName)))          {            JavaCore.setClasspathVariable(variableName, path, null);          }        }        catch (MalformedURLException exception)        {          throw new JETException(exception);        }        catch (JavaModelException exception)        {          throw new JETException(exception);        }         catch (IOException exception)        {          throw new JETException(exception);        }        break;      }    }    catch (BundleException exception)    {      throw new JETException(exception);    }    IClasspathEntry entry = JavaCore.newVariableEntry(new Path(variableName), null, null);    getClasspathEntries().add(entry);  }