Examples of PluginConversionException


Examples of org.eclipse.osgi.service.pluginconversion.PluginConversionException

    InputStream pluginFile = null;
    try {
      try {
        pluginFile = findPluginManifest(pluginBaseLocation);
      } catch (IOException e) {
        throw new PluginConversionException(NLS.bind(EclipseAdaptorMsg.ECLIPSE_CONVERTER_FILENOTFOUND, pluginBaseLocation.getAbsolutePath()), e);
      }
      if (pluginFile == null)
        throw new PluginConversionException(NLS.bind(EclipseAdaptorMsg.ECLIPSE_CONVERTER_FILENOTFOUND, pluginBaseLocation.getAbsolutePath()));
      pluginInfo = parsePluginInfo(pluginFile);
    } finally {
      if (pluginZip != null)
        try {
          pluginZip.close();
          pluginZip = null;
        } catch (IOException e) {
          // ignore
        }
    }
    String validation = pluginInfo.validateForm();
    if (validation != null)
      throw new PluginConversionException(validation);
  }
View Full Code Here

Examples of org.eclipse.osgi.service.pluginconversion.PluginConversionException

      File parentFile = new File(generationLocation.getParent());
      parentFile.mkdirs();
      generationLocation.createNewFile();
      if (!generationLocation.isFile()) {
        String message = NLS.bind(EclipseAdaptorMsg.ECLIPSE_CONVERTER_ERROR_CREATING_BUNDLE_MANIFEST, this.pluginInfo.getUniqueId(), generationLocation);
        throw new PluginConversionException(message);
      }
      // replaces any eventual existing file
      manifestToWrite = new Hashtable((Map) manifestToWrite);
      // MANIFEST.MF files must be written using UTF-8
      out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(generationLocation), UTF_8));
      writeEntry(MANIFEST_VERSION, (String) manifestToWrite.remove(MANIFEST_VERSION));
      writeEntry(GENERATED_FROM, (String) manifestToWrite.remove(GENERATED_FROM)); //Need to do this first uptoDate check expect the generated-from tag to be in the first line
      // always attempt to write the Bundle-ManifestVersion header if it exists (bug 109863)
      writeEntry(Constants.BUNDLE_MANIFESTVERSION, (String) manifestToWrite.remove(Constants.BUNDLE_MANIFESTVERSION));
      writeEntry(Constants.BUNDLE_NAME, (String) manifestToWrite.remove(Constants.BUNDLE_NAME));
      writeEntry(Constants.BUNDLE_SYMBOLICNAME, (String) manifestToWrite.remove(Constants.BUNDLE_SYMBOLICNAME));
      writeEntry(Constants.BUNDLE_VERSION, (String) manifestToWrite.remove(Constants.BUNDLE_VERSION));
      writeEntry(Constants.BUNDLE_CLASSPATH, (String) manifestToWrite.remove(Constants.BUNDLE_CLASSPATH));
      writeEntry(Constants.BUNDLE_ACTIVATOR, (String) manifestToWrite.remove(Constants.BUNDLE_ACTIVATOR));
      writeEntry(Constants.BUNDLE_VENDOR, (String) manifestToWrite.remove(Constants.BUNDLE_VENDOR));
      writeEntry(Constants.FRAGMENT_HOST, (String) manifestToWrite.remove(Constants.FRAGMENT_HOST));
      writeEntry(Constants.BUNDLE_LOCALIZATION, (String) manifestToWrite.remove(Constants.BUNDLE_LOCALIZATION));
      // always attempt to write the Export-Package header if it exists (bug 109863)
      writeEntry(Constants.EXPORT_PACKAGE, (String) manifestToWrite.remove(Constants.EXPORT_PACKAGE));
      // always attempt to write the Provide-Package header if it exists (bug 109863)
      writeEntry(Constants.PROVIDE_PACKAGE, (String) manifestToWrite.remove(Constants.PROVIDE_PACKAGE));
      writeEntry(Constants.REQUIRE_BUNDLE, (String) manifestToWrite.remove(Constants.REQUIRE_BUNDLE));
      Enumeration keys = manifestToWrite.keys();
      while (keys.hasMoreElements()) {
        String key = (String) keys.nextElement();
        writeEntry(key, (String) manifestToWrite.get(key));
      }
      out.flush();
    } catch (IOException e) {
      String message = NLS.bind(EclipseAdaptorMsg.ECLIPSE_CONVERTER_ERROR_CREATING_BUNDLE_MANIFEST, this.pluginInfo.getUniqueId(), generationLocation);
      throw new PluginConversionException(message, e);
    } finally {
      if (out != null)
        try {
          out.close();
        } catch (IOException e) {
View Full Code Here

Examples of org.eclipse.osgi.service.pluginconversion.PluginConversionException

    try {
      input = new BufferedInputStream(pluginLocation);
      return new PluginParser(adaptor, context, target).parsePlugin(input);
    } catch (Exception e) {
      String message = NLS.bind(EclipseAdaptorMsg.ECLIPSE_CONVERTER_ERROR_PARSING_PLUGIN_MANIFEST, pluginManifestLocation);
      throw new PluginConversionException(message, e);
    } finally {
      if (input != null)
        try {
          input.close();
        } catch (IOException e) {
View Full Code Here

Examples of org.eclipse.osgi.service.pluginconversion.PluginConversionException

    InputStream pluginFile = null;
    try {
      try {
        pluginFile = findPluginManifest(pluginBaseLocation);
      } catch (IOException e) {
        throw new PluginConversionException(NLS.bind(EclipseAdaptorMsg.ECLIPSE_CONVERTER_FILENOTFOUND, pluginBaseLocation.getAbsolutePath()), e);
      }
      if (pluginFile == null)
        throw new PluginConversionException(NLS.bind(EclipseAdaptorMsg.ECLIPSE_CONVERTER_FILENOTFOUND, pluginBaseLocation.getAbsolutePath()));
      pluginInfo = parsePluginInfo(pluginFile);
    } finally {
      if (pluginZip != null)
        try {
          pluginZip.close();
          pluginZip = null;
        } catch (IOException e) {
          // ignore
        }
    }
    String validation = pluginInfo.validateForm();
    if (validation != null)
      throw new PluginConversionException(validation);
  }
View Full Code Here

Examples of org.eclipse.osgi.service.pluginconversion.PluginConversionException

      File parentFile = new File(generationLocation.getParent());
      parentFile.mkdirs();
      generationLocation.createNewFile();
      if (!generationLocation.isFile()) {
        String message = NLS.bind(EclipseAdaptorMsg.ECLIPSE_CONVERTER_ERROR_CREATING_BUNDLE_MANIFEST, this.pluginInfo.getUniqueId(), generationLocation);
        throw new PluginConversionException(message);
      }
      // replaces any eventual existing file
      manifestToWrite = new Hashtable<String, String>((Hashtable) manifestToWrite);
      // MANIFEST.MF files must be written using UTF-8
      out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(generationLocation), UTF_8));
      writeEntry(MANIFEST_VERSION, manifestToWrite.remove(MANIFEST_VERSION));
      writeEntry(GENERATED_FROM, manifestToWrite.remove(GENERATED_FROM)); //Need to do this first uptoDate check expect the generated-from tag to be in the first line
      // always attempt to write the Bundle-ManifestVersion header if it exists (bug 109863)
      writeEntry(Constants.BUNDLE_MANIFESTVERSION, manifestToWrite.remove(Constants.BUNDLE_MANIFESTVERSION));
      writeEntry(Constants.BUNDLE_NAME, manifestToWrite.remove(Constants.BUNDLE_NAME));
      writeEntry(Constants.BUNDLE_SYMBOLICNAME, manifestToWrite.remove(Constants.BUNDLE_SYMBOLICNAME));
      writeEntry(Constants.BUNDLE_VERSION, manifestToWrite.remove(Constants.BUNDLE_VERSION));
      writeEntry(Constants.BUNDLE_CLASSPATH, manifestToWrite.remove(Constants.BUNDLE_CLASSPATH));
      writeEntry(Constants.BUNDLE_ACTIVATOR, manifestToWrite.remove(Constants.BUNDLE_ACTIVATOR));
      writeEntry(Constants.BUNDLE_VENDOR, manifestToWrite.remove(Constants.BUNDLE_VENDOR));
      writeEntry(Constants.FRAGMENT_HOST, manifestToWrite.remove(Constants.FRAGMENT_HOST));
      writeEntry(Constants.BUNDLE_LOCALIZATION, manifestToWrite.remove(Constants.BUNDLE_LOCALIZATION));
      // always attempt to write the Export-Package header if it exists (bug 109863)
      writeEntry(Constants.EXPORT_PACKAGE, manifestToWrite.remove(Constants.EXPORT_PACKAGE));
      // always attempt to write the Provide-Package header if it exists (bug 109863)
      writeEntry(Constants.PROVIDE_PACKAGE, manifestToWrite.remove(Constants.PROVIDE_PACKAGE));
      writeEntry(Constants.REQUIRE_BUNDLE, manifestToWrite.remove(Constants.REQUIRE_BUNDLE));
      Enumeration<String> keys = manifestToWrite.keys();
      while (keys.hasMoreElements()) {
        String key = keys.nextElement();
        writeEntry(key, manifestToWrite.get(key));
      }
      out.flush();
    } catch (IOException e) {
      String message = NLS.bind(EclipseAdaptorMsg.ECLIPSE_CONVERTER_ERROR_CREATING_BUNDLE_MANIFEST, this.pluginInfo.getUniqueId(), generationLocation);
      throw new PluginConversionException(message, e);
    } finally {
      if (out != null)
        try {
          out.close();
        } catch (IOException e) {
View Full Code Here

Examples of org.eclipse.osgi.service.pluginconversion.PluginConversionException

    try {
      input = new BufferedInputStream(pluginLocation);
      return new PluginParser(adaptor, context, target).parsePlugin(input);
    } catch (Exception e) {
      String message = NLS.bind(EclipseAdaptorMsg.ECLIPSE_CONVERTER_ERROR_PARSING_PLUGIN_MANIFEST, pluginManifestLocation);
      throw new PluginConversionException(message, e);
    } finally {
      if (input != null)
        try {
          input.close();
        } catch (IOException e) {
View Full Code Here

Examples of org.eclipse.osgi.service.pluginconversion.PluginConversionException

    pluginManifestLocation = pluginBaseLocation;
    if (pluginManifestLocation == null)
      throw new IllegalArgumentException();
    URL pluginFile = findPluginManifest(pluginBaseLocation);
    if (pluginFile == null)
      throw new PluginConversionException(NLS.bind(EclipseAdaptorMsg.ECLIPSE_CONVERTER_FILENOTFOUND, pluginBaseLocation.getAbsolutePath()));
    pluginInfo = parsePluginInfo(pluginFile);
    String validation = pluginInfo.validateForm();
    if (validation != null)
      throw new PluginConversionException(validation);
  }
View Full Code Here

Examples of org.eclipse.osgi.service.pluginconversion.PluginConversionException

      File parentFile = new File(generationLocation.getParent());
      parentFile.mkdirs();
      generationLocation.createNewFile();
      if (!generationLocation.isFile()) {
        String message = NLS.bind(EclipseAdaptorMsg.ECLIPSE_CONVERTER_ERROR_CREATING_BUNDLE_MANIFEST, this.pluginInfo.getUniqueId(), generationLocation);
        throw new PluginConversionException(message);
      }
      // replaces any eventual existing file
      manifestToWrite = new Hashtable((Map) manifestToWrite);
      // MANIFEST.MF files must be written using UTF-8
      out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(generationLocation), UTF_8));
      writeEntry(MANIFEST_VERSION, (String) manifestToWrite.remove(MANIFEST_VERSION));
      writeEntry(GENERATED_FROM, (String) manifestToWrite.remove(GENERATED_FROM)); //Need to do this first uptoDate check expect the generated-from tag to be in the first line
      // always attempt to write the Bundle-ManifestVersion header if it exists (bug 109863)
      writeEntry(Constants.BUNDLE_MANIFESTVERSION, (String) manifestToWrite.remove(Constants.BUNDLE_MANIFESTVERSION));
      writeEntry(Constants.BUNDLE_NAME, (String) manifestToWrite.remove(Constants.BUNDLE_NAME));
      writeEntry(Constants.BUNDLE_SYMBOLICNAME, (String) manifestToWrite.remove(Constants.BUNDLE_SYMBOLICNAME));
      writeEntry(Constants.BUNDLE_VERSION, (String) manifestToWrite.remove(Constants.BUNDLE_VERSION));
      writeEntry(Constants.BUNDLE_CLASSPATH, (String) manifestToWrite.remove(Constants.BUNDLE_CLASSPATH));
      writeEntry(Constants.BUNDLE_ACTIVATOR, (String) manifestToWrite.remove(Constants.BUNDLE_ACTIVATOR));
      writeEntry(Constants.BUNDLE_VENDOR, (String) manifestToWrite.remove(Constants.BUNDLE_VENDOR));
      writeEntry(Constants.FRAGMENT_HOST, (String) manifestToWrite.remove(Constants.FRAGMENT_HOST));
      writeEntry(Constants.BUNDLE_LOCALIZATION, (String) manifestToWrite.remove(Constants.BUNDLE_LOCALIZATION));
      // always attempt to write the Export-Package header if it exists (bug 109863)
      writeEntry(Constants.EXPORT_PACKAGE, (String) manifestToWrite.remove(Constants.EXPORT_PACKAGE));
      // always attempt to write the Provide-Package header if it exists (bug 109863)
      writeEntry(Constants.PROVIDE_PACKAGE, (String) manifestToWrite.remove(Constants.PROVIDE_PACKAGE));
      writeEntry(Constants.REQUIRE_BUNDLE, (String) manifestToWrite.remove(Constants.REQUIRE_BUNDLE));
      Enumeration keys = manifestToWrite.keys();
      while (keys.hasMoreElements()) {
        String key = (String) keys.nextElement();
        writeEntry(key, (String) manifestToWrite.get(key));
      }
      out.flush();
    } catch (IOException e) {
      String message = NLS.bind(EclipseAdaptorMsg.ECLIPSE_CONVERTER_ERROR_CREATING_BUNDLE_MANIFEST, this.pluginInfo.getUniqueId(), generationLocation);
      throw new PluginConversionException(message, e);
    } finally {
      if (out != null)
        try {
          out.close();
        } catch (IOException e) {
View Full Code Here

Examples of org.eclipse.osgi.service.pluginconversion.PluginConversionException

    try {
      input = new BufferedInputStream(pluginLocation.openStream());
      return new PluginParser(adaptor, context, target).parsePlugin(input);
    } catch (Exception e) {
      String message = NLS.bind(EclipseAdaptorMsg.ECLIPSE_CONVERTER_ERROR_PARSING_PLUGIN_MANIFEST, pluginManifestLocation);
      throw new PluginConversionException(message, e);
    } finally {
      if (input != null)
        try {
          input.close();
        } catch (IOException e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.