Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.touchpoint.natives')
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/.classpath4
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/.settings/org.eclipse.jdt.core.prefs16
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/META-INF/MANIFEST.MF15
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/build.properties2
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/BackupStore.java12
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/NativeTouchpoint.java24
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/Util.java41
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/ActionConstants.java1
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/ChmodAction.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/CleanupcopyAction.java17
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/CleanupzipAction.java22
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/CollectAction.java38
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/CopyAction.java20
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/LinkAction.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/MkdirAction.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/RemoveAction.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/RmdirAction.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/UnzipAction.java12
18 files changed, 137 insertions, 121 deletions
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.natives/.classpath b/bundles/org.eclipse.equinox.p2.touchpoint.natives/.classpath
index 7cdeb7319..64c5e31b7 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.natives/.classpath
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.natives/.classpath
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/CDC-1.1%Foundation-1.1"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.natives/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.p2.touchpoint.natives/.settings/org.eclipse.jdt.core.prefs
index 78523cd05..c98f1d59f 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.natives/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.natives/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,4 @@
-#Thu Aug 16 11:00:59 EDT 2007
+#Tue Dec 22 23:15:07 CET 2009
eclipse.preferences.version=1
org.eclipse.jdt.core.builder.cleanOutputFolder=clean
org.eclipse.jdt.core.builder.duplicateResourceTask=warning
@@ -7,24 +7,24 @@ org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
org.eclipse.jdt.core.circularClasspath=error
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=jsr14
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=error
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
@@ -62,7 +62,6 @@ org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
org.eclipse.jdt.core.compiler.problem.unusedImport=error
@@ -72,7 +71,7 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=en
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.compiler.source=1.5
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
@@ -144,7 +143,6 @@ org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
org.eclipse.jdt.core.formatter.indentation.size=4
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.natives/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.touchpoint.natives/META-INF/MANIFEST.MF
index edb4e9e6d..ddcf469c1 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.natives/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.natives/META-INF/MANIFEST.MF
@@ -8,17 +8,20 @@ Bundle-Version: 1.0.200.qualifier
Bundle-Activator: org.eclipse.equinox.internal.p2.touchpoint.natives.Activator
Import-Package: org.eclipse.equinox.internal.p2.core.helpers,
org.eclipse.equinox.internal.p2.engine,
- org.eclipse.equinox.internal.provisional.p2.artifact.repository,
org.eclipse.equinox.internal.provisional.p2.core,
- org.eclipse.equinox.internal.provisional.p2.core.location,
- org.eclipse.equinox.internal.provisional.p2.engine,
org.eclipse.equinox.internal.provisional.p2.metadata,
- org.eclipse.equinox.internal.provisional.p2.repository,
+ org.eclipse.equinox.p2.core,
+ org.eclipse.equinox.p2.engine,
+ org.eclipse.equinox.p2.engine.spi,
+ org.eclipse.equinox.p2.metadata,
+ org.eclipse.equinox.p2.repository,
+ org.eclipse.equinox.p2.repository.artifact,
org.eclipse.osgi.util;version="1.0.0",
org.osgi.framework;version="1.3.0"
Bundle-ActivationPolicy: lazy
Require-Bundle: org.eclipse.equinox.common
-Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1,
- J2SE-1.4
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,
+ J2SE-1.4,
+ CDC-1.1/Foundation-1.1
Export-Package: org.eclipse.equinox.internal.p2.touchpoint.natives;x-internal:=true,
org.eclipse.equinox.internal.p2.touchpoint.natives.actions;x-internal:=true
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.natives/build.properties b/bundles/org.eclipse.equinox.p2.touchpoint.natives/build.properties
index 4bbd9bd55..0328daa18 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.natives/build.properties
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.natives/build.properties
@@ -16,3 +16,5 @@ bin.includes = META-INF/,\
about.html,\
plugin.properties
src.includes = about.html
+javacTarget=jsr14
+javacSource=1.5
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/BackupStore.java b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/BackupStore.java
index 29fdbfdd1..82a3503cf 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/BackupStore.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/BackupStore.java
@@ -406,7 +406,7 @@ public class BackupStore implements IBackupStore {
throw new ClosedBackupStoreException(Messages.BackupStore_restore_closed_store);
// put back all files
// collect things that could not be restored (so final status can be reported)
- Set unrestorable = new HashSet();
+ Set<File> unrestorable = new HashSet<File>();
boolean restored = true;
if (!backupRoot.exists()) {
logError(NLS.bind(Messages.BackupStore_missing_backup_directory, backupRoot.getAbsolutePath()));
@@ -421,12 +421,12 @@ public class BackupStore implements IBackupStore {
closed = true;
}
- private void logUnrestorables(Set unrestorable) {
+ private void logUnrestorables(Set<File> unrestorable) {
// if there are unrestorable units log them
//
if (unrestorable != null && unrestorable.size() > 0) {
- for (Iterator itor = unrestorable.iterator(); itor.hasNext();)
- logError(NLS.bind(Messages.BackupStore_manual_restore_needed, ((File) itor.next()).getAbsolutePath()));
+ for (File file : unrestorable)
+ logError(NLS.bind(Messages.BackupStore_manual_restore_needed, file.getAbsolutePath()));
}
}
@@ -509,7 +509,7 @@ public class BackupStore implements IBackupStore {
return file.delete();
}
- private void restore(File root, File buRoot, Set unrestorable) {
+ private void restore(File root, File buRoot, Set<File> unrestorable) {
File[] children = buRoot.listFiles();
if (children == null) { // error - can't read the backup directory
unrestorable.add(buRoot);
@@ -576,7 +576,7 @@ public class BackupStore implements IBackupStore {
* @param buRoot
* @param unrestorable
*/
- private void restoreRoots(File buRoot, Set unrestorable) {
+ private void restoreRoots(File buRoot, Set<File> unrestorable) {
File[] children = buRoot.listFiles();
if (children == null) { // error - can't read the backup directory
unrestorable.add(buRoot);
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/NativeTouchpoint.java b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/NativeTouchpoint.java
index fe9b9cd4e..7e59d227e 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/NativeTouchpoint.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/NativeTouchpoint.java
@@ -10,15 +10,20 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.touchpoint.natives;
+import org.eclipse.equinox.p2.core.ProvisionException;
+
import java.io.File;
import java.io.IOException;
import java.util.Map;
import java.util.WeakHashMap;
import org.eclipse.core.runtime.*;
-import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IFileArtifactRepository;
-import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
-import org.eclipse.equinox.internal.provisional.p2.engine.*;
-import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey;
+import org.eclipse.equinox.internal.p2.touchpoint.natives.actions.ActionConstants;
+import org.eclipse.equinox.p2.core.IProvisioningAgent;
+import org.eclipse.equinox.p2.engine.IProfile;
+import org.eclipse.equinox.p2.engine.Operand;
+import org.eclipse.equinox.p2.engine.spi.Touchpoint;
+import org.eclipse.equinox.p2.metadata.IArtifactKey;
+import org.eclipse.equinox.p2.repository.artifact.IFileArtifactRepository;
import org.eclipse.osgi.util.NLS;
public class NativeTouchpoint extends Touchpoint {
@@ -29,13 +34,14 @@ public class NativeTouchpoint extends Touchpoint {
public static final String PARM_ARTIFACT_LOCATION = "artifact.location"; //$NON-NLS-1$
- private static Map backups = new WeakHashMap();
+ private static Map<IProfile, IBackupStore> backups = new WeakHashMap<IProfile, IBackupStore>();
- public IStatus initializeOperand(IProfile profile, Operand operand, Map parameters) {
+ public IStatus initializeOperand(IProfile profile, Operand operand, Map<String, Object> parameters) {
+ IProvisioningAgent agent = (IProvisioningAgent) parameters.get(ActionConstants.PARM_AGENT);
IArtifactKey artifactKey = (IArtifactKey) parameters.get(PARM_ARTIFACT);
if (!parameters.containsKey(PARM_ARTIFACT_LOCATION) && artifactKey != null) {
try {
- IFileArtifactRepository downloadCache = Util.getDownloadCacheRepo();
+ IFileArtifactRepository downloadCache = Util.getDownloadCacheRepo(agent);
File fileLocation = downloadCache.getArtifactFile(artifactKey);
if (fileLocation != null && fileLocation.exists())
parameters.put(PARM_ARTIFACT_LOCATION, fileLocation.getAbsolutePath());
@@ -46,7 +52,7 @@ public class NativeTouchpoint extends Touchpoint {
return Status.OK_STATUS;
}
- public IStatus initializePhase(IProgressMonitor monitor, IProfile profile, String phaseId, Map touchpointParameters) {
+ public IStatus initializePhase(IProgressMonitor monitor, IProfile profile, String phaseId, Map<String, Object> touchpointParameters) {
touchpointParameters.put(PARM_BACKUP, getBackupStore(profile));
return null;
}
@@ -124,7 +130,7 @@ public class NativeTouchpoint extends Touchpoint {
* @return a lazily initialized backup store
*/
private static synchronized IBackupStore getBackupStore(IProfile profile) {
- IBackupStore store = (IBackupStore) backups.get(profile);
+ IBackupStore store = backups.get(profile);
if (store == null) {
store = new LazyBackupStore(escape(profile.getProfileId()));
backups.put(profile, store);
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/Util.java b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/Util.java
index b9f79725f..84f45cb91 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/Util.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/Util.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.touchpoint.natives;
+import org.eclipse.equinox.p2.core.ProvisionException;
+
import java.io.*;
import java.net.URI;
import java.util.*;
@@ -17,12 +19,11 @@ import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.core.helpers.LogHelper;
-import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
-import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*;
-import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
-import org.eclipse.equinox.internal.provisional.p2.core.location.AgentLocation;
-import org.eclipse.equinox.internal.provisional.p2.engine.IProfile;
-import org.eclipse.equinox.internal.provisional.p2.repository.IRepository;
+import org.eclipse.equinox.p2.core.IAgentLocation;
+import org.eclipse.equinox.p2.core.IProvisioningAgent;
+import org.eclipse.equinox.p2.engine.IProfile;
+import org.eclipse.equinox.p2.repository.IRepository;
+import org.eclipse.equinox.p2.repository.artifact.*;
import org.eclipse.osgi.util.NLS;
public class Util {
@@ -39,19 +40,19 @@ public class Util {
return profile.getProperty(IProfile.PROP_INSTALL_FOLDER);
}
- private static AgentLocation getAgentLocation() {
- return (AgentLocation) ServiceHelper.getService(Activator.getContext(), AgentLocation.class.getName());
+ private static IAgentLocation getAgentLocation(IProvisioningAgent agent) {
+ return (IAgentLocation) agent.getService(IAgentLocation.class.getName());
}
- public static IArtifactRepositoryManager getArtifactRepositoryManager() {
- return (IArtifactRepositoryManager) ServiceHelper.getService(Activator.getContext(), IArtifactRepositoryManager.class.getName());
+ public static IArtifactRepositoryManager getArtifactRepositoryManager(IProvisioningAgent agent) {
+ return (IArtifactRepositoryManager) agent.getService(IArtifactRepositoryManager.SERVICE_NAME);
}
- public static IFileArtifactRepository getDownloadCacheRepo() throws ProvisionException {
- URI location = getDownloadCacheLocation();
+ public static IFileArtifactRepository getDownloadCacheRepo(IProvisioningAgent agent) throws ProvisionException {
+ URI location = getDownloadCacheLocation(agent);
if (location == null)
throw new IllegalStateException(Messages.could_not_obtain_download_cache);
- IArtifactRepositoryManager manager = getArtifactRepositoryManager();
+ IArtifactRepositoryManager manager = getArtifactRepositoryManager(agent);
if (manager == null)
throw new IllegalStateException(Messages.artifact_repo_not_found);
IArtifactRepository repository;
@@ -60,7 +61,7 @@ public class Util {
} catch (ProvisionException e) {
// the download cache doesn't exist or couldn't be read. Create new cache.
String repositoryName = location + " - Agent download cache"; //$NON-NLS-1$
- Map properties = new HashMap(1);
+ Map<String, String> properties = new HashMap<String, String>(1);
properties.put(IRepository.PROP_SYSTEM, Boolean.TRUE.toString());
repository = manager.createRepository(location, repositoryName, IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties);
}
@@ -71,9 +72,11 @@ public class Util {
return downloadCache;
}
- static private URI getDownloadCacheLocation() {
- AgentLocation location = getAgentLocation();
- return (location != null ? location.getArtifactRepositoryURI() : null);
+ static private URI getDownloadCacheLocation(IProvisioningAgent agent) {
+ IAgentLocation location = getAgentLocation(agent);
+ if (location == null)
+ return null;
+ return URIUtil.append(location.getDataArea("org.eclipse.equinox.p2.core"), "cache/"); //$NON-NLS-1$ //$NON-NLS-2$
}
/**
@@ -106,7 +109,7 @@ public class Util {
in.close();
throw new IOException(Messages.Util_Invalid_Zip_File_Format);
}
- ArrayList unzippedFiles = new ArrayList();
+ ArrayList<File> unzippedFiles = new ArrayList<File>();
do {
File outFile = new File(outputDir, ze.getName());
unzippedFiles.add(outFile);
@@ -133,7 +136,7 @@ public class Util {
} while ((ze = in.getNextEntry()) != null);
in.close();
- return (File[]) unzippedFiles.toArray(new File[unzippedFiles.size()]);
+ return unzippedFiles.toArray(new File[unzippedFiles.size()]);
}
/**
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/ActionConstants.java b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/ActionConstants.java
index 39cb3b390..de10738bf 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/ActionConstants.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/ActionConstants.java
@@ -12,6 +12,7 @@ package org.eclipse.equinox.internal.p2.touchpoint.natives.actions;
public class ActionConstants {
+ public static final String PARM_AGENT = "agent"; //$NON-NLS-1$
public static final String PARM_PATH = "path"; //$NON-NLS-1$
public static final String PARM_TARGET_FILE = "targetFile"; //$NON-NLS-1$
public static final String PARM_PERMISSIONS = "permissions"; //$NON-NLS-1$
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/ChmodAction.java b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/ChmodAction.java
index c08a76180..b9d5d5b1b 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/ChmodAction.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/ChmodAction.java
@@ -18,13 +18,13 @@ import java.util.Map;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.touchpoint.natives.Messages;
import org.eclipse.equinox.internal.p2.touchpoint.natives.Util;
-import org.eclipse.equinox.internal.provisional.p2.engine.ProvisioningAction;
+import org.eclipse.equinox.p2.engine.spi.ProvisioningAction;
import org.eclipse.osgi.util.NLS;
public class ChmodAction extends ProvisioningAction {
private static final String ACTION_CHMOD = "chmod"; //$NON-NLS-1$
- public IStatus execute(Map parameters) {
+ public IStatus execute(Map<String, Object> parameters) {
String targetDir = (String) parameters.get(ActionConstants.PARM_TARGET_DIR);
if (targetDir == null)
return Util.createError(NLS.bind(Messages.param_not_set, ActionConstants.PARM_TARGET_DIR, ACTION_CHMOD));
@@ -43,7 +43,7 @@ public class ChmodAction extends ProvisioningAction {
String options[] = null;
if (optionsString != null) {
- ArrayList collect = new ArrayList();
+ ArrayList<String> collect = new ArrayList<String>();
String r = optionsString.trim();
while (r.length() > 0) {
int spaceIdx = r.indexOf(' ');
@@ -66,7 +66,7 @@ public class ChmodAction extends ProvisioningAction {
return Status.OK_STATUS;
}
- public IStatus undo(Map parameters) {
+ public IStatus undo(Map<String, Object> parameters) {
//TODO: implement undo ??
return Status.OK_STATUS;
}
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/CleanupcopyAction.java b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/CleanupcopyAction.java
index 862c52963..b394f0adf 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/CleanupcopyAction.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/CleanupcopyAction.java
@@ -16,20 +16,20 @@ import java.util.*;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.equinox.internal.p2.touchpoint.natives.*;
-import org.eclipse.equinox.internal.provisional.p2.engine.IProfile;
-import org.eclipse.equinox.internal.provisional.p2.engine.ProvisioningAction;
-import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.engine.IProfile;
+import org.eclipse.equinox.p2.engine.spi.ProvisioningAction;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.osgi.util.NLS;
public class CleanupcopyAction extends ProvisioningAction {
public static final String ACTION_CLEANUPCOPY = "cleanupcopy"; //$NON-NLS-1$
- public IStatus execute(Map parameters) {
+ public IStatus execute(Map<String, Object> parameters) {
return cleanupcopy(parameters, true);
}
- public IStatus undo(Map parameters) {
+ public IStatus undo(Map<String, Object> parameters) {
return CopyAction.copy(parameters, false);
}
@@ -39,7 +39,7 @@ public class CleanupcopyAction extends ProvisioningAction {
* @param restoreable flag indicating if the operation should be backed up
* @return status
*/
- public static IStatus cleanupcopy(Map parameters, boolean restoreable) {
+ public static IStatus cleanupcopy(Map<String, Object> parameters, boolean restoreable) {
String source = (String) parameters.get(ActionConstants.PARM_SOURCE);
if (source == null)
return Util.createError(NLS.bind(Messages.param_not_set, ActionConstants.PARM_SOURCE, ACTION_CLEANUPCOPY));
@@ -57,7 +57,7 @@ public class CleanupcopyAction extends ProvisioningAction {
return Status.OK_STATUS;
StringTokenizer tokenizer = new StringTokenizer(copied, ActionConstants.PIPE);
- List directories = new ArrayList();
+ List<File> directories = new ArrayList<File>();
while (tokenizer.hasMoreTokens()) {
String fileName = tokenizer.nextToken();
File file = new File(fileName);
@@ -80,8 +80,7 @@ public class CleanupcopyAction extends ProvisioningAction {
}
}
- for (Iterator it = directories.iterator(); it.hasNext();) {
- File directory = (File) it.next();
+ for (File directory : directories) {
File[] children = directory.listFiles();
if (children == null)
return Util.createError(NLS.bind(Messages.Error_list_children_0, directory));
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/CleanupzipAction.java b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/CleanupzipAction.java
index c5938e749..e442d4465 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/CleanupzipAction.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/CleanupzipAction.java
@@ -17,8 +17,8 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.equinox.internal.p2.engine.Profile;
import org.eclipse.equinox.internal.p2.touchpoint.natives.*;
-import org.eclipse.equinox.internal.provisional.p2.engine.ProvisioningAction;
-import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.engine.spi.ProvisioningAction;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.osgi.util.NLS;
public class CleanupzipAction extends ProvisioningAction {
@@ -26,15 +26,15 @@ public class CleanupzipAction extends ProvisioningAction {
private static final String UNZIPPED = "unzipped"; //$NON-NLS-1$
public static final String ACTION_CLEANUPZIP = "cleanupzip"; //$NON-NLS-1$
- public IStatus execute(Map parameters) {
+ public IStatus execute(Map<String, Object> parameters) {
return cleanupzip(parameters, true);
}
- public IStatus undo(Map parameters) {
+ public IStatus undo(Map<String, Object> parameters) {
return UnzipAction.unzip(parameters, false);
}
- public static IStatus cleanupzip(Map parameters, boolean restoreable) {
+ public static IStatus cleanupzip(Map<String, Object> parameters, boolean restoreable) {
String source = (String) parameters.get(ActionConstants.PARM_SOURCE);
if (source == null)
return Util.createError(NLS.bind(Messages.param_not_set, ActionConstants.PARM_SOURCE, ACTION_CLEANUPZIP));
@@ -51,15 +51,14 @@ public class CleanupzipAction extends ProvisioningAction {
if (unzipped == null) {
// best effort
// we try to substitute the current target with what was written.
- Map iuProperties = profile.getInstallableUnitProperties(iu);
+ Map<String, String> iuProperties = profile.getInstallableUnitProperties(iu);
String sourcePrefix = UNZIPPED + ActionConstants.PIPE + source + ActionConstants.PIPE;
- for (Iterator iterator = iuProperties.keySet().iterator(); iterator.hasNext();) {
- String key = (String) iterator.next();
+ for (String key : iuProperties.keySet()) {
if (key.startsWith(sourcePrefix)) {
if (unzipped == null) {
iuPropertyKey = key;
String storedTarget = key.substring(sourcePrefix.length());
- unzipped = substituteTarget(storedTarget, target, (String) iuProperties.get(key));
+ unzipped = substituteTarget(storedTarget, target, iuProperties.get(key));
} else
return Status.OK_STATUS; // possible two unzips of this source - give up on best effort
}
@@ -71,7 +70,7 @@ public class CleanupzipAction extends ProvisioningAction {
IBackupStore store = restoreable ? (IBackupStore) parameters.get(NativeTouchpoint.PARM_BACKUP) : null;
StringTokenizer tokenizer = new StringTokenizer(unzipped, ActionConstants.PIPE);
- List directories = new ArrayList();
+ List<File> directories = new ArrayList<File>();
while (tokenizer.hasMoreTokens()) {
String fileName = tokenizer.nextToken();
File file = new File(fileName);
@@ -96,8 +95,7 @@ public class CleanupzipAction extends ProvisioningAction {
// the leafs first in the list of directories.
// Since backup will deny backup of non empty directory a check must be made
//
- for (Iterator it = directories.iterator(); it.hasNext();) {
- File directory = (File) it.next();
+ for (File directory : directories) {
if (store != null) {
File[] children = directory.listFiles();
if (children == null || children.length == 0)
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/CollectAction.java b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/CollectAction.java
index 6fbf20b84..9626bb4c4 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/CollectAction.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/CollectAction.java
@@ -10,28 +10,34 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.touchpoint.natives.actions;
+import org.eclipse.equinox.p2.core.ProvisionException;
+
import java.util.Collection;
import java.util.Map;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.equinox.internal.p2.touchpoint.natives.Util;
-import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepository;
-import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRequest;
-import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
-import org.eclipse.equinox.internal.provisional.p2.engine.*;
-import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey;
-import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.core.IProvisioningAgent;
+import org.eclipse.equinox.p2.engine.IProfile;
+import org.eclipse.equinox.p2.engine.InstallableUnitOperand;
+import org.eclipse.equinox.p2.engine.spi.ProvisioningAction;
+import org.eclipse.equinox.p2.metadata.IArtifactKey;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository;
+import org.eclipse.equinox.p2.repository.artifact.IArtifactRequest;
public class CollectAction extends ProvisioningAction {
public static final String ACTION_COLLECT = "collect"; //$NON-NLS-1$
- public IStatus execute(Map parameters) {
+ public IStatus execute(Map<String, Object> parameters) {
IProfile profile = (IProfile) parameters.get(ActionConstants.PARM_PROFILE);
+ IProvisioningAgent agent = (IProvisioningAgent) parameters.get(ActionConstants.PARM_AGENT);
InstallableUnitOperand operand = (InstallableUnitOperand) parameters.get(ActionConstants.PARM_OPERAND);
try {
- IArtifactRequest[] requests = collect(operand.second(), profile);
- Collection artifactRequests = (Collection) parameters.get(ActionConstants.PARM_ARTIFACT_REQUESTS);
+ IArtifactRequest[] requests = collect(agent, operand.second(), profile);
+ @SuppressWarnings("unchecked")
+ Collection<IArtifactRequest[]> artifactRequests = (Collection<IArtifactRequest[]>) parameters.get(ActionConstants.PARM_ARTIFACT_REQUESTS);
artifactRequests.add(requests);
} catch (ProvisionException e) {
return e.getStatus();
@@ -39,21 +45,21 @@ public class CollectAction extends ProvisioningAction {
return Status.OK_STATUS;
}
- public IStatus undo(Map parameters) {
+ public IStatus undo(Map<String, Object> parameters) {
// nothing to do for now
return Status.OK_STATUS;
}
- IArtifactRequest[] collect(IInstallableUnit installableUnit, IProfile profile) throws ProvisionException {
- IArtifactKey[] toDownload = installableUnit.getArtifacts();
+ IArtifactRequest[] collect(IProvisioningAgent agent, IInstallableUnit installableUnit, IProfile profile) throws ProvisionException {
+ Collection<IArtifactKey> toDownload = installableUnit.getArtifacts();
if (toDownload == null)
return new IArtifactRequest[0];
- IArtifactRepository destination = Util.getDownloadCacheRepo();
- IArtifactRequest[] requests = new IArtifactRequest[toDownload.length];
+ IArtifactRepository destination = Util.getDownloadCacheRepo(agent);
+ IArtifactRequest[] requests = new IArtifactRequest[toDownload.size()];
int count = 0;
- for (int i = 0; i < toDownload.length; i++) {
+ for (IArtifactKey key : toDownload) {
//TODO Here there are cases where the download is not necessary again because what needs to be done is just a configuration step
- requests[count++] = Util.getArtifactRepositoryManager().createMirrorRequest(toDownload[i], destination, null, null);
+ requests[count++] = Util.getArtifactRepositoryManager(agent).createMirrorRequest(key, destination, null, null);
}
if (requests.length == count)
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/CopyAction.java b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/CopyAction.java
index 6e9b0395d..d9dab3c98 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/CopyAction.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/CopyAction.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.touchpoint.natives.actions;
+import java.io.File;
+
import java.io.*;
import java.util.ArrayList;
import java.util.Map;
@@ -17,9 +19,9 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.equinox.internal.p2.engine.Profile;
import org.eclipse.equinox.internal.p2.touchpoint.natives.*;
-import org.eclipse.equinox.internal.provisional.p2.engine.ProvisioningAction;
-import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey;
-import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.engine.spi.ProvisioningAction;
+import org.eclipse.equinox.p2.metadata.IArtifactKey;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.osgi.util.NLS;
/**
@@ -33,7 +35,7 @@ import org.eclipse.osgi.util.NLS;
public class CopyAction extends ProvisioningAction {
public static final String ID = "cp"; //$NON-NLS-1$
- public IStatus execute(Map parameters) {
+ public IStatus execute(Map<String, Object> parameters) {
return copy(parameters, true);
}
@@ -43,7 +45,7 @@ public class CopyAction extends ProvisioningAction {
* @param restoreable flag indicating if the operation should be backed up
* @return status
*/
- public static IStatus copy(Map parameters, boolean restoreable) {
+ public static IStatus copy(Map<String, Object> parameters, boolean restoreable) {
String target = (String) parameters.get(ActionConstants.PARM_COPY_TARGET);
IBackupStore backupStore = restoreable ? (IBackupStore) parameters.get(NativeTouchpoint.PARM_BACKUP) : null;
@@ -86,7 +88,7 @@ public class CopyAction extends ProvisioningAction {
return Status.OK_STATUS;
}
- public IStatus undo(Map parameters) {
+ public IStatus undo(Map<String, Object> parameters) {
return CleanupcopyAction.cleanupcopy(parameters, false);
}
@@ -98,9 +100,9 @@ public class CopyAction extends ProvisioningAction {
* @throws IOException
*/
private static File[] mergeCopy(File source, File target, boolean overwrite, IBackupStore backupStore) throws IOException {
- ArrayList copiedFiles = new ArrayList();
+ ArrayList<File> copiedFiles = new ArrayList<File>();
xcopy(copiedFiles, source, target, overwrite, backupStore);
- return (File[]) copiedFiles.toArray(new File[copiedFiles.size()]);
+ return copiedFiles.toArray(new File[copiedFiles.size()]);
}
/**
@@ -111,7 +113,7 @@ public class CopyAction extends ProvisioningAction {
* @param overwrite
* @throws IOException
*/
- private static void xcopy(ArrayList copiedFiles, File source, File target, boolean overwrite, IBackupStore backupStore) throws IOException {
+ private static void xcopy(ArrayList<File> copiedFiles, File source, File target, boolean overwrite, IBackupStore backupStore) throws IOException {
if (!source.exists())
throw new IOException("Source: " + source + "does not exists"); //$NON-NLS-1$//$NON-NLS-2$
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/LinkAction.java b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/LinkAction.java
index b34903c42..d5cfd2761 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/LinkAction.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/LinkAction.java
@@ -14,13 +14,13 @@ import java.io.*;
import java.util.Map;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.touchpoint.natives.*;
-import org.eclipse.equinox.internal.provisional.p2.engine.ProvisioningAction;
+import org.eclipse.equinox.p2.engine.spi.ProvisioningAction;
import org.eclipse.osgi.util.NLS;
public class LinkAction extends ProvisioningAction {
public static final String ID = "ln"; //$NON-NLS-1$
- public IStatus execute(Map parameters) {
+ public IStatus execute(Map<String, Object> parameters) {
String targetDir = (String) parameters.get(ActionConstants.PARM_TARGET_DIR);
if (targetDir == null)
return new Status(IStatus.ERROR, Activator.ID, IStatus.OK, NLS.bind(Messages.param_not_set, ActionConstants.PARM_TARGET_DIR, ID), null);
@@ -45,7 +45,7 @@ public class LinkAction extends ProvisioningAction {
return Status.OK_STATUS;
}
- public IStatus undo(Map parameters) {
+ public IStatus undo(Map<String, Object> parameters) {
String targetDir = (String) parameters.get(ActionConstants.PARM_TARGET_DIR);
String linkName = (String) parameters.get(ActionConstants.PARM_LINK_NAME);
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/MkdirAction.java b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/MkdirAction.java
index ce60b52ca..bea5668c0 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/MkdirAction.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/MkdirAction.java
@@ -16,13 +16,13 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.equinox.internal.p2.touchpoint.natives.Messages;
import org.eclipse.equinox.internal.p2.touchpoint.natives.Util;
-import org.eclipse.equinox.internal.provisional.p2.engine.ProvisioningAction;
+import org.eclipse.equinox.p2.engine.spi.ProvisioningAction;
import org.eclipse.osgi.util.NLS;
public class MkdirAction extends ProvisioningAction {
public static final String ID = "mkdir"; //$NON-NLS-1$
- public IStatus execute(Map parameters) {
+ public IStatus execute(Map<String, Object> parameters) {
String path = (String) parameters.get(ActionConstants.PARM_PATH);
if (path == null)
return Util.createError(NLS.bind(Messages.param_not_set, ActionConstants.PARM_PATH, ID));
@@ -35,7 +35,7 @@ public class MkdirAction extends ProvisioningAction {
return Util.createError(NLS.bind(Messages.mkdir_failed, path, ID));
}
- public IStatus undo(Map parameters) {
+ public IStatus undo(Map<String, Object> parameters) {
String path = (String) parameters.get(ActionConstants.PARM_PATH);
if (path == null)
return Util.createError(NLS.bind(Messages.param_not_set, ActionConstants.PARM_PATH, ID));
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/RemoveAction.java b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/RemoveAction.java
index ab442c416..c820a9bbd 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/RemoveAction.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/RemoveAction.java
@@ -10,21 +10,19 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.touchpoint.natives.actions;
-import org.eclipse.equinox.internal.p2.touchpoint.natives.IBackupStore;
-
import java.io.File;
import java.io.IOException;
import java.util.Map;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.equinox.internal.p2.touchpoint.natives.*;
-import org.eclipse.equinox.internal.provisional.p2.engine.ProvisioningAction;
+import org.eclipse.equinox.p2.engine.spi.ProvisioningAction;
import org.eclipse.osgi.util.NLS;
public class RemoveAction extends ProvisioningAction {
public static final String ID = "remove"; //$NON-NLS-1$
- public IStatus execute(Map parameters) {
+ public IStatus execute(Map<String, Object> parameters) {
String path = (String) parameters.get(ActionConstants.PARM_PATH);
if (path == null)
return Util.createError(NLS.bind(Messages.param_not_set, ActionConstants.PARM_PATH, ID));
@@ -43,7 +41,7 @@ public class RemoveAction extends ProvisioningAction {
return Status.OK_STATUS;
}
- public IStatus undo(Map parameters) {
+ public IStatus undo(Map<String, Object> parameters) {
// Does not have to do anything as the backup will restore what was deleted
return Status.OK_STATUS;
}
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/RmdirAction.java b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/RmdirAction.java
index 26ea0464d..8473a2ae8 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/RmdirAction.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/RmdirAction.java
@@ -16,13 +16,13 @@ import java.util.Map;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.equinox.internal.p2.touchpoint.natives.*;
-import org.eclipse.equinox.internal.provisional.p2.engine.ProvisioningAction;
+import org.eclipse.equinox.p2.engine.spi.ProvisioningAction;
import org.eclipse.osgi.util.NLS;
public class RmdirAction extends ProvisioningAction {
public static final String ID = "rmdir"; //$NON-NLS-1$
- public IStatus execute(Map parameters) {
+ public IStatus execute(Map<String, Object> parameters) {
String path = (String) parameters.get(ActionConstants.PARM_PATH);
if (path == null)
return Util.createError(NLS.bind(Messages.param_not_set, ActionConstants.PARM_PATH, ID));
@@ -49,7 +49,7 @@ public class RmdirAction extends ProvisioningAction {
return Status.OK_STATUS;
}
- public IStatus undo(Map parameters) {
+ public IStatus undo(Map<String, Object> parameters) {
String path = (String) parameters.get(ActionConstants.PARM_PATH);
IBackupStore store = (IBackupStore) parameters.get(NativeTouchpoint.PARM_BACKUP);
if (path == null)
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/UnzipAction.java b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/UnzipAction.java
index 9c1c18f62..108161650 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/UnzipAction.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/actions/UnzipAction.java
@@ -16,20 +16,20 @@ import java.util.Map;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.engine.Profile;
import org.eclipse.equinox.internal.p2.touchpoint.natives.*;
-import org.eclipse.equinox.internal.provisional.p2.engine.ProvisioningAction;
-import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey;
-import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.engine.spi.ProvisioningAction;
+import org.eclipse.equinox.p2.metadata.IArtifactKey;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.osgi.util.NLS;
public class UnzipAction extends ProvisioningAction {
public static final String ACTION_UNZIP = "unzip"; //$NON-NLS-1$
- public IStatus execute(Map parameters) {
+ public IStatus execute(Map<String, Object> parameters) {
return unzip(parameters, true);
}
- public IStatus undo(Map parameters) {
+ public IStatus undo(Map<String, Object> parameters) {
return CleanupzipAction.cleanupzip(parameters, false);
}
@@ -40,7 +40,7 @@ public class UnzipAction extends ProvisioningAction {
* @param restoreable - if the unzip should be backed up
* @return status
*/
- public static IStatus unzip(Map parameters, boolean restoreable) {
+ public static IStatus unzip(Map<String, Object> parameters, boolean restoreable) {
String source = (String) parameters.get(ActionConstants.PARM_SOURCE);
if (source == null)
return Util.createError(NLS.bind(Messages.param_not_set, ActionConstants.PARM_SOURCE, ACTION_UNZIP));

Back to the top