diff options
author | Pascal Rapicault | 2008-05-14 22:44:39 +0000 |
---|---|---|
committer | Pascal Rapicault | 2008-05-14 22:44:39 +0000 |
commit | 6e6e13c8a5733745ffc96aacf2da6807122010ec (patch) | |
tree | a136338ade2bc28d172716baf173e4c914c80de5 /bundles/org.eclipse.equinox.p2.artifact.processors/src | |
parent | 039e307013f78052db8b62437523333fe6a8ac74 (diff) | |
download | rt.equinox.p2-6e6e13c8a5733745ffc96aacf2da6807122010ec.tar.gz rt.equinox.p2-6e6e13c8a5733745ffc96aacf2da6807122010ec.tar.xz rt.equinox.p2-6e6e13c8a5733745ffc96aacf2da6807122010ec.zip |
Bug 231138 - Pack200 processing step not shipped with the SDK
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.artifact.processors/src')
-rw-r--r-- | bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/pack200/Pack200ProcessorStep.java | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/pack200/Pack200ProcessorStep.java b/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/pack200/Pack200ProcessorStep.java deleted file mode 100644 index 78c099c8c..000000000 --- a/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/pack200/Pack200ProcessorStep.java +++ /dev/null @@ -1,79 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 compeople AG and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * compeople AG (Stefan Liebig) - initial API and implementation - * IBM Corporation - ongoing development - *******************************************************************************/ -package org.eclipse.equinox.internal.p2.artifact.processors.pack200; - -import java.io.*; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.equinox.internal.p2.artifact.optimizers.AbstractBufferingStep; -import org.eclipse.equinox.internal.p2.artifact.processors.Activator; -import org.eclipse.equinox.internal.p2.core.helpers.FileUtils; -import org.eclipse.equinox.internal.p2.jarprocessor.UnpackStep; -import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactDescriptor; -import org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing.ProcessingStepDescriptor; -import org.eclipse.internal.provisional.equinox.p2.jarprocessor.JarProcessorExecutor; -import org.eclipse.internal.provisional.equinox.p2.jarprocessor.JarProcessorExecutor.Options; - -/** - * The Pack200Unpacker expects an input containing ".jar.pack.gz" data. - */ -public class Pack200ProcessorStep extends AbstractBufferingStep { - public static final String PACKED_SUFFIX = ".pack.gz"; //$NON-NLS-1$ - - private File incoming; - - protected OutputStream createIncomingStream() throws IOException { - incoming = File.createTempFile(INCOMING_ROOT, JAR_SUFFIX + PACKED_SUFFIX); - return new BufferedOutputStream(new FileOutputStream(incoming)); - } - - public void initialize(ProcessingStepDescriptor descriptor, IArtifactDescriptor context) { - super.initialize(descriptor, context); - if (!UnpackStep.canUnpack()) - setStatus(new Status(IStatus.ERROR, Activator.ID, "Unpack facility not configured")); //$NON-NLS-1$ - } - - protected void cleanupTempFiles() { - super.cleanupTempFiles(); - if (incoming != null) - incoming.delete(); - } - - protected void performProcessing() throws IOException { - File resultFile = null; - try { - resultFile = process(); - // now write the processed content to the destination - if (resultFile.length() > 0) { - InputStream resultStream = new BufferedInputStream(new FileInputStream(resultFile)); - FileUtils.copyStream(resultStream, true, getDestination(), false); - } else { - setStatus(new Status(IStatus.ERROR, Activator.ID, "Empty intermediate file: " + resultFile)); //$NON-NLS-1$ - } - } finally { - if (resultFile != null) - resultFile.delete(); - } - } - - protected File process() throws IOException { - Options options = new Options(); - options.unpack = true; - // TODO use false here assuming that all content is conditioned. Need to revise this - options.processAll = false; - options.input = incoming; - options.outputDir = getWorkDir().getPath(); - options.verbose = false; - new JarProcessorExecutor().runJarProcessor(options); - return new File(getWorkDir(), incoming.getName().substring(0, incoming.getName().length() - PACKED_SUFFIX.length())); - } -}
\ No newline at end of file |