Package org.eclipse.osgi.storagemanager

Examples of org.eclipse.osgi.storagemanager.StorageManager


    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);
        newFileManager.close();
      } catch (IOException ex) {
        if (Debug.DEBUG && Debug.DEBUG_GENERAL) {
          Debug.println("Error reading state file " + ex.getMessage()); //$NON-NLS-1$
          Debug.printStackTrace(ex);
        }
View Full Code Here


      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
          // and we are GODS!
        } catch (IOException e1) {
          // That's ok we will regenerate the .bundleData
View Full Code Here

      if (location == null)
        return false;
      File theStorageDir = new File(location.getURL().getPath() + '/' + Activator.PI_APP);
      if (storageManager == null) {
        boolean readOnly = location.isReadOnly();
        storageManager = new StorageManager(theStorageDir, readOnly ? "none" : null, readOnly); //$NON-NLS-1$
        storageManager.open(!readOnly);
      }
      File dataFile = storageManager.lookup(fileName, false);
      if (dataFile == null || !dataFile.isFile()) {
        Location parent = location.getParentLocation();
        if (parent != null) {
          theStorageDir = new File(parent.getURL().getPath() + '/' + Activator.PI_APP);
          StorageManager tmp = new StorageManager(theStorageDir, "none", true); //$NON-NLS-1$
          tmp.open(false);
          dataFile = tmp.lookup(fileName, false);
          tmp.close();
        }
      }
      if (dataFile == null || !dataFile.isFile())
        return true;
      if (FILE_APPLOCKS.equals(fileName))
View Full Code Here

  protected void setFileManager(File cacheBase, boolean isCacheReadOnly) {
    if (cacheStorageManager != null)
      cacheStorageManager.close(); // close existing file manager first

    if (cacheBase != null) {
      cacheStorageManager = new StorageManager(cacheBase, isCacheReadOnly ? "none" : null, isCacheReadOnly); //$NON-NLS-1$
      try {
        cacheStorageManager.open(!isCacheReadOnly);
      } catch (IOException e) {
        // Ignore the exception. The registry will be rebuilt from source.
      }
View Full Code Here

TOP

Related Classes of org.eclipse.osgi.storagemanager.StorageManager

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.