public String[] mapLibraryNames(String mappedLibName) { int extIndex = mappedLibName.lastIndexOf('.'); List<String> LIB_EXTENSIONS = generation.getBundleInfo().getStorage().getConfiguration().LIB_EXTENSIONS; if (LIB_EXTENSIONS.isEmpty() || extIndex < 0) return EMPTY_STRINGS; String libNameBase = mappedLibName.substring(0, extIndex); String[] results = new String[LIB_EXTENSIONS.size()]; for (int i = 0; i < results.length; i++) results[i] = libNameBase + LIB_EXTENSIONS.get(i); return results; }
public String[] mapLibraryNames(String mappedLibName) { int extIndex = mappedLibName.lastIndexOf('.'); List<String> LIB_EXTENSIONS = generation.getBundleInfo().getStorage().getConfiguration().LIB_EXTENSIONS; if (LIB_EXTENSIONS.isEmpty() || extIndex < 0) return EMPTY_STRINGS; String libNameBase = mappedLibName.substring(0, extIndex); String[] results = new String[LIB_EXTENSIONS.size()]; for (int i = 0; i < results.length; i++) results[i] = libNameBase + LIB_EXTENSIONS.get(i); return results; }
public String[] mapLibraryNames(String mappedLibName) { int extIndex = mappedLibName.lastIndexOf('.'); List<String> LIB_EXTENSIONS = generation.getBundleInfo().getStorage().getConfiguration().LIB_EXTENSIONS; if (LIB_EXTENSIONS.isEmpty() || extIndex < 0) return EMPTY_STRINGS; String libNameBase = mappedLibName.substring(0, extIndex); String[] results = new String[LIB_EXTENSIONS.size()]; for (int i = 0; i < results.length; i++) results[i] = libNameBase + LIB_EXTENSIONS.get(i); return results; }
void delete0(File delete) throws IOException { if (!StorageUtil.rm(delete, getConfiguration().getDebug().DEBUG_GENERAL)) { /* create .delete */ FileOutputStream out = new FileOutputStream(new File(delete, DELETE_FLAG)); out.close(); } }
@Override public ModuleClassLoader run() { return createClassLoaderPrivledged(cl, generation.getBundleInfo().getStorage().getConfiguration(), BundleLoader.this, generation, hooks); } });
@Override public ModuleClassLoader run() { return createClassLoaderPrivledged(cl, generation.getBundleInfo().getStorage().getConfiguration(), BundleLoader.this, generation, hooks); } });
@Override public String get(Object key) { if (cached.containsKey(key)) { return cached.get(key); } if (!cached.isEmpty() && generation.getBundleInfo().getStorage().getConfiguration().getDebug().DEBUG_CACHED_MANIFEST) { Debug.println("Header key is not cached: " + key + "; for bundle: " + generation.getBundleInfo().getBundleId()); //$NON-NLS-1$ //$NON-NLS-2$ } return generation.getRawHeaders().get(key); }
@Override public ModuleClassLoader run() { return createClassLoaderPrivledged(cl, generation.getBundleInfo().getStorage().getConfiguration(), BundleLoader.this, generation, hooks); } });
public NativeCodeFinder(Generation generation) { this.generation = generation; this.debug = generation.getBundleInfo().getStorage().getConfiguration().getDebug(); }
private void cleanOSGiStorage(Location location, File root) { if (location.isReadOnly() || !StorageUtil.rm(root, getConfiguration().getDebug().DEBUG_STORAGE)) { equinoxContainer.getLogServices().log(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, "The -clean (osgi.clean) option was not successful. Unable to clean the storage area: " + root.getAbsolutePath(), null); //$NON-NLS-1$ } if (!location.isReadOnly()) { // make sure to recreate to root folder root.mkdirs(); } }
private void cleanOSGiStorage(Location location, File root) { if (location.isReadOnly() || !StorageUtil.rm(root, getConfiguration().getDebug().DEBUG_GENERAL)) { equinoxContainer.getLogServices().log(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, "The -clean (osgi.clean) option was not successful. Unable to clean the storage area: " + root.getAbsolutePath(), null); //$NON-NLS-1$ } }
public BundleFile wrapBundleFile(BundleFile bundleFile, Generation generation, boolean isBase) { // try creating a wrapper bundlefile out of it. List<BundleFileWrapperFactoryHook> wrapperFactories = getConfiguration().getHookRegistry().getBundleFileWrapperFactoryHooks(); BundleFileWrapperChain wrapped = wrapperFactories.isEmpty() ? null : new BundleFileWrapperChain(bundleFile, null); for (BundleFileWrapperFactoryHook wrapperFactory : wrapperFactories) { BundleFileWrapper wrapperBundle = wrapperFactory.wrapBundleFile(bundleFile, generation, isBase); if (wrapperBundle != null && wrapperBundle != bundleFile) bundleFile = wrapped = new BundleFileWrapperChain(wrapperBundle, wrapped); } return bundleFile; }
private void cleanOSGiStorage(Location location, File root) { if (location.isReadOnly() || !StorageUtil.rm(root, getConfiguration().getDebug().DEBUG_STORAGE)) { equinoxContainer.getLogServices().log(EquinoxContainer.NAME, FrameworkLogEntry.ERROR, "The -clean (osgi.clean) option was not successful. Unable to clean the storage area: " + root.getAbsolutePath(), null); //$NON-NLS-1$ } }
@Override public String get(Object key) { if (cached.containsKey(key)) { return cached.get(key); } if (!cached.isEmpty() && generation.getBundleInfo().getStorage().getConfiguration().getDebug().DEBUG_CACHED_MANIFEST) { Debug.println("Header key is not cached: " + key + "; for bundle: " + generation.getBundleInfo().getBundleId()); //$NON-NLS-1$ //$NON-NLS-2$ } return generation.getRawHeaders().get(key); }
@Override public String get(Object key) { if (cached.containsKey(key)) { return cached.get(key); } if (!cached.isEmpty() && generation.getBundleInfo().getStorage().getConfiguration().getDebug().DEBUG_CACHED_MANIFEST) { Debug.println("Header key is not cached: " + key + "; for bundle: " + generation.getBundleInfo().getBundleId()); //$NON-NLS-1$ //$NON-NLS-2$ } return generation.getRawHeaders().get(key); }
private ManifestLocalization getManifestLocalization() { synchronized (genMonitor) { if (headerLocalization == null) { headerLocalization = new ManifestLocalization(this, getHeaders(), getStorage().getConfiguration().getConfiguration(EquinoxConfiguration.PROP_ROOT_LOCALE, "en")); //$NON-NLS-1$ } return headerLocalization; } }
@Override public String get(Object key) { if (cached.containsKey(key)) { return cached.get(key); } if (!cached.isEmpty() && generation.getBundleInfo().getStorage().getConfiguration().getDebug().DEBUG_CACHED_MANIFEST) { Debug.println("Header key is not cached: " + key + "; for bundle: " + generation.getBundleInfo().getBundleId()); //$NON-NLS-1$ //$NON-NLS-2$ } return generation.getRawHeaders().get(key); }
private ManifestLocalization getManifestLocalization() { synchronized (genMonitor) { if (headerLocalization == null) { headerLocalization = new ManifestLocalization(this, getHeaders(), getStorage().getConfiguration().getConfiguration(EquinoxConfiguration.PROP_ROOT_LOCALE, "en")); //$NON-NLS-1$ } return headerLocalization; } }
public File getDataFile(String path) { File dataRoot = getStorage().getFile(getBundleId() + "/" + Storage.BUNDLE_DATA_DIR, false); //$NON-NLS-1$ if (!Storage.secureAction.isDirectory(dataRoot) && (storage.isReadOnly() || !(Storage.secureAction.mkdirs(dataRoot) || Storage.secureAction.isDirectory(dataRoot)))) { if (getStorage().getConfiguration().getDebug().DEBUG_STORAGE) Debug.println("Unable to create bundle data directory: " + dataRoot.getAbsolutePath()); //$NON-NLS-1$ return null; } return path == null ? dataRoot : new File(dataRoot, path); }
public File getDataFile(String path) { File dataRoot = getStorage().getFile(getBundleId() + "/" + Storage.BUNDLE_DATA_DIR, false); //$NON-NLS-1$ if (!Storage.secureAction.isDirectory(dataRoot) && (storage.isReadOnly() || !(Storage.secureAction.mkdirs(dataRoot) || Storage.secureAction.isDirectory(dataRoot)))) { if (getStorage().getConfiguration().getDebug().DEBUG_GENERAL) Debug.println("Unable to create bundle data directory: " + dataRoot.getAbsolutePath()); //$NON-NLS-1$ return null; } return path == null ? dataRoot : new File(dataRoot, path); }