1 11 12 package org.eclipse.osgi.framework.internal.defaultadaptor; 13 14 import java.io.File ; 15 import java.io.IOException ; 16 import org.eclipse.osgi.framework.adaptor.core.AbstractBundleData; 17 import org.eclipse.osgi.framework.debug.Debug; 18 import org.osgi.framework.BundleException; 19 20 29 public class DefaultBundleData extends AbstractBundleData { 30 39 public void initializeExistingBundle() throws BundleException, IOException { 40 File delete = new File (getBundleStoreDir(), ".delete"); 42 43 if (delete.exists()) 44 throw new IOException (); 45 46 createBaseBundleFile(); 47 48 loadFromManifest(); 49 } 50 51 57 public DefaultBundleData(DefaultAdaptor adaptor, long id) { 58 super(adaptor, id); 59 } 60 61 public String toString() { 62 return getLocation(); 63 } 64 65 70 public synchronized void save() throws IOException { 71 if (adaptor.canWrite()) 72 ((DefaultAdaptor) adaptor).saveMetaDataFor(this); 73 } 74 75 80 protected File createBundleStoreDir() { 81 if (!getBundleStoreDir().exists() && !getBundleStoreDir().mkdirs()) { 82 if (Debug.DEBUG && Debug.DEBUG_GENERAL) { 83 Debug.println("Unable to create bundle store directory: " + getBundleStoreDir().getPath()); } 85 } 86 return getBundleStoreDir(); 87 } 88 89 } 90 | Popular Tags |