org.eclipse.equinox.internal.frameworkadmin.utils.Utils.getOSGiManifest()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(109)

本文整理了Java中org.eclipse.equinox.internal.frameworkadmin.utils.Utils.getOSGiManifest()方法的一些代码示例,展示了Utils.getOSGiManifest()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.getOSGiManifest()方法的具体详情如下:
包路径:org.eclipse.equinox.internal.frameworkadmin.utils.Utils
类名称:Utils
方法名:getOSGiManifest

Utils.getOSGiManifest介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.equinox/frameworkadmin

public static String getManifestMainAttributes(URI location, String name) {
  Dictionary manifest = Utils.getOSGiManifest(location);
  if (manifest == null)
    throw new RuntimeException("Unable to locate bundle manifest: " + location);
  return (String) manifest.get(name);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.equinox.frameworkadmin

public static String getManifestMainAttributes(URI location, String name) {
  Dictionary<String, String> manifest = Utils.getOSGiManifest(location);
  if (manifest == null)
    throw new RuntimeException("Unable to locate bundle manifest: " + location); //$NON-NLS-1$
  return manifest.get(name);
}

代码示例来源:origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.frameworkadmin

public static String getManifestMainAttributes(URI location, String name) {
  Dictionary<String, String> manifest = Utils.getOSGiManifest(location);
  if (manifest == null)
    throw new RuntimeException("Unable to locate bundle manifest: " + location); //$NON-NLS-1$
  return manifest.get(name);
}

代码示例来源:origin: org.eclipse.equinox/frameworkadmin

public void installBundle(BundleInfo bInfo) throws FrameworkAdminRuntimeException {
  Dictionary newManifest = Utils.getOSGiManifest(newLocation);
  if (newManifest == null) {
      break;
    Dictionary manifest = Utils.getOSGiManifest(location);
    String symbolicName = (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME);
    String version = (String) manifest.get(Constants.BUNDLE_VERSION);

代码示例来源:origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.frameworkadmin

public void installBundle(BundleInfo bInfo) throws FrameworkAdminRuntimeException {
  Dictionary<String, String> newManifest = Utils.getOSGiManifest(newLocation);
  if (newManifest == null) {
      break;
    Dictionary<String, String> manifest = Utils.getOSGiManifest(location);
    String symbolicName = manifest.get(Constants.BUNDLE_SYMBOLICNAME);
    String version = manifest.get(Constants.BUNDLE_VERSION);

代码示例来源:origin: org.eclipse.platform/org.eclipse.equinox.frameworkadmin

Dictionary<String, String> newManifest = Utils.getOSGiManifest(newLocation);
if (newManifest == null) {
    break;
  Dictionary<String, String> manifest = Utils.getOSGiManifest(location);
  String symbolicName = manifest.get(Constants.BUNDLE_SYMBOLICNAME);
  String version = manifest.get(Constants.BUNDLE_VERSION);

代码示例来源:origin: org.eclipse.platform/org.eclipse.equinox.frameworkadmin.equinox

@Override
public void installBundle(BundleInfo bInfo) throws FrameworkAdminRuntimeException {
  SimpleBundlesState.checkAvailability(fwAdmin);
  URI realLocation = bInfo.getLocation();
  if (getBundleByLocation(realLocation) != null)
    return;
  Dictionary<String, String> manifest = Utils.getOSGiManifest(realLocation);
  if (manifest == null)
    return;
  String newSymbolicName = manifest.get(Constants.BUNDLE_SYMBOLICNAME);
  int position = newSymbolicName.indexOf(";"); //$NON-NLS-1$
  if (position >= 0)
    newSymbolicName = newSymbolicName.substring(0, position).trim();
  String newVersion = manifest.get(Constants.BUNDLE_VERSION);
  if (getBundleByNameVersion(newSymbolicName, newVersion) != null)
    return;
  try {
    bInfo.setBundleId(++maxId);
    BundleDescription newBundleDescription = soFactory.createBundleDescription(state, manifest, realLocation.toString(), bInfo.getBundleId());
    addBundleToState(newBundleDescription);
    manipulator.getConfigData().addBundle(bInfo);
  } catch (BundleException e) {
    Log.log(LogService.LOG_WARNING, this, "installBundle(BundleInfo)", e); //$NON-NLS-1$
  }
}

代码示例来源:origin: org.eclipse.equinox.frameworkadmin/equinox

public void installBundle(BundleInfo bInfo) throws FrameworkAdminRuntimeException {
  SimpleBundlesState.checkAvailability(fwAdmin);
  URI realLocation = bInfo.getLocation();
  if (getBundleByLocation(realLocation) != null)
    return;
  Dictionary manifest = Utils.getOSGiManifest(realLocation);
  if (manifest == null)
    return;
  String newSymbolicName = (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME);
  int position = newSymbolicName.indexOf(";"); //$NON-NLS-1$
  if (position >= 0)
    newSymbolicName = newSymbolicName.substring(0, position).trim();
  String newVersion = (String) manifest.get(Constants.BUNDLE_VERSION);
  if (getBundleByNameVersion(newSymbolicName, newVersion) != null)
    return;
  try {
    bInfo.setBundleId(++maxId);
    BundleDescription newBundleDescription = soFactory.createBundleDescription(state, manifest, realLocation.toString(), bInfo.getBundleId());
    addBundleToState(newBundleDescription);
    manipulator.getConfigData().addBundle(bInfo);
  } catch (BundleException e) {
    Log.log(LogService.LOG_WARNING, this, "installBundle(BundleInfo)", e); //$NON-NLS-1$
  }
}

代码示例来源:origin: org.eclipse.equinox.frameworkadmin/equinox

public void uninstallBundle(BundleInfo bInfo) throws FrameworkAdminRuntimeException {
  SimpleBundlesState.checkAvailability(fwAdmin);
  long id = DEFAULT_TIMESTAMP;
  URI realLocation = bInfo.getLocation();
  BundleDescription bundle = getBundleByLocation(bInfo.getLocation());
  if (bundle != null)
    id = bundle.getBundleId();
  if (id != DEFAULT_TIMESTAMP) {
    try {
      Dictionary manifest = Utils.getOSGiManifest(bInfo.getLocation());
      if (manifest == null) {
        Log.log(LogService.LOG_WARNING, this, "uninstallBundle(BundleInfo)", NLS.bind(Messages.exception_bundleManifest, bInfo.getLocation())); //$NON-NLS-1$
        return;
      }
      BundleDescription bundleDescription = soFactory.createBundleDescription(state, manifest, realLocation.toString(), id);
      removeBundleFromState(bundleDescription);
      manipulator.getConfigData().removeBundle(bInfo);
    } catch (BundleException e) {
      Log.log(LogService.LOG_WARNING, this, "uninstallBundle(BundleInfo)", e); //$NON-NLS-1$
    }
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.equinox.frameworkadmin.equinox

@Override
public void uninstallBundle(BundleInfo bInfo) throws FrameworkAdminRuntimeException {
  SimpleBundlesState.checkAvailability(fwAdmin);
  long id = DEFAULT_TIMESTAMP;
  URI realLocation = bInfo.getLocation();
  BundleDescription bundle = getBundleByLocation(bInfo.getLocation());
  if (bundle != null)
    id = bundle.getBundleId();
  if (id != DEFAULT_TIMESTAMP) {
    try {
      Dictionary<String, String> manifest = Utils.getOSGiManifest(bInfo.getLocation());
      if (manifest == null) {
        Log.log(LogService.LOG_WARNING, this, "uninstallBundle(BundleInfo)", NLS.bind(Messages.exception_bundleManifest, bInfo.getLocation())); //$NON-NLS-1$
        return;
      }
      BundleDescription bundleDescription = soFactory.createBundleDescription(state, manifest, realLocation.toString(), id);
      removeBundleFromState(bundleDescription);
      manipulator.getConfigData().removeBundle(bInfo);
    } catch (BundleException e) {
      Log.log(LogService.LOG_WARNING, this, "uninstallBundle(BundleInfo)", e); //$NON-NLS-1$
    }
  }
}

相关文章