Package org.eclipse.osgi.service.datalocation

Examples of org.eclipse.osgi.service.datalocation.Location


        Debug.println("Error reading framework metadata: " + ex.getMessage()); //$NON-NLS-1$
        Debug.printStackTrace(ex);
      }
    }
    if (storageStream == null) {
      Location currentConfiguration = LocationManager.getConfigurationLocation();
      Location parentConfiguration = null;
      if (currentConfiguration != null && (parentConfiguration = currentConfiguration.getParentLocation()) != null) {
        try {
          File bundledataLocationDir = new File(parentConfiguration.getURL().getFile(), FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME);
          StorageManager newStorageManager = initFileManager(bundledataLocationDir, "none", true); //$NON-NLS-1$
          storageStream = newStorageManager.getInputStream(fileName);
          newStorageManager.close();
        } catch (MalformedURLException e1) {
          // This will not happen since all the URLs are derived by us
View Full Code Here


  public void frameworkStart(BundleContext context) throws BundleException {
    registrations.clear();
    registerEndorsedXMLParser(context);
    Hashtable locationProperties = new Hashtable(1);
    Location location = LocationManager.getUserLocation();
    if (location != null) {
      locationProperties.put("type", LocationManager.PROP_USER_AREA); //$NON-NLS-1$
      registrations.add(context.registerService(Location.class.getName(), location, locationProperties));
    }
    location = LocationManager.getInstanceLocation();
View Full Code Here

      return true;
    if (PluginConverterImpl.getTimeStamp(bundledata.getBundleFile().getBaseFile(), getManifestType()) == getManifestTimeStamp()) {
      if ((getManifestType() & (PluginConverterImpl.MANIFEST_TYPE_JAR | PluginConverterImpl.MANIFEST_TYPE_BUNDLE)) != 0)
        return true;
      String cacheLocation = FrameworkProperties.getProperty(LocationManager.PROP_MANIFEST_CACHE);
      Location parentConfiguration = LocationManager.getConfigurationLocation().getParentLocation();
      if (parentConfiguration != null) {
        try {
          return checkManifestAndParent(cacheLocation, bundledata.getSymbolicName(), bundledata.getVersion().toString(), getManifestType()) != null;
        } catch (BundleException e) {
          return false;
View Full Code Here

  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);
    return result;
  }
View Full Code Here

    }
    return (Location) installLocation.getService();
  }

  public URL getInstallURL() {
    Location location = getInstallLocation();
    // it is pretty much impossible for the install location to be null.  If it is, the
    // system is in a bad way so throw and exception and get the heck outta here.
    if (location == null)
      throw new IllegalStateException("The installation location must not be null"); //$NON-NLS-1$
    return location.getURL();
  }
View Full Code Here

  /**
   * @see Platform#getLocation()
   */
  public IPath getLocation() throws IllegalStateException {
    if (cachedInstanceLocation == null) {
      Location location = getInstanceLocation();
      if (location == null)
        return null;
      //  This makes the assumption that the instance location is a file: URL
      File file = new File(location.getURL().getFile());
      cachedInstanceLocation = new Path(file.toString());
    }
    return cachedInstanceLocation;
  }
View Full Code Here

  File getGenerationDir() {
    return new File(getBundleStore(), String.valueOf(getGeneration()));
  }

  File getParentGenerationDir() {
    Location parentConfiguration = null;
    Location currentConfiguration = LocationManager.getConfigurationLocation();
    if (currentConfiguration != null && (parentConfiguration = currentConfiguration.getParentLocation()) != null)
      return new File(parentConfiguration.getURL().getFile(), FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME + '/' + LocationManager.BUNDLES_DIR + '/' + bundleData.getBundleID() + '/' + getGeneration());
    return null;
  }
View Full Code Here

   */
  public void frameworkStart(BundleContext context) throws BundleException {
    registrations.clear();
    registerEndorsedXMLParser(context);
    Dictionary<String, Object> locationProperties = new Hashtable<String, Object>(1);
    Location location = LocationManager.getUserLocation();
    if (location != null) {
      locationProperties.put("type", LocationManager.PROP_USER_AREA); //$NON-NLS-1$
      registrations.add(context.registerService(Location.class.getName(), location, locationProperties));
    }
    location = LocationManager.getInstanceLocation();
View Full Code Here

    // do install location initialization first since others may depend on it
    // assumes that the property is already set
    installLocation = buildLocation(PROP_INSTALL_AREA, null, "", true, false, null); //$NON-NLS-1$

    // TODO not sure what the data area prefix should be here for the user area
    Location temp = buildLocation(PROP_USER_AREA_DEFAULT, null, "", false, false, null); //$NON-NLS-1$
    URL defaultLocation = temp == null ? null : temp.getURL();
    if (defaultLocation == null)
      defaultLocation = buildURL(new File(FrameworkProperties.getProperty(PROP_USER_HOME), "user").getAbsolutePath(), true); //$NON-NLS-1$
    userLocation = buildLocation(PROP_USER_AREA, defaultLocation, "", false, false, null); //$NON-NLS-1$

    temp = buildLocation(PROP_INSTANCE_AREA_DEFAULT, null, "", false, false, INSTANCE_DATA_AREA_PREFIX); //$NON-NLS-1$
    defaultLocation = temp == null ? null : temp.getURL();
    if (defaultLocation == null)
      defaultLocation = buildURL(new File(FrameworkProperties.getProperty(PROP_USER_DIR), "workspace").getAbsolutePath(), true); //$NON-NLS-1$
    instanceLocation = buildLocation(PROP_INSTANCE_AREA, defaultLocation, "", false, false, INSTANCE_DATA_AREA_PREFIX); //$NON-NLS-1$

    mungeConfigurationLocation();
    // compute a default but it is very unlikely to be used since main will have computed everything
    temp = buildLocation(PROP_CONFIG_AREA_DEFAULT, null, "", false, false, null); //$NON-NLS-1$
    defaultLocation = temp == null ? null : temp.getURL();
    if (defaultLocation == null && FrameworkProperties.getProperty(PROP_CONFIG_AREA) == null)
      // only compute the default if the configuration area property is not set
      defaultLocation = buildURL(computeDefaultConfigurationLocation(), true);
    configurationLocation = buildLocation(PROP_CONFIG_AREA, defaultLocation, "", false, false, null); //$NON-NLS-1$
    // get the parent location based on the system property. This will have been set on the
    // way in either by the caller/user or by main.  There will be no parent location if we are not
    // cascaded.
    URL parentLocation = computeSharedConfigurationLocation();
    if (parentLocation != null && !parentLocation.equals(configurationLocation.getURL())) {
      Location parent = new BasicLocation(null, parentLocation, true, null);
      ((BasicLocation) configurationLocation).setParent(parent);
    }
    initializeDerivedConfigurationLocations();

    if (FrameworkProperties.getProperty(PROP_HOME_LOCATION_AREA) == null) {
View Full Code Here

      return true;
    if (PluginConverterImpl.getTimeStamp(bundledata.getBundleFile().getBaseFile(), getManifestType()) == getManifestTimeStamp()) {
      if ((getManifestType() & (PluginConverterImpl.MANIFEST_TYPE_JAR | PluginConverterImpl.MANIFEST_TYPE_BUNDLE)) != 0)
        return true;
      String cacheLocation = FrameworkProperties.getProperty(LocationManager.PROP_MANIFEST_CACHE);
      Location parentConfiguration = LocationManager.getConfigurationLocation().getParentLocation();
      if (parentConfiguration != null) {
        try {
          return checkManifestAndParent(cacheLocation, bundledata.getSymbolicName(), bundledata.getVersion().toString(), getManifestType()) != null;
        } catch (BundleException e) {
          return false;
View Full Code Here

TOP

Related Classes of org.eclipse.osgi.service.datalocation.Location

Copyright © 2018 www.massapicom. 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.