Package org.eclipse.osgi.service.datalocation

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


  private Headers<String, String> checkManifestAndParent(String cacheLocation, String symbolicName, String version, byte inputType) throws BundleException {
    Headers<String, String> 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


    if (Boolean.valueOf(FrameworkProperties.getProperty(BaseStorage.PROP_CLEAN)).booleanValue())
      cleanOSGiCache();

    // we need to set the install path as soon as possible so we can determine
    // the absolute location of install relative URLs
    Location installLoc = LocationManager.getInstallLocation();
    if (installLoc != null) {
      URL installURL = installLoc.getURL();
      // assume install URL is file: based
      installPath = installURL.getPath();
    }
    boolean readOnlyConfiguration = LocationManager.getConfigurationLocation().isReadOnly();
    storageManager = initFileManager(LocationManager.getOSGiConfigurationDir(), readOnlyConfiguration ? "none" : null, readOnlyConfiguration); //$NON-NLS-1$
View Full Code Here

        break;
      }
    if (success)
      return storageFiles;
    //if it does not exist, try to read it from the parent
    Location parentConfiguration = null;
    Location currentConfiguration = LocationManager.getConfigurationLocation();
    if (currentConfiguration != null && (parentConfiguration = currentConfiguration.getParentLocation()) != null) {
      try {
        File stateLocationDir = new File(parentConfiguration.getURL().getFile(), FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME);
        StorageManager newFileManager = initFileManager(stateLocationDir, "none", true); //$NON-NLS-1$);
        for (int i = 0; i < storageFiles.length; i++)
          storageFiles[i] = newFileManager.lookup(fileNames[i], false);
View Full Code Here

        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

    String logFileProp = FrameworkProperties.getProperty(EclipseStarter.PROP_LOGFILE);
    boolean enabled = "true".equals(FrameworkProperties.getProperty(PROP_LOG_ENABLED, "true")); //$NON-NLS-1$ //$NON-NLS-2$
    if (logFileProp != null) {
      logWriter = new EclipseLogWriter(new File(logFileProp), EQUINOX_LOGGER_NAME, enabled);
    } else {
      Location location = LocationManager.getConfigurationLocation();
      File configAreaDirectory = null;
      if (location != null)
        // TODO assumes the URL is a file: url
        configAreaDirectory = new File(location.getURL().getFile());

      if (configAreaDirectory != null) {
        String logFileName = Long.toString(System.currentTimeMillis()) + EclipseLogHook.LOG_EXT;
        File logFile = new File(configAreaDirectory, logFileName);
        FrameworkProperties.setProperty(EclipseStarter.PROP_LOGFILE, logFile.getAbsolutePath());
View Full Code Here

      }
    }
  }

  private static void loadConfigurationInfo() {
    Location configArea = LocationManager.getConfigurationLocation();
    if (configArea == null)
      return;

    URL location = null;
    try {
      location = new URL(configArea.getURL().toExternalForm() + LocationManager.CONFIG_FILE);
    } catch (MalformedURLException e) {
      // its ok.  This should never happen
    }
    mergeProperties(FrameworkProperties.getProperties(), loadProperties(location));
  }
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

            itextPath = itextPath.replaceAll("!", "");
            sb.append(File.pathSeparator);
            addPath(itextPath, sb);
        }
       
        Location installLocation = Platform.getInstallLocation();
        File installFolder = DataUtilities.urlToFile(installLocation.getURL());
        if (installFolder != null && installFolder.exists()) {
            File pluginsFolder = new File(installFolder, "plugins");
            if (pluginsFolder.exists()) {

                File[] files = pluginsFolder.listFiles(new FilenameFilter(){
View Full Code Here

     * Get the folder named spatialtoolbox in the installation folder.
     *
     * @return the folder or <code>null</code>.
     */
    public static File getExtraSpatialtoolboxLibsFolder() {
        Location installLocation = Platform.getInstallLocation();
        File installFolder = DataUtilities.urlToFile(installLocation.getURL());
        if (installFolder != null && installFolder.exists()) {
            File omsboxLibsFolder = new File(installFolder, "spatialtoolbox");
            if (omsboxLibsFolder.exists()) {
                return omsboxLibsFolder;
            }
View Full Code Here

    /**
     * @return the java path used by the uDig instance or "java".
     */
    public static String getUdigJava() {
        String[] possibleJava = {"javaw.exe", "java.exe", "java"};
        Location installLocation = Platform.getInstallLocation();
        File installFolder = DataUtilities.urlToFile(installLocation.getURL());
        if (installFolder != null && installFolder.exists()) {
            File jreFolder = new File(installFolder, "jre/bin");
            if (jreFolder.exists()) {
                for( String pJava : possibleJava ) {
                    File java = new File(jreFolder, pJava);
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.