/** * Returns whether the current environment is a development environment. * * @return <code>true</code> if the current environment is a development environment */ public boolean isDevelopment() { if (developmentEnvironment == null) { File bundleFile = null; try { bundleFile = FileLocator.getBundleFile(getBundle()); if ((bundleFile != null) && bundleFile.isDirectory()) { developmentEnvironment = Boolean.TRUE; } else { developmentEnvironment = Boolean.FALSE; } } catch (IOException e) { developmentEnvironment = Boolean.FALSE; } } return developmentEnvironment.booleanValue(); }
/** Replies the path of the binary files of the given bundle. * * @param bundle the bundle for which the path must be retreived. * @return the path to the binaries of the bundle. * @see #getSourceBundlePath(Bundle, IPath) */ public static IPath getBundlePath(Bundle bundle) { IPath path = getBinFolderPath(bundle); if (path == null) { // common jar file case, no bin folder try { path = new Path(FileLocator.getBundleFile(bundle).getAbsolutePath()); } catch (IOException e) { throw new RuntimeException(e); } } return path; }
public IClasspathEntry[] resolveClasspathContainer(IProject project, IRuntime runtime) { List<IClasspathEntry> cp = new ArrayList<IClasspathEntry>(2); for (String id : CP_BUNDLES) { Bundle bundle = Platform.getBundle(id); try { File file = FileLocator.getBundleFile(bundle); Path path = new Path(file.getCanonicalPath()); cp.add(JavaCore.newLibraryEntry(path, null, null)); } catch (IOException e) { // ignore } } return cp.toArray(new IClasspathEntry[0]); }
final File bundleFile; try { bundleFile= FileLocator.getBundleFile(annotationsBundle); } catch (IOException e) { JavaPlugin.log(e);
final File bundleFile; try { bundleFile= FileLocator.getBundleFile(annotationsBundle); } catch (IOException e) { JavaPlugin.log(e);
LogHelper.log(new Status(IStatus.INFO, Activator.ID, Messages.message_noSimpleconfigurator)); else { File location = FileLocator.getBundleFile(simpleConfigBundle); result[result.length - 1] = createBundleDescription(location);
bInfos[i] = new BundleInfo(bundles[i].getSymbolicName(), bundles[i].getHeaders("").get(Constants.BUNDLE_VERSION), FileLocator.getBundleFile(bundles[i]).getAbsoluteFile().toURI(), -1, true); //$NON-NLS-1$ else { bInfos[i] = new BundleInfo(bundles[i].getSymbolicName(), bundles[i].getHeaders("").get(Constants.BUNDLE_VERSION), FileLocator.getBundleFile(bundles[i]).getAbsoluteFile().toURI(), startLevel.getBundleStartLevel(bundles[i]), startLevel.isBundlePersistentlyStarted(bundles[i])); //$NON-NLS-1$
bInfos[i] = new BundleInfo(bundles[i].getSymbolicName(), (String) bundles[i].getHeaders().get(Constants.BUNDLE_VERSION), FileLocator.getBundleFile(bundles[i]).getAbsoluteFile().toURI(), -1, true); else { bInfos[i] = new BundleInfo(bundles[i].getSymbolicName(), (String) bundles[i].getHeaders().get(Constants.BUNDLE_VERSION), FileLocator.getBundleFile(bundles[i]).getAbsoluteFile().toURI(), startLevel.getBundleStartLevel(bundles[i]), startLevel.isBundlePersistentlyStarted(bundles[i]));