org.eclipse.equinox.p2.updatesite_1.0.400.v20120412-1615

a/io/OutputStream:close	()V
    //   153: goto +31 -> 184
    //   156: astore 9
    //   158: new 272	org/eclipse/core/runtime/Status
    //   161: dup
    //   162: iconst_4
    //   163: getstatic 486	org/eclipse/equinox/internal/p2/updatesite/Activator:ID	Ljava/lang/String;
    //   166: getstatic 488	org/eclipse/equinox/internal/p2/updatesite/Messages:ErrorReadingFeature	Ljava/lang/String;
    //   169: aload_2
    //   170: invokestatic 592	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;
    //   173: aload 9
    //   175: invokespecial 537	org/eclipse/core/runtime/Status:<init>	(ILjava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
    //   178: invokestatic 545	org/eclipse/equinox/internal/p2/core/helpers/LogHelper:log	(Lorg/eclipse/core/runtime/IStatus;)V
    //   181: goto -49 -> 132
    //   184: aload 5
    //   186: invokeinterface 605 1 0
    //   191: ifeq +6 -> 197
    //   194: goto +12 -> 206
    //   197: iinc 6 1
    //   200: iload 6
    //   202: iconst_2
    //   203: if_icmplt -157 -> 46
    //   206: aload_3
    //   207: invokeinterface 603 1 0
    //   212: ifeq +11 -> 223
    //   215: new 271	org/eclipse/core/runtime/OperationCanceledException
    //   218: dup
    //   219: invokespecial 534	org/eclipse/core/runtime/OperationCanceledException:<init>	()V
    //   222: athrow
    //   223: aload 5
    //   225: invokeinterface 605 1 0
    //   230: ifne +28 -> 258
    //   233: new 286	org/eclipse/equinox/p2/core/ProvisionException
    //   236: dup
    //   237: aload 5
    //   239: invokespecial 582	org/eclipse/equinox/p2/core/ProvisionException:<init>	(Lorg/eclipse/core/runtime/IStatus;)V
    //   242: invokestatic 546	org/eclipse/equinox/internal/p2/core/helpers/LogHelper:log	(Lorg/eclipse/equinox/p2/core/ProvisionException;)V
    //   245: aload 4
    //   247: ifnull +9 -> 256
    //   250: aload 4
    //   252: invokevirtual 501	java/io/File:delete	()Z
    //   255: pop
    //   256: aconst_null
    //   257: areturn
    //   258: aload_1
    //   259: aload 4
    //   261: invokevirtual 548	org/eclipse/equinox/internal/p2/publisher/eclipse/FeatureParser:parse	(Ljava/io/File;)Lorg/eclipse/equinox/p2/publisher/eclipse/Feature;
    //   264: astore 11
    //   266: aload 4
    //   268: ifnull +9 -> 277
    //   271: aload 4
    //   273: invokevirtual 501	java/io/File:delete	()Z
    //   276: pop
    //   277: aload 11
    //   279: areturn
    //   280: astore 5
    //   282: new 272	org/eclipse/core/runtime/Status
    //   285: dup
    //   286: iconst_4
    //   287: getstatic 486	org/eclipse/equinox/internal/p2/updatesite/Activator:ID	Ljava/lang/String;
    //   290: getstatic 488	org/eclipse/equinox/internal/p2/updatesite/Messages:ErrorReadingFeature	Ljava/lang/String;
    //   293: aload_2
    //   294: invokestatic 592	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;
    //   297: aload 5
    //   299: invokespecial 537	org/eclipse/core/runtime/Status:<init>	(ILjava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
    //   302: invokestatic 545	org/eclipse/equinox/internal/p2/core/helpers/LogHelper:log	(Lorg/eclipse/core/runtime/IStatus;)V
    //   305: aload 4
    //   307: ifnull +28 -> 335
    //   310: aload 4
    //   312: invokevirtual 501	java/io/File:delete	()Z
    //   315: pop
    //   316: goto +19 -> 335
    //   319: astore 10
    //   321: aload 4
    //   323: ifnull +9 -> 332
    //   326: aload 4
    //   328: invokevirtual 501	java/io/File:delete	()Z
    //   331: pop
    //   332: aload 10
    //   334: athrow
    //   335: aconst_null
    //   336: areturn
    // Line number table:
    //   Java source line #250	-> byte code offset #0
    //   Java source line #251	-> byte code offset #3
    //   Java source line #252	-> byte code offset #15
    //   Java source line #253	-> byte code offset #21
    //   Java source line #256	-> byte code offset #28
    //   Java source line #257	-> byte code offset #37
    //   Java source line #259	-> byte code offset #40
    //   Java source line #260	-> byte code offset #46
    //   Java source line #261	-> byte code offset #55
    //   Java source line #262	-> byte code offset #63
    //   Java source line #264	-> byte code offset #81
    //   Java source line #265	-> byte code offset #97
    //   Java source line #267	-> byte code offset #99
    //   Java source line #268	-> byte code offset #107
    //   Java source line #269	-> byte code offset #109
    //   Java source line #286	-> byte code offset #132
    //   Java source line #287	-> byte code offset #137
    //   Java source line #270	-> byte code offset #143
    //   Java source line #272	-> byte code offset #145
    //   Java source line #267	-> byte code offset #148
    //   Java source line #268	-> byte code offset #156
    //   Java source line #269	-> byte code offset #158
    //   Java source line #270	-> byte code offset #181
    //   Java source line #273	-> byte code offset #184
    //   Java source line #274	-> byte code offset #194
    //   Java source line #259	-> byte code offset #197
    //   Java source line #276	-> byte code offset #206
    //   Java source line #277	-> byte code offset #215
    //   Java source line #278	-> byte code offset #223
    //   Java source line #279	-> byte code offset #233
    //   Java source line #286	-> byte code offset #245
    //   Java source line #287	-> byte code offset #250
    //   Java source line #280	-> byte code offset #256
    //   Java source line #282	-> byte code offset #258
    //   Java source line #286	-> byte code offset #266
    //   Java source line #287	-> byte code offset #271
    //   Java source line #282	-> byte code offset #277
    //   Java source line #283	-> byte code offset #280
    //   Java source line #284	-> byte code offset #282
    //   Java source line #286	-> byte code offset #305
    //   Java source line #287	-> byte code offset #310
    //   Java source line #285	-> byte code offset #319
    //   Java source line #286	-> byte code offset #321
    //   Java source line #287	-> byte code offset #326
    //   Java source line #288	-> byte code offset #332
    //   Java source line #289	-> byte code offset #335
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	337	0	this	UpdateSite
    //   0	337	1	featureParser	FeatureParser
    //   0	337	2	featureURI	URI
    //   0	337	3	monitor	IProgressMonitor
    //   1	326	4	featureFile	File
    //   38	55	5	transferResult	org.eclipse.core.runtime.IStatus
    //   145	93	5	transferResult	org.eclipse.core.runtime.IStatus
    //   258	1	5	transferResult	org.eclipse.core.runtime.IStatus
    //   280	18	5	e	IOException
    //   41	3	6	i	int
    //   145	56	6	i	int
    //   79	21	7	destination	java.io.OutputStream
    //   145	4	7	destination	java.io.OutputStream
    //   97	49	8	localObject1	Object
    //   107	18	9	e	IOException
    //   156	18	9	e	IOException
    //   319	14	10	localObject2	Object
    //   264	14	11	localFeature	Feature
    // Exception table:
    //   from	to	target	type
    //   81	97	97	finally
    //   99	104	107	java/io/IOException
    //   148	153	156	java/io/IOException
    //   28	132	280	java/io/IOException
    //   145	245	280	java/io/IOException
    //   258	266	280	java/io/IOException
    //   28	132	319	finally
    //   145	245	319	finally
    //   258	266	319	finally
    //   280	305	319	finally
  }
  
  private UpdateSite(SiteModel site, URI location, Transport transport, String checksum)
  {
    this.site = site;
    this.location = location;
    this.checksum = checksum;
    rootLocation = getRootLocation();
    this.transport = transport;
  }
  
  private URI getRootLocation()
  {
    String locationString = location.toString();
    int slashIndex = locationString.lastIndexOf('/');
    if ((slashIndex == -1) || (slashIndex == locationString.length() - 1)) {
      return location;
    }
    return URI.create(locationString.substring(0, slashIndex + 1));
  }
  
  private URI getArchiveURI(URI base, String identifier)
  {
    URLEntry[] archives = site.getArchives();
    for (int i = 0; (archives != null) && (i < archives.length); i++)
    {
      URLEntry entry = archives[i];
      if (identifier.equals(entry.getAnnotation())) {
        return internalGetURI(base, entry.getURL());
      }
    }
    return null;
  }
  
  public String getChecksum()
  {
    return checksum;
  }
  
  public URI getSiteFeatureURI(SiteFeature siteFeature)
  {
    URL url = siteFeature.getURL();
    try
    {
      if (url != null) {
        return URIUtil.toURI(url);
      }
    }
    catch (URISyntaxException localURISyntaxException)
    {
      URI base = getBaseURI();
      String featureURIString = siteFeature.getURLString();
      return internalGetURI(base, featureURIString);
    }
  }
  
  public URI getFeatureURI(String id, String version)
  {
    SiteFeature[] entries = site.getFeatures();
    for (int i = 0; i < entries.length; i++) {
      if ((id.equals(entries[i].getFeatureIdentifier())) && (version.equals(entries[i].getFeatureVersion()))) {
        return getSiteFeatureURI(entries[i]);
      }
    }
    URI base = getBaseURI();
    URI url = getArchiveURI(base, "features/" + id + "_" + version + ".jar");
    if (url != null) {
      return url;
    }
    return URIUtil.append(base, "features/" + id + "_" + version + ".jar");
  }
  
  public URI getLocation()
  {
    return location;
  }
  
  public String getMirrorsURI()
  {
    String mirrors = site.getMirrorsURI();
    if (mirrors == null) {
      return null;
    }
    int index = mirrors.indexOf("site.xml");
    if (index != -1) {
      mirrors = mirrors.substring(0, index) + mirrors.substring(index + "site.xml".length());
    }
    return mirrors;
  }
  
  public URI getPluginURI(FeatureEntry plugin)
  {
    URI base = getBaseURI();
    String path = "plugins/" + plugin.getId() + "_" + plugin.getVersion() + ".jar";
    URI url = getArchiveURI(base, path);
    if (url != null) {
      return url;
    }
    return URIUtil.append(base, path);
  }
  
  private URI getBaseURI()
  {
    URI base = null;
    String siteURIString = site.getLocationURIString();
    if (siteURIString != null)
    {
      if (!siteURIString.endsWith("/")) {
        siteURIString = siteURIString + "/";
      }
      base = internalGetURI(rootLocation, siteURIString);
    }
    if (base == null) {
      base = rootLocation;
    }
    return base;
  }
  
  public SiteModel getSite()
  {
    return site;
  }
  
  private URI internalGetURI(URI base, String trailing)
  {
    if (trailing == null) {
      return null;
    }
    return URIUtil.makeAbsolute(URI.create(trailing), base);
  }
  
  public synchronized Feature[] loadFeatures(IProgressMonitor monitor)
    throws ProvisionException
  {
    if (!featureCache.isEmpty()) {
      return (Feature[])featureCache.values().toArray(new Feature[featureCache.size()]);
    }
    Feature[] result = loadFeaturesFromDigest(monitor);
    return result == null ? loadFeaturesFromSite(monitor) : result;
  }
  
  /* Error */
  private Feature[] loadFeaturesFromDigest(IProgressMonitor monitor)
  {
    // Byte code:
    //   0: aconst_null
    //   1: astore_2
    //   2: iconst_0
    //   3: istore_3
    //   4: aload_0
    //   5: invokespecial 569	org/eclipse/equinox/internal/p2/updatesite/UpdateSite:getDigestURI	()Ljava/net/URI;
    //   8: astore 4
    //   10: ldc 6
    //   12: aload 4
    //   14: invokevirtual 525	java/net/URI:getScheme	()Ljava/lang/String;
    //   17: invokevirtual 514	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   20: ifeq +36 -> 56
    //   23: aload 4
    //   25: invokestatic 540	org/eclipse/core/runtime/URIUtil:toFile	(Ljava/net/URI;)Ljava/io/File;
    //   28: astore_2
    //   29: aload_2
    //   30: invokevirtual 502	java/io/File:exists	()Z
    //   33: ifne +18 -> 51
    //   36: iload_3
    //   37: ifne +12 -> 49
    //   40: aload_2
    //   41: ifnull +8 -> 49
    //   44: aload_2
    //   45: invokevirtual 501	java/io/File:delete	()Z
    //   48: pop
    //   49: aconst_null
    //   50: areturn
    //   51: iconst_1
    //   52: istore_3
    //   53: goto +211 -> 264
    //   56: ldc_w 242
    //   59: ldc_w 238
    //   62: invokestatic 504	java/io/File:createTempFile	(Ljava/lang/String;Ljava/lang/String;)Ljava/io/File;
    //   65: astore_2
    //   66: new 246	java/io/BufferedOutputStream
    //   69: dup
    //   70: new 250	java/io/FileOutputStream
    //   73: dup
    //   74: aload_2
    //   75: invokespecial 507	java/io/FileOutputStream:<init>	(Ljava/io/File;)V
    //   78: invokespecial 500	java/io/BufferedOutputStream:<init>	(Ljava/io/OutputStream;)V
    //   81: astore 5
    //   83: aconst_null
    //   84: astore 6
    //   86: aload_0
    //   87: getfield 496	org/eclipse/equinox/internal/p2/updatesite/UpdateSite:transport	Lorg/eclipse/equinox/internal/p2/repository/Transport;
    //   90: aload 4
    //   92: aload 5
    //   94: aload_1
    //   95: invokevirtual 549	org/eclipse/equinox/internal/p2/repository/Transport:download	(Ljava/net/URI;Ljava/io/OutputStream;Lorg/eclipse/core/runtime/IProgressMonitor;)Lorg/eclipse/core/runtime/IStatus;
    //   98: astore 6
    //   100: goto +59 -> 159
    //   103: astore 7
    //   105: aload 5
    //   107: invokevirtual 499	java/io/BufferedOutputStream:close	()V
    //   110: goto +46 -> 156
    //   113: astore 8
    //   115: new 272	org/eclipse/core/runtime/Status
    //   118: dup
    //   119: iconst_4
    //   120: getstatic 486	org/eclipse/equinox/internal/p2/updatesite/Activator:ID	Ljava/lang/String;
    //   123: getstatic 488	org/eclipse/equinox/internal/p2/updatesite/Messages:ErrorReadingFeature	Ljava/lang/String;
    //   126: aload_0
    //   127: getfield 491	org/eclipse/equinox/internal/p2/updatesite/UpdateSite:location	Ljava/net/URI;
    //   130: invokestatic 592	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;
    //   133: aload 8
    //   135: invokespecial 537	org/eclipse/core/runtime/Status:<init>	(ILjava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
    //   138: invokestatic 545	org/eclipse/equinox/internal/p2/core/helpers/LogHelper:log	(Lorg/eclipse/core/runtime/IStatus;)V
    //   141: iload_3
    //   142: ifne +12 -> 154
    //   145: aload_2
    //   146: ifnull +8 -> 154
    //   149: aload_2
    //   150: invokevirtual 501	java/io/File:delete	()Z
    //   153: pop
    //   154: aconst_null
    //   155: areturn
    //   156: aload 7
    //   158: athrow
    //   159: aload 5
    //   161: invokevirtual 499	java/io/BufferedOutputStream:close	()V
    //   164: goto +46 -> 210
    //   167: astore 8
    //   169: new 272	org/eclipse/core/runtime/Status
    //   172: dup
    //   173: iconst_4
    //   174: getstatic 486	org/eclipse/equinox/internal/p2/updatesite/Activator:ID	Ljava/lang/String;
    //   177: getstatic 488	org/eclipse/equinox/internal/p2/updatesite/Messages:ErrorReadingFeature	Ljava/lang/String;
    //   180: aload_0
    //   181: getfield 491	org/eclipse/equinox/internal/p2/updatesite/UpdateSite:location	Ljava/net/URI;
    //   184: invokestatic 592	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;
    //   187: aload 8
    //   189: invokespecial 537	org/eclipse/core/runtime/Status:<init>	(ILjava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
    //   192: invokestatic 545	org/eclipse/equinox/internal/p2/core/helpers/LogHelper:log	(Lorg/eclipse/core/runtime/IStatus;)V
    //   195: iload_3
    //   196: ifne +12 -> 208
    //   199: aload_2
    //   200: ifnull +8 -> 208
    //   203: aload_2
    //   204: invokevirtual 501	java/io/File:delete	()Z
    //   207: pop
    //   208: aconst_null
    //   209: areturn
    //   210: aload 6
    //   212: invokeinterface 604 1 0
    //   217: bipush 8
    //   219: if_icmpeq +12 -> 231
    //   222: aload_1
    //   223: invokeinterface 603 1 0
    //   228: ifeq +11 -> 239
    //   231: new 271	org/eclipse/core/runtime/OperationCanceledException
    //   234: dup
    //   235: invokespecial 534	org/eclipse/core/runtime/OperationCanceledException:<init>	()V
    //   238: athrow
    //   239: aload 6
    //   241: invokeinterface 605 1 0
    //   246: ifne +18 -> 264
    //   249: iload_3
    //   250: ifne +12 -> 262
    //   253: aload_2
    //   254: ifnull +8 -> 262
    //   257: aload_2
    //   258: invokevirtual 501	java/io/File:delete	()Z
    //   261: pop
    //   262: aconst_null
    //   263: areturn
    //   264: new 281	org/eclipse/equinox/internal/p2/updatesite/DigestParser
    //   267: dup
    //   268: invokespecial 554	org/eclipse/equinox/internal/p2/updatesite/DigestParser:<init>	()V
    //   271: aload_2
    //   272: aload 4
    //   274: invokevirtual 555	org/eclipse/equinox/internal/p2/updatesite/DigestParser:parse	(Ljava/io/File;Ljava/net/URI;)[Lorg/eclipse/equinox/p2/publisher/eclipse/Feature;
    //   277: astore 5
    //   279: aload 5
    //   281: ifnonnull +18 -> 299
    //   284: iload_3
    //   285: ifne +12 -> 297
    //   288: aload_2
    //   289: ifnull +8 -> 297
    //   292: aload_2
    //   293: invokevirtual 501	java/io/File:delete	()Z
    //   296: pop
    //   297: aconst_null
    //   298: areturn
    //   299: new 262	java/util/HashMap
    //   302: dup
    //   303: aload 5
    //   305: arraylength
    //   306: invokespecial 529	java/util/HashMap:<init>	(I)V
    //   309: astore 6
    //   311: iconst_0
    //   312: istore 7
    //   314: goto +60 -> 374
    //   317: new 257	java/lang/StringBuffer
    //   320: dup
    //   321: aload 5
    //   323: iload 7
    //   325: aaload
    //   326: invokevirtual 583	org/eclipse/equinox/p2/publisher/eclipse/Feature:getId	()Ljava/lang/String;
    //   329: invokestatic 519	java/lang/String:valueOf	(Ljava/lang/Object;)Ljava/lang/String;
    //   332: invokespecial 521	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   335: ldc 3
    //   337: invokevirtual 522	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   340: aload 5
    //   342: iload 7
    //   344: aaload
    //   345: invokevirtual 584	org/eclipse/equinox/p2/publisher/eclipse/Feature:getVersion	()Ljava/lang/String;
    //   348: invokevirtual 522	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   351: invokevirtual 520	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   354: astore 8
    //   356: aload 6
    //   358: aload 8
    //   360: aload 5
    //   362: iload 7
    //   364: aaload
    //   365: invokeinterface 600 3 0
    //   370: pop
    //   371: iinc 7 1
    //   374: iload 7
    //   376: aload 5
    //   378: arraylength
    //   379: if_icmplt -62 -> 317
    //   382: aload_0
    //   383: aload 6
    //   385: putfield 494	org/eclipse/equinox/internal/p2/updatesite/UpdateSite:featureCache	Ljava/util/Map;
    //   388: aload 5
    //   390: astore 10
    //   392: iload_3
    //   393: ifne +12 -> 405
    //   396: aload_2
    //   397: ifnull +8 -> 405
    //   400: aload_2
    //   401: invokevirtual 501	java/io/File:delete	()Z
    //   404: pop
    //   405: aload 10
    //   407: areturn
    //   408: pop
    //   409: iload_3
    //   410: ifne +77 -> 487
    //   413: aload_2
    //   414: ifnull +73 -> 487
    //   417: aload_2
    //   418: invokevirtual 501	java/io/File:delete	()Z
    //   421: pop
    //   422: goto +65 -> 487
    //   425: astore 4
    //   427: new 272	org/eclipse/core/runtime/Status
    //   430: dup
    //   431: iconst_4
    //   432: getstatic 486	org/eclipse/equinox/internal/p2/updatesite/Activator:ID	Ljava/lang/String;
    //   435: getstatic 487	org/eclipse/equinox/internal/p2/updatesite/Messages:ErrorReadingDigest	Ljava/lang/String;
    //   438: aload_0
    //   439: getfield 491	org/eclipse/equinox/internal/p2/updatesite/UpdateSite:location	Ljava/net/URI;
    //   442: invokestatic 592	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;
    //   445: aload 4
    //   447: invokespecial 537	org/eclipse/core/runtime/Status:<init>	(ILjava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
    //   450: invokestatic 545	org/eclipse/equinox/internal/p2/core/helpers/LogHelper:log	(Lorg/eclipse/core/runtime/IStatus;)V
    //   453: iload_3
    //   454: ifne +33 -> 487
    //   457: aload_2
    //   458: ifnull +29 -> 487
    //   461: aload_2
    //   462: invokevirtual 501	java/io/File:delete	()Z
    //   465: pop
    //   466: goto +21 -> 487
    //   469: astore 9
    //   471: iload_3
    //   472: ifne +12 -> 484
    //   475: aload_2
    //   476: ifnull +8 -> 484
    //   479: aload_2
    //   480: invokevirtual 501	java/io/File:delete	()Z
    //   483: pop
    //   484: aload 9
    //   486: athrow
    //   487: aconst_null
    //   488: areturn
    // Line number table:
    //   Java source line #445	-> byte code offset #0
    //   Java source line #446	-> byte code offset #2
    //   Java source line #448	-> byte code offset #4
    //   Java source line #449	-> byte code offset #10
    //   Java source line #450	-> byte code offset #23
    //   Java source line #451	-> byte code offset #29
    //   Java source line #489	-> byte code offset #36
    //   Java source line #490	-> byte code offset #44
    //   Java source line #452	-> byte code offset #49
    //   Java source line #453	-> byte code offset #51
    //   Java source line #455	-> byte code offset #56
    //   Java source line #456	-> byte code offset #66
    //   Java source line #457	-> byte code offset #83
    //   Java source line #459	-> byte code offset #86
    //   Java source line #460	-> byte code offset #103
    //   Java source line #462	-> byte code offset #105
    //   Java source line #463	-> byte code offset #113
    //   Java source line #464	-> byte code offset #115
    //   Java source line #489	-> byte code offset #141
    //   Java source line #490	-> byte code offset #149
    //   Java source line #465	-> byte code offset #154
    //   Java source line #467	-> byte code offset #156
    //   Java source line #462	-> byte code offset #159
    //   Java source line #463	-> byte code offset #167
    //   Java source line #464	-> byte code offset #169
    //   Java source line #489	-> byte code offset #195
    //   Java source line #490	-> byte code offset #203
    //   Java source line #465	-> byte code offset #208
    //   Java source line #468	-> byte code offset #210
    //   Java source line #469	-> byte code offset #231
    //   Java source line #470	-> byte code offset #239
    //   Java source line #489	-> byte code offset #249
    //   Java source line #490	-> byte code offset #257
    //   Java source line #471	-> byte code offset #262
    //   Java source line #473	-> byte code offset #264
    //   Java source line #474	-> byte code offset #279
    //   Java source line #489	-> byte code offset #284
    //   Java source line #490	-> byte code offset #292
    //   Java source line #475	-> byte code offset #297
    //   Java source line #476	-> byte code offset #299
    //   Java source line #477	-> byte code offset #311
    //   Java source line #478	-> byte code offset #317
    //   Java source line #479	-> byte code offset #356
    //   Java source line #477	-> byte code offset #371
    //   Java source line #481	-> byte code offset #382
    //   Java source line #482	-> byte code offset #388
    //   Java source line #489	-> byte code offset #392
    //   Java source line #490	-> byte code offset #400
    //   Java source line #482	-> byte code offset #405
    //   Java source line #483	-> byte code offset #408
    //   Java source line #489	-> byte code offset #409
    //   Java source line #490	-> byte code offset #417
    //   Java source line #486	-> byte code offset #425
    //   Java source line #487	-> byte code offset #427
    //   Java source line #489	-> byte code offset #453
    //   Java source line #490	-> byte code offset #461
    //   Java source line #488	-> byte code offset #469
    //   Java source line #489	-> byte code offset #471
    //   Java source line #490	-> byte code offset #479
    //   Java source line #491	-> byte code offset #484
    //   Java source line #492	-> byte code offset #487
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	489	0	this	UpdateSite
    //   0	489	1	monitor	IProgressMonitor
    //   1	479	2	digestFile	File
    //   3	469	3	local	boolean
    //   8	16	4	digestURI	URI
    //   51	40	4	digestURI	URI
    //   156	1	4	digestURI	URI
    //   210	1	4	digestURI	URI
    //   264	9	4	digestURI	URI
    //   299	1	4	digestURI	URI
    //   425	21	4	e	IOException
    //   81	25	5	destination	java.io.BufferedOutputStream
    //   156	4	5	destination	java.io.BufferedOutputStream
    //   210	1	5	destination	java.io.BufferedOutputStream
    //   277	3	5	features	Feature[]
    //   299	90	5	features	Feature[]
    //   84	15	6	result	org.eclipse.core.runtime.IStatus
    //   156	1	6	result	org.eclipse.core.runtime.IStatus
    //   210	30	6	result	org.eclipse.core.runtime.IStatus
    //   309	75	6	tmpFeatureCache	Map<String, Feature>
    //   103	54	7	localObject1	Object
    //   312	68	7	i	int
    //   113	21	8	e	IOException
    //   167	21	8	e	IOException
    //   354	5	8	key	String
    //   469	16	9	localObject2	Object
    //   390	16	10	arrayOfFeature1	Feature[]
    //   408	1	27	localFileNotFoundException	java.io.FileNotFoundException
    // Exception table:
    //   from	to	target	type
    //   86	103	103	finally
    //   105	110	113	java/io/IOException
    //   159	164	167	java/io/IOException
    //   4	36	408	java/io/FileNotFoundException
    //   51	141	408	java/io/FileNotFoundException
    //   156	195	408	java/io/FileNotFoundException
    //   210	249	408	java/io/FileNotFoundException
    //   264	284	408	java/io/FileNotFoundException
    //   299	392	408	java/io/FileNotFoundException
    //   4	36	425	java/io/IOException
    //   51	141	425	java/io/IOException
    //   156	195	425	java/io/IOException
    //   210	249	425	java/io/IOException
    //   264	284	425	java/io/IOException
    //   299	392	425	java/io/IOException
    //   4	36	469	finally
    //   51	141	469	finally
    //   156	195	469	finally
    //   210	249	469	finally
    //   264	284	469	finally
    //   299	392	469	finally
    //   408	409	469	finally
    //   425	453	469	finally
  }
  
  private URI getDigestURI()
  {
    URI digestBase = null;
    String digestURIString = site.getDigestURIString();
    if (digestURIString != null)
    {
      if (!digestURIString.endsWith("/")) {
        digestURIString = digestURIString + "/";
      }
      digestBase = internalGetURI(rootLocation, digestURIString);
    }
    if (digestBase == null) {
      digestBase = rootLocation;
    }
    return URIUtil.append(digestBase, "digest.zip");
  }
  
  private Feature[] loadFeaturesFromSite(IProgressMonitor monitor)
    throws ProvisionException
  {
    SiteFeature[] siteFeatures = site.getFeatures();
    FeatureParser featureParser = new FeatureParser();
    Map<String, Feature> tmpFeatureCache = new HashMap(siteFeatures.length);
    for (int i = 0; i < siteFeatures.length; i++)
    {
      if (monitor.isCanceled()) {
        throw new OperationCanceledException();
      }
      SiteFeature siteFeature = siteFeatures[i];
      String key = null;
      if ((siteFeature.getFeatureIdentifier() != null) && (siteFeature.getFeatureVersion() != null))
      {
        key = siteFeature.getFeatureIdentifier() + "_" + siteFeature.getFeatureVersion();
        if (tmpFeatureCache.containsKey(key)) {}
      }
      else
      {
        URI featureURI = getSiteFeatureURI(siteFeature);
        Feature feature = parseFeature(featureParser, featureURI, new NullProgressMonitor());
        if (feature == null)
        {
          LogHelper.log(new Status(4, Activator.ID, NLS.bind(Messages.ErrorReadingFeature, featureURI)));
        }
        else
        {
          if (key == null)
          {
            siteFeature.setFeatureIdentifier(feature.getId());
            siteFeature.setFeatureVersion(feature.getVersion());
            key = siteFeature.getFeatureIdentifier() + "_" + siteFeature.getFeatureVersion();
          }
          tmpFeatureCache.put(key, feature);
          loadIncludedFeatures(feature, featureParser, tmpFeatureCache, monitor);
        }
      }
    }
    featureCache = tmpFeatureCache;
    return (Feature[])featureCache.values().toArray(new Feature[featureCache.size()]);
  }
  
  private void loadIncludedFeatures(Feature feature, FeatureParser featureParser, Map<String, Feature> features, IProgressMonitor monitor)
    throws ProvisionException
  {
    FeatureEntry[] featureEntries = feature.getEntries();
    for (int i = 0; i < featureEntries.length; i++)
    {
      if (monitor.isCanceled()) {
        throw new OperationCanceledException();
      }
      FeatureEntry entry = featureEntries[i];
      if ((!entry.isRequires()) && (!entry.isPlugin()))
      {
        String key = entry.getId() + "_" + entry.getVersion();
        if (!features.containsKey(key))
        {
          URI includedFeatureURI = getFeatureURI(entry.getId(), entry.getVersion());
          Feature includedFeature = parseFeature(featureParser, includedFeatureURI, monitor);
          if (includedFeature == null)
          {
            LogHelper.log(new Status(4, Activator.ID, NLS.bind(Messages.ErrorReadingFeature, includedFeatureURI)));
          }
          else
          {
            features.put(key, includedFeature);
            loadIncludedFeatures(includedFeature, featureParser, features, monitor);
          }
        }
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.updatesite.UpdateSite
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.updatesite;

import java.net.URISyntaxException;
import org.eclipse.equinox.p2.publisher.AbstractPublisherApplication;
import org.eclipse.equinox.p2.publisher.IPublisherAction;
import org.eclipse.equinox.p2.publisher.PublisherInfo;
import org.eclipse.equinox.p2.publisher.actions.JREAction;

public class UpdateSitePublisherApplication
  extends AbstractPublisherApplication
{
  private String categoryQualifier = null;
  private String categoryVersion = null;
  
  protected void processParameter(String arg, String parameter, PublisherInfo pinfo)
    throws URISyntaxException
  {
    super.processParameter(arg, parameter, pinfo);
    if (arg.equalsIgnoreCase("-categoryQualifier")) {
      categoryQualifier = parameter;
    }
    if (arg.equalsIgnoreCase("-categoryVersion")) {
      categoryVersion = parameter;
    }
  }
  
  protected IPublisherAction[] createActions()
  {
    LocalUpdateSiteAction action = new LocalUpdateSiteAction(source, categoryQualifier);
    action.setCategoryVersion(categoryVersion);
    if (addJRE) {
      return new IPublisherAction[] { action, new JREAction(null) };
    }
    return new IPublisherAction[] { action };
  }
  
  private boolean addJRE = false;
  
  protected void processFlag(String flag, PublisherInfo publisherInfo)
  {
    super.processFlag(flag, publisherInfo);
    if (flag.equalsIgnoreCase("-addJREIU")) {
      addJRE = true;
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.updatesite.UpdateSitePublisherApplication
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.updatesite;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import org.eclipse.equinox.p2.metadata.IVersionedId;
import org.eclipse.equinox.p2.metadata.Version;

public class VersionSuffixGenerator
{
  public static final String VERSION_QUALIFIER = "qualifier";
  private static final int QUALIFIER_SUFFIX_VERSION = 1;
  public static final String BASE_64_ENCODING = "-0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
  private final int maxVersionSuffixLength;
  private final int significantDigits;
  
  public static String incrementQualifier(String qualifier)
  {
    for (int idx = qualifier.length() - 1; idx >= 0; idx--) {
      if (qualifier.charAt(idx) != 'z') {
        break;
      }
    }
    if (idx >= 0)
    {
      int c = "-0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".indexOf(qualifier.charAt(idx)) + 1;
      String newQualifier = qualifier.substring(0, idx);
      newQualifier = newQualifier + "-0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".charAt(c);
      return newQualifier;
    }
    return null;
  }
  
  private static void appendEncodedCharacter(StringBuffer buffer, int c)
  {
    while (c > 62)
    {
      buffer.append('z');
      c -= 63;
    }
    buffer.append(base64Character(c));
  }
  
  private static char base64Character(int number)
  {
    return (number < 0) || (number > 63) ? ' ' : "-0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".charAt(number);
  }
  
  private static int charValue(char c)
  {
    int index = "-0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".indexOf(c);
    
    return index + 1;
  }
  
  private static int computeNameSum(String name)
  {
    int sum = 0;
    int top = name.length();
    int lshift = 20;
    for (int idx = 0; idx < top; idx++)
    {
      int c = name.charAt(idx) & 0xFFFF;
      if ((c == 46) && (lshift > 0)) {
        lshift -= 4;
      } else {
        sum += (c << lshift);
      }
    }
    return sum;
  }
  
  private static int getIntSegment(Version v, int segment)
  {
    int segCount = v.getSegmentCount();
    if (segCount <= segment) {
      return 0;
    }
    Object seg = v.getSegment(segment);
    return (seg instanceof Integer) ? ((Integer)seg).intValue() : 0;
  }
  
  private static int getMajor(Version v)
  {
    return getIntSegment(v, 0);
  }
  
  private static int getMicro(Version v)
  {
    return getIntSegment(v, 2);
  }
  
  private static int getMinor(Version v)
  {
    return getIntSegment(v, 1);
  }
  
  private static String getQualifier(Version v)
  {
    int segCount = v.getSegmentCount();
    if (segCount == 0) {
      return null;
    }
    Object seg = v.getSegment(segCount - 1);
    return (seg instanceof String) ? (String)seg : null;
  }
  
  private static String lengthPrefixBase64(long number)
  {
    int length = 7;
    for (int i = 0; i < 7; i++) {
      if (number < 1L << i * 6 + 3)
      {
        length = i;
        break;
      }
    }
    StringBuffer result = new StringBuffer(length + 1);
    result.append(base64Character((length << 3) + (int)(number >> 6 * length & 0x7)));
    do
    {
      result.append(base64Character((int)(number >> 6 * length & 0x3F)));length--;
    } while (length >= 0);
    return result.toString();
  }
  
  public VersionSuffixGenerator()
  {
    this(-1, -1);
  }
  
  public VersionSuffixGenerator(int maxVersionSuffixLenght, int significantDigits)
  {
    maxVersionSuffixLength = (maxVersionSuffixLenght < 0 ? 45 : maxVersionSuffixLenght);
    this.significantDigits = (significantDigits < 0 ? Integer.MAX_VALUE : significantDigits);
  }
  
  public String generateSuffix(Collection<? extends IVersionedId> features, Collection<? extends IVersionedId> others)
  {
    if ((maxVersionSuffixLength <= 0) || ((features.isEmpty()) && (others.isEmpty()))) {
      return null;
    }
    long majorSum = 0L;
    long minorSum = 0L;
    long serviceSum = 0L;
    long nameCharsSum = 0L;
    
    majorSum += 1L;
    ArrayList<String> qualifiers = new ArrayList();
    
    Iterator<? extends IVersionedId> itor = features.iterator();
    while (itor.hasNext())
    {
      IVersionedId refFeature = (IVersionedId)itor.next();
      Version version = refFeature.getVersion();
      majorSum += getMajor(version);
      minorSum += getMinor(version);
      serviceSum += getMicro(version);
      qualifiers.add(getQualifier(version));
      nameCharsSum = computeNameSum(refFeature.getId());
    }
    itor = features.iterator();
    while (itor.hasNext())
    {
      IVersionedId refOther = (IVersionedId)itor.next();
      Version version = refOther.getVersion();
      majorSum += getMajor(version);
      minorSum += getMinor(version);
      serviceSum += getMicro(version);
      
      String qualifier = getQualifier(version);
      if ((qualifier != null) && (qualifier.endsWith("qualifier")))
      {
        int resultingLength = qualifier.length() - "qualifier".length();
        if (resultingLength > 0)
        {
          if (qualifier.charAt(resultingLength - 1) == '.') {
            resultingLength--;
          }
          qualifier = resultingLength > 0 ? qualifier.substring(0, resultingLength) : null;
        }
        else
        {
          qualifier = null;
        }
      }
      qualifiers.add(qualifier);
    }
    int longestQualifier = 0;
    int idx = qualifiers.size();
    do
    {
      String qualifier = (String)qualifiers.get(idx);
      if (qualifier != null)
      {
        if (qualifier.length() > significantDigits)
        {
          qualifier = qualifier.substring(0, significantDigits);
          qualifiers.set(idx, qualifier);
        }
        if (qualifier.length() > longestQualifier) {
          longestQualifier = qualifier.length();
        }
      }
      idx--;
    } while (idx >= 0);
    StringBuffer result = new StringBuffer();
    
    result.append(lengthPrefixBase64(majorSum));
    result.append(lengthPrefixBase64(minorSum));
    result.append(lengthPrefixBase64(serviceSum));
    result.append(lengthPrefixBase64(nameCharsSum));
    if (longestQualifier > 0)
    {
      int[] qualifierSums = new int[longestQualifier];
      int top = qualifiers.size();
      for (idx = 0; idx < top; idx++)
      {
        String qualifier = (String)qualifiers.get(idx);
        if (qualifier != null)
        {
          int qlen = qualifier.length();
          for (int j = 0; j < qlen; j++) {
            qualifierSums[j] += charValue(qualifier.charAt(j));
          }
        }
      }
      int carry = 0;
      for (int k = longestQualifier - 1; k >= 1; k--)
      {
        qualifierSums[k] += carry;
        carry = qualifierSums[k] / 65;
        qualifierSums[k] %= 65;
      }
      qualifierSums[0] += carry;
      
      result.append(lengthPrefixBase64(qualifierSums[0]));
      for (int m = 1; m < longestQualifier; m++) {
        appendEncodedCharacter(result, qualifierSums[m]);
      }
    }
    if (result.length() > maxVersionSuffixLength) {
      result.setLength(maxVersionSuffixLength);
    }
    int len = result.length();
    while ((len > 0) && (result.charAt(len - 1) == '-')) {
      result.setLength(--len);
    }
    return result.toString();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.updatesite.VersionSuffixGenerator
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.updatesite.artifact;

import java.io.OutputStream;
import java.net.URI;
import java.util.Map;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.Version;
import org.eclipse.equinox.p2.query.IQuery;
import org.eclipse.equinox.p2.query.IQueryResult;
import org.eclipse.equinox.p2.query.IQueryable;
import org.eclipse.equinox.p2.repository.IRunnableWithProgress;
import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRequest;

public class UpdateSiteArtifactRepository
  implements IArtifactRepository
{
  public static final St
1 2 3 4 5

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