コード例 #1
0
 /*
  * Create a link file in the links folder. Point it to the given extension location.
  */
 public void createLinkFile(String message, String filename, String extensionLocation) {
   File file = new File(output, getRootFolder() + "links/" + filename + ".link");
   file.getParentFile().mkdirs();
   Properties properties = new Properties();
   properties.put("path", extensionLocation);
   OutputStream stream = null;
   try {
     stream = new BufferedOutputStream(new FileOutputStream(file));
     properties.store(stream, null);
   } catch (IOException e) {
     fail(message, e);
   } finally {
     try {
       if (stream != null) stream.close();
     } catch (IOException e) {
       // ignore
     }
   }
 }
コード例 #2
0
 /** Sets the URL of the file to be imported (optional). */
 public void setSourceURL(String urlString) throws MalformedURLException {
   // ensure it is a valid absolute URL
   if (new URL(urlString).getProtocol() == null)
     throw new MalformedURLException(NLS.bind("Expected an absolute URI: {0}", urlString));
   props.put(KEY_SOURCE_URL, urlString);
 }
コード例 #3
0
 private void setTransferred(int transferred) {
   props.put(KEY_TRANSFERRED, Integer.toString(transferred));
 }
コード例 #4
0
 /** Sets the path of the file in the workspace once the import completes. */
 public void setPath(IPath path) {
   props.put(KEY_PATH, path.toString());
 }
コード例 #5
0
 public void setOptions(String options) {
   props.put(KEY_OPTIONS, options == null ? "" : options); // $NON-NLS-1$
 }
コード例 #6
0
 /** Sets the total length of the file being imported. */
 public void setLength(long length) {
   props.put(KEY_LENGTH, Long.toString(length));
 }
コード例 #7
0
 public void setFileName(String name) {
   props.put(KEY_FILE_NAME, name == null ? "" : name); // $NON-NLS-1$
 }
コード例 #8
0
  private void saveConfigurationFile(ILaunchConfiguration configuration) throws CoreException {
    Properties properties = new Properties();
    properties.setProperty(
        "osgi.install.area", "file:" + TargetPlatform.getLocation()); // $NON-NLS-1$ //$NON-NLS-2$
    properties.setProperty("osgi.configuration.cascaded", "false"); // $NON-NLS-1$ //$NON-NLS-2$
    properties.put(
        "osgi.framework",
        LaunchConfigurationHelper.getBundleURL(
            IPDEBuildConstants.BUNDLE_OSGI, fAllBundles, false)); // $NON-NLS-1$
    int start = configuration.getAttribute(IPDELauncherConstants.DEFAULT_START_LEVEL, 4);
    properties.put("osgi.bundles.defaultStartLevel", Integer.toString(start)); // $NON-NLS-1$
    boolean autostart = configuration.getAttribute(IPDELauncherConstants.DEFAULT_AUTO_START, true);

    String bundles = null;
    if (fAllBundles.containsKey(IPDEBuildConstants.BUNDLE_SIMPLE_CONFIGURATOR)) {

      // If update configurator is set to its default start level, override it as simple/update
      // configurators should not be autostarted together
      Object updateConfiguratorBundle =
          fAllBundles.get(IPDEBuildConstants.BUNDLE_UPDATE_CONFIGURATOR);
      if (updateConfiguratorBundle != null) {
        String startLevel = (String) fModels.get(updateConfiguratorBundle);
        if (startLevel != null
            && startLevel.equals(BundleLauncherHelper.DEFAULT_UPDATE_CONFIGURATOR_START_LEVEL)) {
          fModels.put(updateConfiguratorBundle, "4:false"); // $NON-NLS-1$
        }
      }

      // If simple configurator is being used, we need to write out the bundles.txt instead of
      // writing out the list in the config.ini
      URL bundlesTxt =
          P2Utils.writeBundlesTxt(fModels, start, autostart, getConfigDir(configuration), null);
      if (bundlesTxt != null) {
        properties.setProperty(
            "org.eclipse.equinox.simpleconfigurator.configUrl",
            bundlesTxt.toString()); // $NON-NLS-1$
        if (fAllBundles.get(IPDEBuildConstants.BUNDLE_UPDATE_CONFIGURATOR) != null) {
          properties.setProperty(
              "org.eclipse.update.reconcile", "false"); // $NON-NLS-1$ //$NON-NLS-2$
        }
      }
      StringBuffer buffer = new StringBuffer();
      IMonitorModelBase model =
          (IMonitorModelBase) fAllBundles.get(IPDEBuildConstants.BUNDLE_SIMPLE_CONFIGURATOR);
      buffer.append(LaunchConfigurationHelper.getBundleURL(model, true));
      appendStartData(buffer, (String) fModels.get(model), autostart);
      bundles = buffer.toString();
    } else {
      bundles = getBundles(autostart);
    }
    if (bundles.length() > 0) properties.put("osgi.bundles", bundles); // $NON-NLS-1$

    if (!"3.3"
        .equals(
            configuration.getAttribute(
                IPDEConstants.LAUNCHER_PDE_VERSION, ""))) { // $NON-NLS-1$ //$NON-NLS-2$
      properties.put("eclipse.ignoreApp", "true"); // $NON-NLS-1$ //$NON-NLS-2$
      properties.put("osgi.noShutdown", "true"); // $NON-NLS-1$ //$NON-NLS-2$
    }

    LaunchConfigurationHelper.save(
        new File(getConfigDir(configuration), "config.ini"), properties); // $NON-NLS-1$
  }