Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/SourceManipulator.java')
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/SourceManipulator.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/SourceManipulator.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/SourceManipulator.java
index df4d1e84f..baf93e77e 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/SourceManipulator.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/SourceManipulator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2010 IBM Corporation and others.
+ * Copyright (c) 2008, 2018 IBM Corporation and others.
*
* This
* program and the accompanying materials are made available under the terms of
@@ -13,7 +13,8 @@
******************************************************************************/
package org.eclipse.equinox.internal.p2.touchpoint.eclipse;
-import java.io.*;
+import java.io.File;
+import java.io.IOException;
import java.net.MalformedURLException;
import java.util.*;
import org.eclipse.equinox.frameworkadmin.BundleInfo;
@@ -21,10 +22,12 @@ import org.eclipse.equinox.internal.simpleconfigurator.manipulator.SimpleConfigu
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.metadata.Version;
import org.eclipse.equinox.simpleconfigurator.manipulator.SimpleConfiguratorManipulator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.FrameworkUtil;
//This class deals with source bundles and how their addition to the source.info
public class SourceManipulator {
- private List<BundleInfo> sourceBundles;
+ private Set<BundleInfo> sourceBundles;
private IProfile profile;
boolean changed = false;
private SimpleConfiguratorManipulatorImpl manipulator;
@@ -67,11 +70,8 @@ public class SourceManipulator {
}
private void load() throws MalformedURLException, IOException {
- if (getFileLocation().exists())
- //input stream is bufferd and closed for us
- sourceBundles = new ArrayList<BundleInfo>(Arrays.asList(manipulator.loadConfiguration(new FileInputStream(getFileLocation()), getLauncherLocation().toURI())));
- else
- sourceBundles = new ArrayList<BundleInfo>();
+ BundleContext context = FrameworkUtil.getBundle(this.getClass()).getBundleContext();
+ sourceBundles = new LinkedHashSet<>(Arrays.asList(manipulator.loadConfiguration(context, SimpleConfiguratorManipulator.SOURCE_INFO)));
}
private File getFileLocation() {

Back to the top