org.eclipse.equinox.p2.jarprocessor_1.0.200.v20110815-1438

        entryStream = new FileInputStream(extractedFile);
            if (options.verbose) {
              System.out.println(entry.getName() + " is not marked, skipping.");
            }
          }
          else
          {
            if (options.unpack)
            {
              File result = processor.processJar(extractedFile);
              name = name.substring(0, name.length() - extractedFile.getName().length()) + result.getName();
              extractedFile = result;
            }
            else
            {
              if ((repack) || (sign))
              {
                processor.clearProcessSteps();
                if (repack) {
                  executor.addPackUnpackStep(processor, properties, options);
                }
                if (sign) {
                  executor.addSignStep(processor, properties, options);
                }
                extractedFile = processor.processJar(extractedFile);
              }
              if (pack)
              {
                processor.clearProcessSteps();
                executor.addPackStep(processor, properties, options);
                File modifiedFile = processor.processJar(extractedFile);
                if (modifiedFile.exists())
                {
                  try
                  {
                    String newName = name.substring(0, name.length() - extractedFile.getName().length()) + modifiedFile.getName();
                    if (options.verbose)
                    {
                      System.out.println("Adding " + newName + " to " + outputFile.getPath());
                      System.out.println();
                    }
                    ZipEntry zipEntry = new ZipEntry(newName);
                    entryStream = new FileInputStream(modifiedFile);
                    zipOut.putNextEntry(zipEntry);
                    Utils.transferStreams(entryStream, zipOut, false);
                    entryStream.close();
                    Utils.clear(modifiedFile);
                  }
                  catch (IOException e)
                  {
                    Utils.close(entryStream);
                    if (options.verbose)
                    {
                      e.printStackTrace();
                      System.out.println("Warning: Problem reading " + modifiedFile.getPath() + ".");
                    }
                  }
                  entryStream = null;
                }
                else if (options.verbose)
                {
                  System.out.println("Warning: " + modifiedFile.getPath() + " not found.");
                }
              }
            }
            if (extractedFile.exists()) {
              try
              {
                entryStream = new FileInputStream(extractedFile);
              }
              catch (IOException e)
              {
                if (options.verbose)
                {
                  e.printStackTrace();
                  System.out.println("Warning: Problem reading " + extractedFile.getPath() + ".");
                }
              }
            }
            if ((options.verbose) && (entryStream != null)) {
              System.out.println("Adding " + name + " to " + outputFile.getPath());
            }
          }
        }
        if (entryStream != null)
        {
          ZipEntry newEntry = new ZipEntry(name);
          try
          {
            zipOut.putNextEntry(newEntry);
            Utils.transferStreams(entryStream, zipOut, false);
            zipOut.closeEntry();
          }
          catch (ZipException localZipException)
          {
            if (options.verbose) {
              System.out.println("Warning: " + name + " already exists in " + outputFile.getName() + ".  Skipping.");
            }
          }
          entryStream.close();
        }
        if (extractedFile != null) {
          Utils.clear(extractedFile);
        }
        if (options.verbose)
        {
          System.out.println();
          System.out.println("Processing " + zipFile.getPath());
        }
      }
    }
    zipOut.close();
    zip.close();
    
    File finalFile = new File(getWorkingDirectory(), zipFile.getName());
    if (finalFile.exists()) {
      finalFile.delete();
    }
    outputFile.renameTo(finalFile);
    Utils.clear(tempDir);
  }
  
  /* Error */
  private void initialize(ZipFile zip)
  {
    // Byte code:
    //   0: aload_1
    //   1: ldc_w 143
    //   4: invokevirtual 318	java/util/zip/ZipFile:getEntry	(Ljava/lang/String;)Ljava/util/zip/ZipEntry;
    //   7: astore_2
    //   8: aload_0
    //   9: new 155	java/util/Properties
    //   12: dup
    //   13: invokespecial 310	java/util/Properties:<init>	()V
    //   16: putfield 275	org/eclipse/equinox/internal/p2/jarprocessor/ZipProcessor:properties	Ljava/util/Properties;
    //   19: aload_2
    //   20: ifnull +59 -> 79
    //   23: aconst_null
    //   24: astore_3
    //   25: aload_1
    //   26: aload_2
    //   27: invokevirtual 317	java/util/zip/ZipFile:getInputStream	(Ljava/util/zip/ZipEntry;)Ljava/io/InputStream;
    //   30: astore_3
    //   31: aload_0
    //   32: getfield 275	org/eclipse/equinox/internal/p2/jarprocessor/ZipProcessor:properties	Ljava/util/Properties;
    //   35: aload_3
    //   36: invokevirtual 311	java/util/Properties:load	(Ljava/io/InputStream;)V
    //   39: goto +36 -> 75
    //   42: astore 4
    //   44: aload_0
    //   45: getfield 279	org/eclipse/equinox/internal/p2/jarprocessor/ZipProcessor:options	Lorg/eclipse/internal/provisional/equinox/p2/jarprocessor/JarProcessorExecutor$Options;
    //   48: getfield 284	org/eclipse/internal/provisional/equinox/p2/jarprocessor/JarProcessorExecutor$Options:verbose	Z
    //   51: ifeq +8 -> 59
    //   54: aload 4
    //   56: invokevirtual 298	java/io/IOException:printStackTrace	()V
    //   59: aload_3
    //   60: invokestatic 325	org/eclipse/equinox/internal/p2/jarprocessor/Utils:close	(Ljava/lang/Object;)V
    //   63: goto +16 -> 79
    //   66: astore 5
    //   68: aload_3
    //   69: invokestatic 325	org/eclipse/equinox/internal/p2/jarprocessor/Utils:close	(Ljava/lang/Object;)V
    //   72: aload 5
    //   74: athrow
    //   75: aload_3
    //   76: invokestatic 325	org/eclipse/equinox/internal/p2/jarprocessor/Utils:close	(Ljava/lang/Object;)V
    //   79: aload_0
    //   80: aload_0
    //   81: getfield 275	org/eclipse/equinox/internal/p2/jarprocessor/ZipProcessor:properties	Ljava/util/Properties;
    //   84: invokestatic 327	org/eclipse/equinox/internal/p2/jarprocessor/Utils:getPackExclusions	(Ljava/util/Properties;)Ljava/util/Set;
    //   87: putfield 276	org/eclipse/equinox/internal/p2/jarprocessor/ZipProcessor:packExclusions	Ljava/util/Set;
    //   90: aload_0
    //   91: aload_0
    //   92: getfield 275	org/eclipse/equinox/internal/p2/jarprocessor/ZipProcessor:properties	Ljava/util/Properties;
    //   95: invokestatic 328	org/eclipse/equinox/internal/p2/jarprocessor/Utils:getSignExclusions	(Ljava/util/Properties;)Ljava/util/Set;
    //   98: putfield 277	org/eclipse/equinox/internal/p2/jarprocessor/ZipProcessor:signExclusions	Ljava/util/Set;
    //   101: aload_0
    //   102: getfield 278	org/eclipse/equinox/internal/p2/jarprocessor/ZipProcessor:executor	Lorg/eclipse/internal/provisional/equinox/p2/jarprocessor/JarProcessorExecutor;
    //   105: ifnonnull +14 -> 119
    //   108: aload_0
    //   109: new 164	org/eclipse/internal/provisional/equinox/p2/jarprocessor/JarProcessorExecutor
    //   112: dup
    //   113: invokespecial 338	org/eclipse/internal/provisional/equinox/p2/jarprocessor/JarProcessorExecutor:<init>	()V
    //   116: putfield 278	org/eclipse/equinox/internal/p2/jarprocessor/ZipProcessor:executor	Lorg/eclipse/internal/provisional/equinox/p2/jarprocessor/JarProcessorExecutor;
    //   119: return
    // Line number table:
    //   Java source line #200	-> byte code offset #0
    //   Java source line #201	-> byte code offset #8
    //   Java source line #202	-> byte code offset #19
    //   Java source line #203	-> byte code offset #23
    //   Java source line #205	-> byte code offset #25
    //   Java source line #206	-> byte code offset #31
    //   Java source line #207	-> byte code offset #42
    //   Java source line #208	-> byte code offset #44
    //   Java source line #209	-> byte code offset #54
    //   Java source line #211	-> byte code offset #59
    //   Java source line #210	-> byte code offset #66
    //   Java source line #211	-> byte code offset #68
    //   Java source line #212	-> byte code offset #72
    //   Java source line #211	-> byte code offset #75
    //   Java source line #215	-> byte code offset #79
    //   Java source line #216	-> byte code offset #90
    //   Java source line #218	-> byte code offset #101
    //   Java source line #219	-> byte code offset #108
    //   Java source line #220	-> byte code offset #119
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	120	0	this	ZipProcessor
    //   0	120	1	zip	ZipFile
    //   7	20	2	entry	ZipEntry
    //   24	52	3	stream	InputStream
    //   42	13	4	e	IOException
    //   66	7	5	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   25	39	42	java/io/IOException
    //   25	59	66	finally
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.jarprocessor.ZipProcessor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.jarprocessor.unsigner;

import java.io.File;
import java.util.List;
import java.util.Properties;
import org.eclipse.equinox.internal.p2.jarprocessor.SignCommandStep;

public class UnsignCommand
  extends SignCommandStep
{
  public UnsignCommand(Properties options, String command, boolean verbose)
  {
    super(options, command, verbose);
  }
  
  public File postProcess(File input, File workingDirectory, List containers)
  {
    if ((command != null) && (input != null) && (shouldSign(input, containers))) {
      execute(input);
    }
    return null;
  }
  
  private void execute(File input)
  {
    Unsigner jarUnsigner = new Unsigner();
    jarUnsigner.setJar(input);
    jarUnsigner.setKeepManifestEntries(false);
    jarUnsigner.execute();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.jarprocessor.unsigner.UnsignCommand
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.jarprocessor.unsigner;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Enumeration;
import java.util.Map;
import java.util.jar.Manifest;
import java.util.zip.ZipEntry;
import java.util.zip.ZipException;
import java.util.zip.ZipFile;
import java.util.zip.ZipInputStream;
import java.util.zip.ZipOutputStream;

public class Unsigner
{
  private static final String META_INF = "META-INF";
  private static final String DSA_EXT = ".DSA";
  private static final String RSA_EXT = ".RSA";
  private static final String SF_EXT = ".SF";
  private static final String META_INF_PREFIX = "META-INF/";
  private String[] signers;
  private File jarFile;
  private boolean keepManifestContent = false;
  
  private boolean isSigned(File file)
  {
    ZipFile jar = null;
    try
    {
      jar = new ZipFile(file);
      if (signers != null)
      {
        int i;
        for (int i = 0; i < signers.length; i++) {
          if (jar.getEntry(("META-INF/" + signers[i] + ".SF").toUpperCase()) != null) {
            return true;
          }
        }
      }
      else
      {
        Enumeration entries = jar.entries();
        Enumeration entries;
        while (entries.hasMoreElements())
        {
          ZipEntry entry = (ZipEntry)entries.nextElement();
          String entryName = entry.getName();
          if ((entryName.endsWith(".SF")) && (entryName.startsWith("META-INF"))) {
            return true;
          }
        }
      }
      return false;
    }
    catch (ZipException localZipException)
    {
      return false;
    }
    catch (IOException localIOException5)
    {
      return false;
    }
    finally
    {
      if (jar != null) {
        try
        {
          jar.close();
        }
        catch (IOException localIOException7) {}
      }
    }
  }
  
  public void execute()
  {
    processJar(jarFile);
  }
  
  private void processJar(File inputFile)
  {
    if (!isSigned(inputFile)) {
      return;
    }
    try
    {
      ZipInputStream input = new ZipInputStream(new BufferedInputStream(new FileInputStream(inputFile)));
      File outputFile = File.createTempFile("removing.", ".signature", inputFile.getParentFile());
      ZipOutputStream output = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(outputFile)));
      
      ZipEntry inputZe = input.getNextEntry();
      byte[] b = new byte['?'];
      while (inputZe != null)
      {
        byte remove = shouldRemove(inputZe);
        if (remove == 2)
        {
          inputZe = input.getNextEntry();
        }
        else
        {
          if (remove == 1)
          {
            output.putNextEntry(new ZipEntry(inputZe.getName()));
            Manifest m = new Manifest();
            m.read(input);
            m.getEntries().clear();
            m.write(output);
          }
          else
          {
            output.putNextEntry(inputZe);
            while (input.available() != 0)
            {
              int read = input.read(b);
              if (read != -1) {
                output.write(b, 0, read);
              }
            }
          }
          output.closeEntry();
          input.closeEntry();
          
          inputZe = input.getNextEntry();
        }
      }
      output.close();
      input.close();
      inputFile.delete();
      outputFile.renameTo(inputFile);
    }
    catch (FileNotFoundException localFileNotFoundException) {}catch (IOException e)
    {
      e.printStackTrace();
    }
  }
  
  private byte shouldRemove(ZipEntry entry)
  {
    String entryName = entry.getName();
    if ((!keepManifestContent) && (entryName.equalsIgnoreCase("META-INF/MANIFEST.MF"))) {
      return 1;
    }
    if (signers != null) {
      for (int i = 0; i < signers.length; i++) {
        if ((entryName.equalsIgnoreCase("META-INF/" + signers[i] + ".SF")) || (entryName.equalsIgnoreCase("META-INF/" + signers[i] + ".RSA")) || (entryName.equalsIgnoreCase("META-INF/" + signers[i] + ".DSA"))) {
          return 2;
        }
      }
    } else if ((entryName.startsWith("META-INF")) && ((entryName.endsWith(".SF")) || (entryName.endsWith(".RSA")) || (entryName.endsWith(".DSA")))) {
      return 2;
    }
    return 0;
  }
  
  public void setRemoveSigners(String[] fileName)
  {
    signers = fileName;
  }
  
  public void setJar(File file)
  {
    jarFile = file;
  }
  
  public void setKeepManifestEntries(boolean keep)
  {
    keepManifestContent = keep;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.jarprocessor.unsigner.Unsigner
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.jarprocessor.verifier;

import java.io.File;
import java.io.IOException;
import java.util.Iterator;
import org.eclipse.internal.provisional.equinox.p2.jarprocessor.JarProcessor;

class Verifier$1
  extends JarProcessor
{
  final Verifier this$0;
  private final VerifyStep val$verifyStep;
  private final File val$workingDirectory;
  
  Verifier$1(Verifier paramVerifier, VerifyStep paramVerifyStep, File paramFile)
  {
    this$0 = paramVerifier;val$verifyStep = paramVerifyStep;val$workingDirectory = paramFile;
  }
  
  public File processJar(File inputFile)
    throws IOException
  {
    Iterator iterator = getStepIterator();
    if ((iterator.hasNext()) && ((iterator.next() instanceof VerifyStep))) {
      return val$verifyStep.postProcess(inputFile, val$workingDirectory, null);
    }
    return super.processJar(inputFile);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.jarprocessor.verifier.Verifier.1
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.jarprocessor.verifier;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintStream;
import java.util.Iterator;
import java.util.Properties;
import org.eclipse.equinox.internal.p2.jarprocessor.UnpackStep;
import org.eclipse.equinox.internal.p2.jarprocessor.Utils;
import org.eclipse.internal.provisional.equinox.p2.jarprocessor.JarProcessor;
import org.eclipse.internal.provisional.equinox.p2.jarprocessor.JarProcessorExecutor;
import org.eclipse.internal.provisional.equinox.p2.jarprocessor.JarProcessorExecutor.Options;

public class Verifier
  extends JarProcessorExecutor
{
  private static void printUsage()
  {
    System.out.println("This tool verifies that unpacking a pack.gz file with the jarprocessor results in a valid jar file.");
    System.out.println("Usage: java -cp jarprocessor.jar org.eclipse.update.internal.jarprocessor.verifier.Verifier -dir <workingDirectory> input [input]");
    System.out.println("");
    System.out.println("-dir : specifies a working directory where pack.gz files can be temporarily unpacked");
    System.out.println("input : a list of directories and/or pack.gz files to verify.");
  }
  
  public static void main(String[] args)
  {
    if (!VerifyStep.canVerify())
    {
      System.out.println("Can't find jarsigner.  Please adjust your system path or use a jdk.");
      printUsage();
      return;
    }
    String workingDirectory = null;
    String[] input;
    String[] input;
    if (args.length == 0)
    {
      workingDirectory = ".";
      input = new String[] { "." };
    }
    else
    {
      int idx = 0;
      if (args[0] == "-help")
      {
        printUsage();
        return;
      }
      if (args[idx] == "-dir")
      {
        workingDirectory = args[(++idx)];
        idx++;
      }
      else
      {
        workingDirectory = "temp";
      }
      input = new String[args.length - idx];
      System.arraycopy(args, idx, input, 0, args.length - idx);
    }
    File workingDir = new File(workingDirectory);
    boolean clear = false;
    if (workingDir.exists())
    {
      workingDir = new File(workingDir, "jarprocessor.verifier.temp");
      clear = true;
    }
    Verifier verifier = new Verifier();
    verifier.verify(workingDir, input);
    if (clear) {
      workingDir.deleteOnExit();
    }
  }
  
  public void verify(File workingDirectory, String[] input)
  {
    options = new JarProcessorExecutor.Options();
    options.verbose = false;
    options.repack = true;
    options.pack = true;
    options.outputDir = workingDirectory.toString();
    
    Properties properties = new Properties();
    
    VerifyStep verifyStep = new VerifyStep(properties, false);
    JarProcessor verifier = new JarProcessor()
    {
      private final VerifyStep val$verifyStep;
      private final File val$workingDirectory;
      
      public File processJar(File inputFile)
        throws IOException
      {
        Iterator iterator = getStepIterator();
        if ((iterator.hasNext()) && ((iterator.next() instanceof VerifyStep))) {
          return val$verifyStep.postProcess(inputFile, val$workingDirectory, null);
        }
        return super.processJar(inputFile);
      }
    };
    verifier.setWorkingDirectory(workingDirectory.getAbsolutePath());
    for (int i = 0; i < input.length; i++)
    {
      File inputFile = new File(input[i]);
      if (inputFile.exists()) {
        try
        {
          process(inputFile, Utils.PACK_GZ_FILTER, true, verifier, properties);
        }
        catch (FileNotFoundException e)
        {
          e.printStackTrace();
        }
      }
    }
    Utils.clear(workingDirectory);
  }
  
  public void addPackStep(JarProcessor processor, Properties properties, JarProcessorExecutor.Options processOptions)
  {
    processor.addProcessStep(new VerifyStep(properties, verbose));
  }
  
  public void addPackUnpackStep(JarProcessor processor, Properties properties, JarProcessorExecutor.Options processOptions)
  {
    processor.addProcessStep(new UnpackStep(properties, verbose));
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.jarprocessor.verifier.Verifier
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.jarprocessor.verifier;

import java.io.File;
import java.io.IOException;
import java.io.PrintStream;
import java.util.List;
import java.util.Properties;
import org.eclipse.equinox.internal.p2.jarprocessor.CommandStep;
import org.eclipse.equinox.internal.p2.jarprocessor.Utils;

public class VerifyStep
  extends CommandStep
{
  static String verifyCommand = "jarsigner";
  static Boolean canVerify = null;
  
  public static boolean canVerify()
  {
    if (canVerify != null) {
      return canVerify.booleanValue();
    }
    String javaHome = System.getProperty("java.home");
    String command = javaHome + "/../bin/jarsigner";
    int result = execute(new String[] { command });
    if (result < 0)
    {
      command = "jarsigner";
      result = execute(new String[] { command });
      if (result < 0)
      {
        canVerify = Boolean.FALSE;
        return false;
      }
    }
    verifyCommand = command;
    canVerify = Boolean.TRUE;
    return true;
  }
  
  public VerifyStep(Properties options, boolean verbose)
  {
    super(options, verifyCommand, ".jar", verbose);
  }
  
  public String getStepName()
  {
    return "Verify";
  }
  
  public File postProcess(File input, File workingDirectory, List containers)
  {
    if ((canVerify()) && (verifyCommand != null))
    {
      try
      {
        System.out.print("Verifying " + input.getName() + ":  ");
        String[] cmd = { verifyCommand, "-verify", input.getCanonicalPath() };
        int result = execute(cmd, true);
        if ((result != 0) && (verbose)) {
          System.out.println("Error: " + result + " was returned from command: " + Utils.concat(cmd));
        }
      }
      catch (IOException e)
      {
        if (verbose) {
          e.printStackTrace();
        }
        return null;
      }
      return input;
    }
    return null;
  }
  
  public File preProcess(File input, File workingDirectory, List containers)
  {
    return null;
  }
  
  public String recursionEffect(String entryName)
  {
    return null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.jarprocessor.verifier.VerifyStep
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.internal.provisional.equinox.p2.jarprocessor;

import java.io.File;
import java.util.List;
import java.util.Properties;

public abstract interface IProcessStep
{
  public abstract String recursionEffect(String paramString);
  
  public abstract File preProcess(File paramFile1, File paramFile2, List paramList);
  
  public abstract File postProcess(File paramFile1, File paramFile2, List paramList);
  
  public abstract String getStepName();
  
  public abstract void adjustInf(File paramFile, Properties paramProperties, List paramList);
}

/* Location:
 * Qualified Name:     org.eclipse.internal.provisional.equinox.p2.jarprocessor.IProcessStep
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.internal.provisional.equinox.p2.jarprocessor;

import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.jar.JarFile;
import java.util.jar.JarOutputStream;
import org.eclipse.equinox.internal.p2.jarprocessor.PackStep;
import org.eclipse.equinox.internal.p2.jarprocessor.UnpackStep;
import org.eclipse.equinox.internal.p2.jarprocessor.Utils;

public class JarProcessor
{
  public static final String PACKED_SUFFIX = "pack.gz";
  private List steps = new ArrayList();
  private String workingDirectory = "";
  private int depth = -1;
  private boolean verbose = false;
  private boolean processAll = false;
  private LinkedList containingInfs = new LinkedList();
  
  public static JarProcessor getUnpackProcessor(Properties properties)
  {
    if (!canPerformUnpack()) {
      throw new UnsupportedOperationException();
    }
    JarProcessor processor = new JarProcessor();
    processor.addProcessStep(new UnpackStep(properties));
    return processor;
  }
  
  public static JarProcessor getPackProcessor(Properties properties)
  {
    if (!canPerformPack()) {
      throw new UnsupportedOperationException();
    }
    JarProcessor processor = new JarProcessor();
    processor.addProcessStep(new PackStep(properties));
    return processor;
  }
  
  public static boolean canPerformPack()
  {
    return PackStep.canPack();
  }
  
  public static boolean canPerformUnpack()
  {
    return UnpackStep.canUnpack();
  }
  
  public String getWorkingDirectory()
  {
    return workingDirectory;
  }
  
  public void setWorkingDirectory(String dir)
  {
    if (dir != null) {
      workingDirectory = dir;
    }
  }
  
  public void setVerbose(boolean verbose)
  {
    this.verbose = verbose;
  }
  
  public void setProcessAll(boolean all)
  {
    processAll = all;
  }
  
  public void addProcessStep(IProcessStep step)
  {
    steps.add(step);
  }
  
  public void clearProcessSteps()
  {
    steps.clear();
  }
  
  public Iterator getStepIterator()
  {
    return steps.iterator();
  }
  
  /* Error */
  private void recreateJar(JarFile jar, JarOutputStream outputJar, Map replacements, File directory, Properties inf)
    throws IOException
  {
    // Byte code:
    //   0: aconst_null
    //   1: astore 6
    //   3: iconst_0
    //   4: istore 7
    //   6: aload_1
    //   7: invokevirtual 434	java/util/jar/JarFile:entries	()Ljava/util/Enumeration;
    //   10: astore 8
    //   12: aload 8
    //   14: invokeinterface 464 1 0
    //   19: checkcast 223	java/util/jar/JarEntry
    //   22: astore 9
    //   24: goto +421 -> 445
    //   27: aconst_null
    //   28: astore 10
    //   30: aconst_null
    //   31: astore 11
    //   33: aload_3
    //   34: aload 9
    //   36: invokevirtual 429	java/util/jar/JarEntry:getName	()Ljava/lang/String;
    //   39: invokeinterface 470 2 0
    //   44: ifeq +215 -> 259
    //   47: aload_3
    //   48: aload 9
    //   50: invokevirtual 429	java/util/jar/JarEntry:getName	()Ljava/lang/String;
    //   53: invokeinterface 471 2 0
    //   58: checkcast 211	java/lang/String
    //   61: astore 12
    //   63: new 202	java/io/File
    //   66: dup
    //   67: aload 4
    //   69: aload 12
    //   71: invokespecial 398	java/io/File:<init>	(Ljava/io/File;Ljava/lang/String;)V
    //   74: astore 10
    //   76: aload 12
    //   78: ifnull +181 -> 259
    //   81: aload 10
    //   83: invokevirtual 388	java/io/File:exists	()Z
    //   86: ifeq +109 -> 195
    //   89: new 200	java/io/BufferedInputStream
    //   92: dup
    //   93: new 203	java/io/FileInputStream
    //   96: dup
    //   97: aload 10
    //   99: invokespecial 399	java/io/FileInputStream:<init>	(Ljava/io/File;)V
    //   102: invokespecial 384	java/io/BufferedInputStream:<init>	(Ljava/io/InputStream;)V
    //   105: astore 6
    //   107: new 223	java/util/jar/JarEntry
    //   110: dup
    //   111: aload 12
    //   113: invokespecial 430	java/util/jar/JarEntry:<init>	(Ljava/lang/String;)V
    //   116: astore 11
    //   118: goto +141 -> 259
    //   121: astore 13
    //   123: aload_0
    //   124: getfield 380	org/eclipse/internal/provisional/equinox/p2/jarprocessor/JarProcessor:verbose	Z
    //   127: ifeq +132 -> 259
    //   130: aload 13
    //   132: invokevirtual 407	java/lang/Exception:printStackTrace	()V
    //   135: getstatic 377	java/lang/System:out	Ljava/io/PrintStream;
    //   138: new 212	java/lang/StringBuffer
    //   141: dup
    //   142: ldc 9
    //   144: invokespecial 415	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   147: aload 10
    //   149: invokevirtual 396	java/io/File:getPath	()Ljava/lang/String;
    //   152: invokevirtual 418	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   155: ldc 5
    //   157: invokevirtual 418	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   160: aload_1
    //   161: invokevirtual 433	java/util/jar/JarFile:getName	()Ljava/lang/String;
    //   164: invokevirtual 418	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   167: getstatic 376	java/io/File:separator	Ljava/lang/String;
    //   170: invokevirtual 418	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   173: aload 9
    //   175: invokevirtual 429	java/util/jar/JarEntry:getName	()Ljava/lang/String;
    //   178: invokevirtual 418	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   181: ldc 3
    //   183: invokevirtual 418	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   186: invokevirtual 414	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   189: invokevirtual 404	java/io/PrintStream:println	(Ljava/lang/String;)V
    //   192: goto +67 -> 259
    //   195: aload_0
    //   196: getfield 380	org/eclipse/internal/provisional/equinox/p2/jarprocessor/JarProcessor:verbose	Z
    //   199: ifeq +60 -> 259
    //   202: getstatic 377	java/lang/System:out	Ljava/io/PrintStream;
    //   205: new 212	java/lang/StringBuffer
    //   208: dup
    //   209: ldc 8
    //   211: invokespecial 415	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   214: aload 10
    //   216: invokevirtual 396	java/io/File:getPath	()Ljava/lang/String;
    //   219: invokevirtual 418	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   222: ldc 4
    //   224: invokevirtual 418	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   227: aload_1
    //   228: invokevirtual 433	java/util/jar/JarFile:getName	()Ljava/lang/String;
    //   231: invokevirtual 418	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   234: getstatic 376	java/io/File:separator	Ljava/lang/String;
    //   237: invokevirtual 418	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   240: aload 9
    //   242: invokevirtual 429	java/util/jar/JarEntry:getName	()Ljava/lang/String;
    //   245: invokevirtual 418	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   248: ldc 3
    //   250: invokevirtual 418	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   253: invokevirtual 414	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   256: invokevirtual 404	java/io/PrintStream:println	(Ljava/lang/String;)V
    //   259: aload 11
    //   261: ifnonnull +90 -> 351
    //   264: new 200	java/io/BufferedInputStream
    //   267: dup
    //   268: aload_1
    //   269: aload 9
    //   271: invokevirtual 435	java/util/jar/JarFile:getInputStream	(Ljava/util/zip/ZipEntry;)Ljava/io/InputStream;
    //   274: invokespecial 384	java/io/BufferedInputStream:<init>	(Ljava/io/InputStream;)V
    //   277: astore 6
    //   279: new 223	java/util/jar/JarEntry
    //   282: dup
    //   283: aload 9
    //   285: invokevirtual 429	java/util/jar/JarEntry:getName	()Ljava/lang/String;
    //   288: invokespecial 430	java/util/jar/JarEntry:<init>	(Ljava/lang/String;)V
    //   291: astore 11
    //   293: goto +58 -> 351
    //   296: astore 12
    //   298: aload_0
    //   299: getfield 380	org/eclipse/internal/provisional/equinox/p2/jarprocessor/JarProcessor:verbose	Z
    //   302: ifeq +117 -> 419
    //   305: aload 12
    //   307: invokevirtual 407	java/lang/Exception:printStackTrace	()V
    //   310: getstatic 377	java/lang/System:out	Ljava/io/PrintStream;
    //   313: new 212	java/lang/StringBuffer
    //   316: dup
    //   317: ldc 6
    //   319: invokespecial 415	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   322: aload 9
    //   324: invokevirtual 429	java/util/jar/JarEntry:getName	()Ljava/lang/String;
    //   327: invokevirtual 418	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   330: ldc 2
    //   332: invokevirtual 418	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   335: aload_1
    //   336: invokevirtual 433	java/util/jar/JarFile:getName	()Ljava/lang/String;
    //   339: invokevirtual 418	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   342: invokevirtual 414	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   345: invokevirtual 404	java/io/PrintStream:println	(Ljava/lang/String;)V
    //   348: goto +71 -> 419
    //   351: aload 11
    //   353: aload 9
    //   355: invokevirtual 427	java/util/jar/JarEntry:getTime	()J
    //   358: invokevirtual 428	java/util/jar/JarEntry:setTime	(J)V
    //   361: aload_2
    //   362: aload 11
    //   364: invokevirtual 438	java/util/jar/JarOutputStream:putNextEntry	(Ljava/util/zip/ZipEntry;)V
    //   367: aload 9
    //   369: invokevirtual 429	java/util/jar/JarEntry:getName	()Ljava/lang/String;
    //   372: ldc 7
    //   374: invokevirtual 410	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   377: ifeq +15 -> 392
    //   380: aload 5
    //   382: aload_2
    //   383: invokestatic 447	org/eclipse/equinox/internal/p2/jarprocessor/Utils:storeProperties	(Ljava/util/Properties;Ljava/io/OutputStream;)V
    //   386: iconst_1
    //   387: istore 7
    //   389: goto +10 -> 399
    //   392: aload 6
    //   394: aload_2
    //   395: iconst_0
    //   396: invokestatic 446	org/eclipse/equinox/internal/p2/jarprocessor/Utils:transferStreams	(Ljava/io/InputStream;Ljava/io/OutputStream;Z)V
    //   399: aload_2
    //   400: invokevirtual 436	java/util/jar/JarOutputStream:closeEntry	()V
    //   403: aload 6
    //   405: invokevirtual 402	java/io/InputStream:close	()V
    //   408: aload 10
    //   410: ifnull +9 -> 419
    //   413: aload 10
    //   415: invokevirtual 387	java/io/File:delete	()Z
    //   418: pop
    //   419: aload 8
    //   421: invokeinterface 463 1 0
    //   426: ifeq +16 -> 442
    //   429: aload 8
    //   431: invokeinterface 464 1 0
    //   436: checkcast 223	java/util/jar/JarEntry
    //   439: goto +4 -> 443
    //   442: aconst_null
    //   443: astore 9
    //   445: aload 9
    //   447: ifnonnull -420 -> 27
    //   450: iload 7
    //   452: ifne +51 -> 503
    //   455: new 223	java/util/jar/JarEntry
    //   458: dup
    //   459: ldc 7
    //   461: invokespecial 430	java/util/jar/JarEntry:<init>	(Ljava/lang/String;)V
    //   464: astore 9
    //   466: aload_2
    //   467: aload 9
    //   469: invokevirtual 438	java/util/jar/JarOutputStream:putNextEntry	(Ljava/util/zip/ZipEntry;)V
    //   472: aload 5
    //   474: aload_2
    //   475: invokestatic 447	org/eclipse/equinox/internal/p2/jarprocessor/Utils:storeProperties	(Ljava/util/Properties;Ljava/io/OutputStream;)V
    //   478: aload_2
    //   479: invokevirtual 436	java/util/jar/JarOutputStream:closeEntry	()V
    //   482: goto +21 -> 503
    //   485: astore 14
    //   487: aload_2
    //   488: invokestatic 445	org/eclipse/equinox/internal/p2/jarprocessor/Utils:close	(Ljava/lang/Object;)V
    //   491: aload_1
    //   492: invokestatic 445	org/eclipse/equinox/internal/p2/jarprocessor/Utils:close	(Ljava/lang/Object;)V
    //   495: aload 6
    //   497: invokestatic 445	org/eclipse/equinox/internal/p2/jarprocessor/Utils:close	(Ljava/lang/Object;)V
    //   500: aload 14
    //   502: athrow
    //   503: aload_2
    //   504: invokestatic 445	org/eclipse/equinox/internal/p2/jarprocessor/Utils:close	(Ljava/lang/Object;)V
    //   507: aload_1
    //   508: invokestatic 445	org/eclipse/equinox/internal/p2/jarprocessor/Utils:close	(Ljava/lang/Object;)V
    //   511: aload 6
    //   513: invokestatic 445	org/eclipse/equinox/internal/p2/jarprocessor/Utils:close	(Ljava/lang/Object;)V
    //   516: return
    // Line number table:
    //   Java source line #92	-> byte code offset #0
    //   Java source line #93	-> byte code offset #3
    //   Java source line #95	-> byte code offset #6
    //   Java source line #96	-> byte code offset #12
    //   Java source line #97	-> byte code offset #27
    //   Java source line #98	-> byte code offset #30
    //   Java source line #99	-> byte code offset #33
    //   Java source line #100	-> byte code offset #47
    //   Java source line #101	-> byte code offset #63
    //   Java source line #102	-> byte code offset #76
    //   Java source line #103	-> byte code offset #81
    //   Java source line #105	-> byte code offset #89
    //   Java source line #106	-> byte code offset #107
    //   Java source line #107	-> byte code offset #121
    //   Java source line #108	-> byte code offset #123
    //   Java source line #109	-> byte code offset #130
    //   Java source line #110	-> byte code offset #135
    //   Java source line #113	-> byte code offset #195
    //   Java source line #114	-> byte code offset #202
    //   Java source line #118	-> byte code offset #259
    //   Java source line #120	-> byte code offset #264
    //   Java source line #121	-> byte code offset #279
    //   Java source line #122	-> byte code offset #296
    //   Java source line #123	-> byte code offset #298
    //   Java source line #124	-> byte code offset #305
    //   Java source line #125	-> byte code offset #310
    //   Java source line #127	-> byte code offset #348
    //   Java source line #130	-> byte code offset #351
    //   Java source line #131	-> byte code offset #361
    //   Java source line #132	-> byte code offset #367
    //   Java source line #134	-> byte code offset #380
    //   Java source line #135	-> byte code offset #386
    //   Java source line #137	-> byte code offset #392
    //   Java source line #139	-> byte code offset #399
    //   Java source line #140	-> byte code offset #403
    //   Java source line #143	-> byte code offset #408
    //   Java source line #144	-> byte code offset #413
    //   Java source line #96	-> byte code offset #419
    //   Java source line #147	-> byte code offset #450
    //   Java source line #148	-> byte code offset #455
    //   Java source line #149	-> byte code offset #466
    //   Java source line #150	-> byte code offset #472
    //   Java source line #151	-> byte code offset #478
    //   Java source line #153	-> byte code offset #485
    //   Java source line #154	-> byte code offset #487
    //   Java source line #155	-> byte code offset #491
    //   Java source line #156	-> byte code offset #495
    //   Java source line #157	-> byte code offset #500
    //   Java source line #154	-> byte code offset #503
    //   Java source line #155	-> byte code offset #507
    //   Java source line #156	-> byte code offset #511
    //   Java source line #158	-> byte code offset #516
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	517	0	this	JarProcessor
    //   0	517	1	jar	JarFile
    //   0	517	2	outputJar	JarOutputStream
    //   0	517	3	replacements	Map
    //   0	517	4	directory	File
    //   0	517	5	inf	Properties
    //   1	511	6	in	java.io.InputStream
    //   4	447	7	marked	boolean
    //   10	420	8	entries	java.util.Enumeration
    //   22	424	9	entry	java.util.jar.JarEntry
    //   464	4	9	entry	java.util.jar.JarEntry
    //   28	386	10	replacement	File
    //   31	332	11	newEntry	java.util.jar.JarEntry
    // 
1 2 3 4

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2019. Infinite Loop Ltd