1 /*******************************************************************************
\r
2 * Copyright (c) 2007, 2009 IBM Corporation and others.
\r
3 * All rights reserved. This program and the accompanying materials
\r
4 * are made available under the terms of the Eclipse Public License v1.0
\r
5 * which accompanies this distribution, and is available at
\r
6 * http://www.eclipse.org/legal/epl-v10.html
\r
9 * IBM Corporation - initial API and implementation
\r
10 * Code 9 - ongoing development
\r
11 *******************************************************************************/
\r
12 package org.eclipse.equinox.internal.provisional.p2.installer;
\r
14 import java.net.URI;
\r
15 import java.util.HashMap;
\r
16 import java.util.Map;
\r
18 import org.eclipse.core.runtime.IPath;
\r
19 import org.eclipse.equinox.p2.metadata.IVersionedId;
\r
22 * An install information captures all the data needed to perform a product install.
\r
23 * This includes information on where the installed product comes from, what will
\r
24 * be installed, and where it will be installed.
\r
26 public class InstallDescription {
\r
27 private URI[] artifactRepos;
\r
28 private IPath installLocation;
\r
29 private IPath agentLocation;
\r
30 private IPath bundleLocation;
\r
31 private boolean isAutoStart;
\r
32 private String launcherName;
\r
33 private URI[] metadataRepos;
\r
34 private String productName;
\r
35 private IVersionedId[] roots;
\r
36 private final Map<String, String> profileProperties = new HashMap<String, String>();
\r
39 * Returns the p2 agent location, or <code>null</code> to indicate
\r
40 * the default agent location.
\r
42 public IPath getAgentLocation() {
\r
43 return agentLocation;
\r
47 * Returns the locations of the artifact repositories to install from
\r
48 * @return a list of artifact repository URLs
\r
50 public URI[] getArtifactRepositories() {
\r
51 return artifactRepos;
\r
55 * Returns the bundle pool location, or <code>null</code> to
\r
56 * indicate the default bundle pool location.
\r
58 public IPath getBundleLocation() {
\r
59 return bundleLocation;
\r
63 * Returns the local file system location to install into.
\r
64 * @return a local file system location
\r
66 public IPath getInstallLocation() {
\r
67 return installLocation;
\r
71 * Returns the name of the product's launcher executable
\r
72 * @return the name of the launcher executable
\r
74 public String getLauncherName() {
\r
75 return launcherName;
\r
79 * Returns the locations of the metadata repositories to install from
\r
80 * @return a list of metadata repository URLs
\r
82 public URI[] getMetadataRepositories() {
\r
83 return metadataRepos;
\r
87 * Returns the profile properties for this install.
\r
89 public Map<String, String> getProfileProperties() {
\r
90 return profileProperties;
\r
94 * Returns a human-readable name for this install.
\r
95 * @return the name of the product
\r
97 public String getProductName() {
\r
102 * Returns whether the installed product should be started upon successful
\r
104 * @return <code>true</code> if the product should be started upon successful
\r
105 * install, and <code>false</code> otherwise
\r
107 public boolean isAutoStart() {
\r
108 return isAutoStart;
\r
111 public void setAgentLocation(IPath agentLocation) {
\r
112 this.agentLocation = agentLocation;
\r
115 public void setArtifactRepositories(URI[] value) {
\r
116 this.artifactRepos = value;
\r
119 public void setAutoStart(boolean value) {
\r
120 this.isAutoStart = value;
\r
123 public void setBundleLocation(IPath bundleLocation) {
\r
124 this.bundleLocation = bundleLocation;
\r
127 public void setInstallLocation(IPath location) {
\r
128 this.installLocation = location;
\r
131 public void setLauncherName(String name) {
\r
132 this.launcherName = name;
\r
135 public void setMetadataRepositories(URI[] value) {
\r
136 this.metadataRepos = value;
\r
140 * Supplies a set of profile properties to be added when the profile is created.
\r
141 * @param properties the profile properties to be added
\r
143 public void setProfileProperties(Map<String, String> properties) {
\r
144 profileProperties.putAll(properties);
\r
148 * Returns the set of roots to be installed for this installation
\r
149 * @return the roots to install
\r
151 public IVersionedId[] getRoots() {
\r
156 * Set the list of roots to install
\r
157 * @param value the set of roots to install
\r
159 public void setRoots(IVersionedId[] value) {
\r
164 * Set the name of the product being installed.
\r
165 * @param value the new name of the product to install
\r
167 public void setProductName(String value) {
\r
168 productName = value;
\r