Examples of Headers


Examples of org.eclipse.osgi.framework.util.Headers

    ResourceBundle localeProperties = getResourceBundle(localeString);
    if (localeProperties == null && !isDefaultLocale)
      // could not find the requested locale use the default locale
      localeProperties = getResourceBundle(defaultLocale);
    Enumeration e = this.rawHeaders.keys();
    Headers localeHeaders = new Headers(this.rawHeaders.size());
    while (e.hasMoreElements()) {
      String key = (String) e.nextElement();
      String value = (String) this.rawHeaders.get(key);
      if (value.startsWith("%") && (value.length() > 1)) { //$NON-NLS-1$
        String propertiesKey = value.substring(1);
        try {
          value = localeProperties == null ? propertiesKey : (String) localeProperties.getObject(propertiesKey);
        } catch (MissingResourceException ex) {
          value = propertiesKey;
        }
      }
      localeHeaders.set(key, value);
    }
    localeHeaders.setReadOnly();
    if (isDefaultLocale) {
      defaultLocaleHeaders = localeHeaders;
    }
    return (localeHeaders);
  }
View Full Code Here

Examples of org.eclipse.osgi.framework.util.Headers

        if (cp[i].getFile().endsWith("/")) { //$NON-NLS-1$
          manifest = new URL(cp[i], org.eclipse.osgi.framework.internal.core.Constants.OSGI_BUNDLE_MANIFEST).openStream();
        } else {
          manifest = new URL("jar:" + cp[i].toExternalForm() + "!/" + org.eclipse.osgi.framework.internal.core.Constants.OSGI_BUNDLE_MANIFEST).openStream(); //$NON-NLS-1$ //$NON-NLS-2$
        }
        Map headers = ManifestElement.parseBundleManifest(manifest, new Headers(10));
        String bsnSpec = getValue(headers, Constants.BUNDLE_SYMBOLICNAME);
        if (bsnSpec == null)
          continue;
        String internalBSN = org.eclipse.osgi.framework.internal.core.Constants.getInternalSymbolicName();
        if (internalBSN.equals(bsnSpec)) {
View Full Code Here

Examples of org.eclipse.osgi.framework.util.Headers

      Enumeration manifests = cl != null ? cl.getResources(Constants.OSGI_BUNDLE_MANIFEST) : ClassLoader.getSystemResources(Constants.OSGI_BUNDLE_MANIFEST);
      while (manifests.hasMoreElements()) {
        URL url = (URL) manifests.nextElement();
        try {
          // check each manifest until we find one with the Eclipse-SystemBundle: true header
          Headers headers = Headers.parseManifest(url.openStream());
          if ("true".equals(headers.get(Constants.ECLIPSE_SYSTEMBUNDLE))) //$NON-NLS-1$
            return url.openStream();
        } catch (BundleException e) {
          // ignore and continue to next URL
        }
      }
View Full Code Here

Examples of org.eclipse.osgi.framework.util.Headers

   * @throws IllegalArgumentException If <code>dictionary</code> contains
   *         case variants of the same key name.
   */
  public boolean match(Dictionary dictionary) {
    if (dictionary != null) {
      dictionary = new Headers(dictionary);
    }

    return match0(dictionary);
  }
View Full Code Here

Examples of org.eclipse.osgi.framework.util.Headers

        FrameworkLogEntry entry = new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, FrameworkLogEntry.ERROR, 0, message, 0, e, null);
        storageHook.getAdaptor().getFrameworkLog().log(entry);
        return null;
      }
    if (manifest == null) {
      Headers empty = new Headers(0);
      empty.setReadOnly();
      manifest = empty;
      return empty;
    }
    return manifest;
  }
View Full Code Here

Examples of org.eclipse.osgi.framework.util.Headers

    }
    return false;
  }

  private Headers checkManifestAndParent(String cacheLocation, String symbolicName, String version, byte inputType) throws BundleException {
    Headers result = basicCheckManifest(cacheLocation, symbolicName, version, inputType);
    if (result != null)
      return result;
    Location parentConfiguration = null;
    if ((parentConfiguration = LocationManager.getConfigurationLocation().getParentLocation()) != null)
      result = basicCheckManifest(new File(parentConfiguration.getURL().getFile(), FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME + '/' + LocationManager.MANIFESTS_DIR).toString(), symbolicName, version, inputType);
View Full Code Here

Examples of org.eclipse.osgi.framework.util.Headers

  }

  private Dictionary generateManifest(Dictionary builtIn) throws BundleException {
    String cacheLocation = FrameworkProperties.getProperty(LocationManager.PROP_MANIFEST_CACHE);
    if (bundledata.getSymbolicName() != null) {
      Headers existingHeaders = checkManifestAndParent(cacheLocation, bundledata.getSymbolicName(), bundledata.getVersion().toString(), manifestType);
      if (existingHeaders != null)
        return existingHeaders;
    }

    PluginConverterImpl converter = PluginConverterImpl.getDefault();
    if (converter == null)
      converter = new PluginConverterImpl(bundledata.getAdaptor(), bundledata.getAdaptor().getContext());

    Dictionary generatedManifest;
    try {
      generatedManifest = converter.convertManifest(bundledata.getBundleFile().getBaseFile(), true, null, true, null);
    } catch (PluginConversionException pce) {
      String message = NLS.bind(EclipseAdaptorMsg.ECLIPSE_CONVERTER_ERROR_CONVERTING, bundledata.getBundleFile().getBaseFile());
      throw new BundleException(message, BundleException.MANIFEST_ERROR, pce);
    }

    //Now we know the symbolicId and the version of the bundle, we check to see if don't have a manifest for it already
    Version version = Version.parseVersion((String) generatedManifest.get(Constants.BUNDLE_VERSION));
    String symbolicName = ManifestElement.parseHeader(org.osgi.framework.Constants.BUNDLE_SYMBOLICNAME, (String) generatedManifest.get(org.osgi.framework.Constants.BUNDLE_SYMBOLICNAME))[0].getValue();
    ManifestElement generatedFrom = ManifestElement.parseHeader(PluginConverterImpl.GENERATED_FROM, (String) generatedManifest.get(PluginConverterImpl.GENERATED_FROM))[0];
    Headers existingHeaders = checkManifestAndParent(cacheLocation, symbolicName, version.toString(), Byte.parseByte(generatedFrom.getAttribute(PluginConverterImpl.MANIFEST_TYPE_ATTRIBUTE)));
    //We don't have a manifest.
    manifestTimeStamp = Long.parseLong(generatedFrom.getValue());
    manifestType = Byte.parseByte(generatedFrom.getAttribute(PluginConverterImpl.MANIFEST_TYPE_ATTRIBUTE));
    if (bundledata.getAdaptor().isReadOnly() || existingHeaders != null)
      return existingHeaders;
View Full Code Here

Examples of org.elasticsearch.client.support.Headers

    @Override
    protected Client buildClient(Settings headersSettings, GenericAction[] testedActions) {
        Settings settings = HEADER_SETTINGS;

        Headers headers = new Headers(settings);
        Actions actions = new Actions(settings, threadPool, testedActions);

        NodeClusterAdminClient clusterClient = new NodeClusterAdminClient(threadPool, actions, headers);
        NodeIndicesAdminClient indicesClient = new NodeIndicesAdminClient(threadPool, actions, headers);
        NodeAdminClient adminClient = new NodeAdminClient(settings, clusterClient, indicesClient);
View Full Code Here

Examples of org.jboss.com.sun.net.httpserver.Headers

    ExchangeImpl (
        String m, URI u, Request req, long len, HttpConnection connection
    ) throws IOException {
        this.req = req;
        this.reqHdrs = req.headers();
        this.rspHdrs = new Headers();
        this.method = m;
        this.uri = u;
        this.connection = connection;
        this.reqContentLen = len;
        /* ros only used for headers, body written directly to stream */
 
View Full Code Here

Examples of org.jboss.com.sun.net.httpserver.Headers

    Headers headers () throws IOException {
        if (hdrs != null) {
            return hdrs;
        }
        hdrs = new Headers();

        char s[] = new char[10];
        int len = 0;

        int firstc = is.read();
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.