org.eclipse.equinox.p2.jarprocessor_1.0.200.v20110808-1657

 //   Java source line #37	-> byte code offset #0
    //   Java source line #38	-> byte code offset #5
    //   Java source line #39	-> byte code offset #36
    //   Java source line #40	-> byte code offset #44
    //   Java source line #41	-> byte code offset #55
    //   Java source line #42	-> byte code offset #63
    //   Java source line #44	-> byte code offset #68
    //   Java source line #45	-> byte code offset #82
    //   Java source line #46	-> byte code offset #83
    //   Java source line #47	-> byte code offset #93
    //   Java source line #48	-> byte code offset #100
    //   Java source line #49	-> byte code offset #101
    //   Java source line #50	-> byte code offset #111
    //   Java source line #53	-> byte code offset #118
    //   Java source line #55	-> byte code offset #126
    //   Java source line #56	-> byte code offset #137
    //   Java source line #57	-> byte code offset #148
    //   Java source line #60	-> byte code offset #159
    //   Java source line #61	-> byte code offset #167
    //   Java source line #62	-> byte code offset #180
    //   Java source line #63	-> byte code offset #198
    //   Java source line #64	-> byte code offset #214
    //   Java source line #66	-> byte code offset #217
    //   Java source line #67	-> byte code offset #235
    //   Java source line #68	-> byte code offset #244
    //   Java source line #69	-> byte code offset #246
    //   Java source line #70	-> byte code offset #256
    //   Java source line #72	-> byte code offset #261
    //   Java source line #71	-> byte code offset #269
    //   Java source line #72	-> byte code offset #271
    //   Java source line #73	-> byte code offset #276
    //   Java source line #72	-> byte code offset #279
    //   Java source line #76	-> byte code offset #284
    //   Java source line #77	-> byte code offset #292
    //   Java source line #81	-> byte code offset #300
    //   Java source line #82	-> byte code offset #310
    //   Java source line #83	-> byte code offset #335
    //   Java source line #84	-> byte code offset #337
    //   Java source line #85	-> byte code offset #347
    //   Java source line #88	-> byte code offset #352
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	353	0	this	JarProcessorExecutor
    //   0	353	1	processOptions	Options
    //   43	26	2	processor	org.eclipse.equinox.internal.p2.jarprocessor.ZipProcessor
    //   125	203	2	processor	JarProcessor
    //   82	12	3	e	java.util.zip.ZipException
    //   100	12	3	e	IOException
    //   166	163	3	properties	Properties
    //   196	30	4	packProperties	File
    //   308	11	4	filter	FileFilter
    //   335	13	4	e	FileNotFoundException
    //   215	65	5	in	java.io.InputStream
    //   244	13	6	e	IOException
    //   269	8	7	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   68	79	82	java/util/zip/ZipException
    //   68	79	100	java/io/IOException
    //   217	241	244	java/io/IOException
    //   217	261	269	finally
    //   300	332	335	java/io/FileNotFoundException
  }
  
  public static class Options
  {
    public String outputDir = ".";
    public String signCommand = null;
    public boolean pack = false;
    public boolean repack = false;
    public boolean unpack = false;
    public boolean verbose = false;
    public boolean processAll = false;
    public File input = null;
  }
  
  protected Options options = null;
  private Set packExclusions = null;
  private Set signExclusions = null;
  
  protected FileFilter createFileFilter(Options processOptions)
  {
    return unpack ? Utils.PACK_GZ_FILTER : Utils.JAR_FILTER;
  }
  
  protected String getRelativeName(File file)
  {
    if (options.input == null) {
      return file.toString();
    }
    try
    {
      File input = options.input.getCanonicalFile();
      File subFile = file.getCanonicalFile();
      if (input.isFile()) {
        return subFile.getName();
      }
      if (!subFile.toString().startsWith(input.toString())) {
        return file.toString();
      }
      File parent = subFile.getParentFile();
      String result = subFile.getName();
      while (!parent.equals(input))
      {
        result = parent.getName() + '/' + result;
        parent = parent.getParentFile();
      }
      return result;
    }
    catch (IOException localIOException) {}
    return file.getName();
  }
  
  private boolean shouldPack(String name)
  {
    if (!options.pack) {
      return false;
    }
    return packExclusions == null;
  }
  
  private boolean shouldSign(String name)
  {
    if (options.signCommand == null) {
      return false;
    }
    return signExclusions == null;
  }
  
  private boolean shouldRepack(String name)
  {
    if ((shouldSign(name)) && (shouldPack(name))) {
      return true;
    }
    if (!options.repack) {
      return false;
    }
    return packExclusions == null;
  }
  
  protected void process(File input, FileFilter filter, boolean verbose, JarProcessor processor, Properties packProperties)
    throws FileNotFoundException
  {
    if (!input.exists()) {
      throw new FileNotFoundException();
    }
    File[] files = null;
    if (input.isDirectory()) {
      files = input.listFiles();
    } else if (filter.accept(input)) {
      files = new File[] { input };
    } else {
      return;
    }
    for (int i = 0; i < files.length; i++) {
      if (files[i].isDirectory()) {
        processDirectory(files[i], filter, verbose, processor, packProperties);
      } else if (filter.accept(files[i])) {
        try
        {
          processor.clearProcessSteps();
          if (options.unpack)
          {
            addUnpackStep(processor, packProperties, options);
            processor.processJar(files[i]);
          }
          else
          {
            String name = getRelativeName(files[i]);
            boolean sign = shouldSign(name);
            boolean repack = shouldRepack(name);
            if ((repack) || (sign))
            {
              processor.clearProcessSteps();
              if (repack) {
                addPackUnpackStep(processor, packProperties, options);
              }
              if (sign) {
                addSignStep(processor, packProperties, options);
              }
              files[i] = processor.processJar(files[i]);
            }
            if (shouldPack(name))
            {
              processor.clearProcessSteps();
              addPackStep(processor, packProperties, options);
              processor.processJar(files[i]);
            }
          }
        }
        catch (IOException e)
        {
          if (verbose) {
            e.printStackTrace();
          }
        }
      }
    }
  }
  
  protected void processDirectory(File input, FileFilter filter, boolean verbose, JarProcessor processor, Properties packProperties)
    throws FileNotFoundException
  {
    if (!input.isDirectory()) {
      return;
    }
    String dir = processor.getWorkingDirectory();
    processor.setWorkingDirectory(dir + "/" + input.getName());
    process(input, filter, verbose, processor, packProperties);
    processor.setWorkingDirectory(dir);
  }
  
  public void addPackUnpackStep(JarProcessor processor, Properties properties, Options processOptions)
  {
    processor.addProcessStep(new PackUnpackStep(properties, verbose));
  }
  
  public void addSignStep(JarProcessor processor, Properties properties, Options processOptions)
  {
    processor.addProcessStep(new SignCommandStep(properties, signCommand, verbose));
  }
  
  public void addPackStep(JarProcessor processor, Properties properties, Options processOptions)
  {
    processor.addProcessStep(new PackStep(properties, verbose));
  }
  
  public void addUnpackStep(JarProcessor processor, Properties properties, Options processOptions)
  {
    processor.addProcessStep(new UnpackStep(properties, verbose));
  }
}

/* Location:
 * Qualified Name:     org.eclipse.internal.provisional.equinox.p2.jarprocessor.JarProcessorExecutor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
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