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/AgentFromInstall.java')
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/AgentFromInstall.java54
1 files changed, 33 insertions, 21 deletions
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/AgentFromInstall.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/AgentFromInstall.java
index 66cbafa27..ed3090ac8 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/AgentFromInstall.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/AgentFromInstall.java
@@ -21,38 +21,48 @@ import org.eclipse.equinox.internal.provisional.frameworkadmin.*;
import org.eclipse.equinox.p2.core.*;
/**
- * Given an eclipse installation folder and / or an eclipse configuration folder,
- * this class creates the agent representing the system point at.
+ * Given an eclipse installation folder and / or an eclipse configuration
+ * folder, this class creates the agent representing the system point at.
*/
public class AgentFromInstall {
- //Input
+ // Input
private File configurationFolder;
private File installFolder;
private IProvisioningAgentProvider agentProvider;
- //Figured out
+ // Figured out
private String profileId;
private String p2DataAreaURI;
private String userSpecifiedProfileId;
- private AgentFromInstall(IProvisioningAgentProvider agentProvider, File installFolder, File configurationFolder, String profileId) {
+ private AgentFromInstall(IProvisioningAgentProvider agentProvider, File installFolder, File configurationFolder,
+ String profileId) {
this.installFolder = installFolder;
this.configurationFolder = configurationFolder;
this.agentProvider = agentProvider;
this.userSpecifiedProfileId = profileId;
}
- /**
- * Creates an agent deriving the p2 data area from the information contained in the installFolder or the configurationFolder.
- * In the returned agent, the services will be initialized such that the SELF variable is bound to the default profile referred to in the configuration files.
- *
- * @param agentProvider an instance of an agent provider from which the agent will be created.
- * @param installFolder null or a file referring to the installation folder of eclipse.
- * @param configurationFolder null or a file referring to the configuration folder of eclipse.
- * @param profileId null or the name of the expected profile. This value is used when the detection of the profile id from the configuration file does not succeed.
+ /**
+ * Creates an agent deriving the p2 data area from the information contained in
+ * the installFolder or the configurationFolder. In the returned agent, the
+ * services will be initialized such that the SELF variable is bound to the
+ * default profile referred to in the configuration files.
+ *
+ * @param agentProvider an instance of an agent provider from which the
+ * agent will be created.
+ * @param installFolder null or a file referring to the installation
+ * folder of eclipse.
+ * @param configurationFolder null or a file referring to the configuration
+ * folder of eclipse.
+ * @param profileId null or the name of the expected profile. This
+ * value is used when the detection of the profile id
+ * from the configuration file does not succeed.
*/
- static public IProvisioningAgent createAgentFrom(IProvisioningAgentProvider agentProvider, File installFolder, File configurationFolder, String profileId) {
- AgentFromInstall newInstance = new AgentFromInstall(agentProvider, installFolder, configurationFolder, profileId);
+ static public IProvisioningAgent createAgentFrom(IProvisioningAgentProvider agentProvider, File installFolder,
+ File configurationFolder, String profileId) {
+ AgentFromInstall newInstance = new AgentFromInstall(agentProvider, installFolder, configurationFolder,
+ profileId);
return newInstance.loadAgent();
}
@@ -78,11 +88,12 @@ public class AgentFromInstall {
try {
agent = agentProvider.createAgent(URIUtil.fromString(p2DataAreaURI));
} catch (ProvisionException e) {
- //Can't happen
+ // Can't happen
} catch (URISyntaxException e) {
- //Can't happen since we are always constructing the string from code that manipulate files (included the code in the Manipulator)
+ // Can't happen since we are always constructing the string from code that
+ // manipulate files (included the code in the Manipulator)
}
- agent.registerService("FORCED_SELF", profileId);
+ agent.registerService("FORCED_SELF", profileId); //$NON-NLS-1$
return agent;
}
@@ -92,7 +103,8 @@ public class AgentFromInstall {
return false;
Manipulator manipulator = fwk.getManipulator();
LauncherData launcherData = manipulator.getLauncherData();
- launcherData.setFwConfigLocation(configurationFolder != null ? configurationFolder : new File(installFolder, "configuration/config.ini")); //$NON-NLS-1$
+ launcherData.setFwConfigLocation(configurationFolder != null ? configurationFolder
+ : new File(installFolder, "configuration/config.ini")); //$NON-NLS-1$
launcherData.setHome(installFolder);
try {
manipulator.load();
@@ -121,11 +133,11 @@ public class AgentFromInstall {
}
}
- private File getProfileRegistryFolder(File p2Folder) {
+ private static File getProfileRegistryFolder(File p2Folder) {
return new File(p2Folder, "org.eclipse.equinox.p2.engine/profileRegistry/"); //$NON-NLS-1$
}
- private String findProfile(File profileDirectory) {
+ private static String findProfile(File profileDirectory) {
final String PROFILE_EXT = ".profile"; //$NON-NLS-1$
File[] profileDirectories = profileDirectory.listFiles(new FileFilter() {
@Override

Back to the top