org.eclipse.equinox.p2.extensionlocation_1.2.100.v20110808-1657

);
    if (feature == null) {
      return false;
    }
    for (int i = 0; i < removed.length; i++)
    {
      String line = removed[i];
      if (line.equals(feature.getId() + '_' + feature.getVersion())) {
        return true;
      }
    }
    return false;
  }
  
  private Feature getFeature(File location)
  {
    if (location.isFile()) {
      return null;
    }
    File manifest = new File(location, "feature.xml");
    if (!manifest.exists()) {
      return null;
    }
    FeatureParser parser = new FeatureParser();
    return parser.parse(location);
  }
  
  /* Error */
  private String[] getToBeRemoved()
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 435	org/eclipse/equinox/internal/p2/extensionlocation/SiteListener:toBeRemoved	[Ljava/lang/String;
    //   4: ifnull +8 -> 12
    //   7: aload_0
    //   8: getfield 435	org/eclipse/equinox/internal/p2/extensionlocation/SiteListener:toBeRemoved	[Ljava/lang/String;
    //   11: areturn
    //   12: invokestatic 476	org/eclipse/equinox/internal/p2/extensionlocation/Activator:getConfigurationLocation	()Ljava/io/File;
    //   15: astore_1
    //   16: aload_1
    //   17: ifnonnull +33 -> 50
    //   20: new 231	org/eclipse/core/runtime/Status
    //   23: dup
    //   24: iconst_4
    //   25: ldc_w 208
    //   28: ldc_w 206
    //   31: invokespecial 471	org/eclipse/core/runtime/Status:<init>	(ILjava/lang/String;Ljava/lang/String;)V
    //   34: invokestatic 475	org/eclipse/equinox/internal/p2/core/helpers/LogHelper:log	(Lorg/eclipse/core/runtime/IStatus;)V
    //   37: aload_0
    //   38: iconst_0
    //   39: anewarray 216	java/lang/String
    //   42: putfield 435	org/eclipse/equinox/internal/p2/extensionlocation/SiteListener:toBeRemoved	[Ljava/lang/String;
    //   45: aload_0
    //   46: getfield 435	org/eclipse/equinox/internal/p2/extensionlocation/SiteListener:toBeRemoved	[Ljava/lang/String;
    //   49: areturn
    //   50: new 212	java/io/File
    //   53: dup
    //   54: aload_1
    //   55: ldc_w 209
    //   58: invokespecial 447	java/io/File:<init>	(Ljava/io/File;Ljava/lang/String;)V
    //   61: astore_2
    //   62: aload_2
    //   63: invokevirtual 438	java/io/File:exists	()Z
    //   66: ifne +16 -> 82
    //   69: aload_0
    //   70: iconst_0
    //   71: anewarray 216	java/lang/String
    //   74: putfield 435	org/eclipse/equinox/internal/p2/extensionlocation/SiteListener:toBeRemoved	[Ljava/lang/String;
    //   77: aload_0
    //   78: getfield 435	org/eclipse/equinox/internal/p2/extensionlocation/SiteListener:toBeRemoved	[Ljava/lang/String;
    //   81: areturn
    //   82: aload_0
    //   83: iconst_0
    //   84: anewarray 216	java/lang/String
    //   87: putfield 435	org/eclipse/equinox/internal/p2/extensionlocation/SiteListener:toBeRemoved	[Ljava/lang/String;
    //   90: new 228	java/util/Properties
    //   93: dup
    //   94: invokespecial 465	java/util/Properties:<init>	()V
    //   97: astore_3
    //   98: aconst_null
    //   99: astore 4
    //   101: new 211	java/io/BufferedInputStream
    //   104: dup
    //   105: new 213	java/io/FileInputStream
    //   108: dup
    //   109: aload_2
    //   110: invokespecial 448	java/io/FileInputStream:<init>	(Ljava/io/File;)V
    //   113: invokespecial 437	java/io/BufferedInputStream:<init>	(Ljava/io/InputStream;)V
    //   116: astore 4
    //   118: aload_3
    //   119: aload 4
    //   121: invokevirtual 466	java/util/Properties:load	(Ljava/io/InputStream;)V
    //   124: goto +40 -> 164
    //   127: pop
    //   128: aload 4
    //   130: ifnull +48 -> 178
    //   133: aload 4
    //   135: invokevirtual 449	java/io/InputStream:close	()V
    //   138: goto +40 -> 178
    //   141: pop
    //   142: goto +36 -> 178
    //   145: astore 5
    //   147: aload 4
    //   149: ifnull +12 -> 161
    //   152: aload 4
    //   154: invokevirtual 449	java/io/InputStream:close	()V
    //   157: goto +4 -> 161
    //   160: pop
    //   161: aload 5
    //   163: athrow
    //   164: aload 4
    //   166: ifnull +12 -> 178
    //   169: aload 4
    //   171: invokevirtual 449	java/io/InputStream:close	()V
    //   174: goto +4 -> 178
    //   177: pop
    //   178: aload_0
    //   179: getfield 432	org/eclipse/equinox/internal/p2/extensionlocation/SiteListener:siteLocation	Ljava/lang/String;
    //   182: astore 5
    //   184: aload 5
    //   186: ldc_w 201
    //   189: invokevirtual 453	java/lang/String:endsWith	(Ljava/lang/String;)Z
    //   192: ifeq +23 -> 215
    //   195: aload 5
    //   197: iconst_0
    //   198: aload 5
    //   200: invokevirtual 450	java/lang/String:length	()I
    //   203: ldc_w 201
    //   206: invokevirtual 450	java/lang/String:length	()I
    //   209: isub
    //   210: invokevirtual 452	java/lang/String:substring	(II)Ljava/lang/String;
    //   213: astore 5
    //   215: new 220	java/util/ArrayList
    //   218: dup
    //   219: invokespecial 462	java/util/ArrayList:<init>	()V
    //   222: astore 6
    //   224: aload_3
    //   225: invokevirtual 467	java/util/Properties:elements	()Ljava/util/Enumeration;
    //   228: astore 7
    //   230: goto +78 -> 308
    //   233: aload 7
    //   235: invokeinterface 528 1 0
    //   240: checkcast 216	java/lang/String
    //   243: astore 8
    //   245: new 230	java/util/StringTokenizer
    //   248: dup
    //   249: aload 8
    //   251: ldc_w 203
    //   254: invokespecial 470	java/util/StringTokenizer:<init>	(Ljava/lang/String;Ljava/lang/String;)V
    //   257: astore 9
    //   259: aload 9
    //   261: invokevirtual 469	java/util/StringTokenizer:nextToken	()Ljava/lang/String;
    //   264: astore 10
    //   266: aload 5
    //   268: aload 10
    //   270: invokestatic 474	org/eclipse/core/runtime/URIUtil:fromString	(Ljava/lang/String;)Ljava/net/URI;
    //   273: invokevirtual 459	java/net/URI:toString	()Ljava/lang/String;
    //   276: invokevirtual 451	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   279: ifne +16 -> 295
    //   282: goto +26 -> 308
    //   285: astore 11
    //   287: aload 11
    //   289: invokevirtual 461	java/net/URISyntaxException:printStackTrace	()V
    //   292: goto +16 -> 308
    //   295: aload 6
    //   297: aload 9
    //   299: invokevirtual 469	java/util/StringTokenizer:nextToken	()Ljava/lang/String;
    //   302: invokeinterface 532 2 0
    //   307: pop
    //   308: aload 7
    //   310: invokeinterface 527 1 0
    //   315: ifne -82 -> 233
    //   318: aload_0
    //   319: aload 6
    //   321: aload 6
    //   323: invokeinterface 531 1 0
    //   328: anewarray 216	java/lang/String
    //   331: invokeinterface 533 2 0
    //   336: checkcast 210	[Ljava/lang/String;
    //   339: putfield 435	org/eclipse/equinox/internal/p2/extensionlocation/SiteListener:toBeRemoved	[Ljava/lang/String;
    //   342: aload_0
    //   343: getfield 435	org/eclipse/equinox/internal/p2/extensionlocation/SiteListener:toBeRemoved	[Ljava/lang/String;
    //   346: areturn
    // Line number table:
    //   Java source line #201	-> byte code offset #0
    //   Java source line #202	-> byte code offset #7
    //   Java source line #203	-> byte code offset #12
    //   Java source line #204	-> byte code offset #16
    //   Java source line #205	-> byte code offset #20
    //   Java source line #206	-> byte code offset #37
    //   Java source line #207	-> byte code offset #45
    //   Java source line #209	-> byte code offset #50
    //   Java source line #210	-> byte code offset #62
    //   Java source line #211	-> byte code offset #69
    //   Java source line #212	-> byte code offset #77
    //   Java source line #215	-> byte code offset #82
    //   Java source line #216	-> byte code offset #90
    //   Java source line #217	-> byte code offset #98
    //   Java source line #219	-> byte code offset #101
    //   Java source line #220	-> byte code offset #118
    //   Java source line #221	-> byte code offset #127
    //   Java source line #225	-> byte code offset #128
    //   Java source line #226	-> byte code offset #133
    //   Java source line #227	-> byte code offset #141
    //   Java source line #223	-> byte code offset #145
    //   Java source line #225	-> byte code offset #147
    //   Java source line #226	-> byte code offset #152
    //   Java source line #227	-> byte code offset #160
    //   Java source line #230	-> byte code offset #161
    //   Java source line #225	-> byte code offset #164
    //   Java source line #226	-> byte code offset #169
    //   Java source line #227	-> byte code offset #177
    //   Java source line #231	-> byte code offset #178
    //   Java source line #232	-> byte code offset #184
    //   Java source line #233	-> byte code offset #195
    //   Java source line #234	-> byte code offset #215
    //   Java source line #235	-> byte code offset #224
    //   Java source line #236	-> byte code offset #233
    //   Java source line #237	-> byte code offset #245
    //   Java source line #238	-> byte code offset #259
    //   Java source line #242	-> byte code offset #266
    //   Java source line #243	-> byte code offset #282
    //   Java source line #244	-> byte code offset #285
    //   Java source line #246	-> byte code offset #287
    //   Java source line #247	-> byte code offset #292
    //   Java source line #249	-> byte code offset #295
    //   Java source line #235	-> byte code offset #308
    //   Java source line #251	-> byte code offset #318
    //   Java source line #252	-> byte code offset #342
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	347	0	this	SiteListener
    //   15	40	1	configurationLocation	File
    //   61	49	2	toBeUninstalledFile	File
    //   97	128	3	properties	java.util.Properties
    //   99	71	4	input	java.io.InputStream
    //   145	17	5	localObject	Object
    //   182	85	5	urlString	String
    //   222	100	6	result	List<String>
    //   228	81	7	e	java.util.Enumeration<Object>
    //   243	7	8	line	String
    //   257	41	9	tokenizer	StringTokenizer
    //   264	5	10	targetSite	String
    //   285	3	11	e1	URISyntaxException
    //   127	1	13	localIOException1	java.io.IOException
    //   141	1	14	localIOException2	java.io.IOException
    //   160	1	15	localIOException3	java.io.IOException
    //   177	1	16	localIOException4	java.io.IOException
    // Exception table:
    //   from	to	target	type
    //   101	124	127	java/io/IOException
    //   128	138	141	java/io/IOException
    //   101	128	145	finally
    //   147	157	160	java/io/IOException
    //   164	174	177	java/io/IOException
    //   266	282	285	java/net/URISyntaxException
  }
  
  private String[] getManagedFiles()
  {
    if (managedFiles != null) {
      return managedFiles;
    }
    List<String> result = new ArrayList();
    try
    {
      siteFile = URIUtil.toFile(new URI(siteLocation));
    }
    catch (URISyntaxException e)
    {
      File siteFile;
      LogHelper.log(new Status(4, "org.eclipse.equinox.p2.extensionlocation", "Unable to create a URL from site location: " + siteLocation, e));
      return new String[0];
    }
    File siteFile;
    Map<String, File> pluginCache = getPlugins(siteFile);
    Map<File, Feature> featureCache = getFeatures(siteFile);
    FeatureEntry[] entries;
    int inner;
    for (Iterator localIterator = featureCache.keySet().iterator(); localIterator.hasNext(); inner < entries.length)
    {
      File featureFile = (File)localIterator.next();
      
      result.add(featureFile.toString());
      Feature feature = (Feature)featureCache.get(featureFile);
      entries = feature.getEntries();
      inner = 0; continue;
      FeatureEntry entry = entries[inner];
      
      String key = entry.getId() + '/' + entry.getVersion();
      File pluginLocation = (File)pluginCache.get(key);
      if (pluginLocation != null) {
        result.add(pluginLocation.toString());
      }
      inner++;
    }
    managedFiles = normalize((String[])result.toArray(new String[result.size()]));
    return managedFiles;
  }
  
  private Map<File, Feature> getFeatures(File location)
  {
    Map<File, Feature> result = new HashMap();
    File featureDir = new File(location, "features");
    File[] children = featureDir.listFiles();
    for (int i = 0; i < children.length; i++)
    {
      File featureLocation = children[i];
      if ((featureLocation.isDirectory()) && (featureLocation.getParentFile() != null) && (featureLocation.getParentFile().getName().equals("features")) && (new File(featureLocation, "feature.xml").exists()))
      {
        FeatureParser parser = new FeatureParser();
        Feature entry = parser.parse(featureLocation);
        if (entry != null) {
          result.put(featureLocation, entry);
        }
      }
    }
    return result;
  }
  
  private Map<String, File> getPlugins(File location)
  {
    File[] plugins = new File(location, "plugins").listFiles();
    Map<String, File> result = new HashMap();
    for (int i = 0; (plugins != null) && (i < plugins.length); i++)
    {
      File bundleLocation = plugins[i];
      if ((bundleLocation.isDirectory()) || (bundleLocation.getName().endsWith(".jar")))
      {
        BundleDescription description = BundlesAction.createBundleDescription(bundleLocation);
        if (description != null)
        {
          String id = description.getSymbolicName();
          String version = description.getVersion().toString();
          result.put(id + '/' + version, bundleLocation);
        }
      }
    }
    return result;
  }
  
  public boolean added(File file)
  {
    return delegate.added(file);
  }
  
  public boolean changed(File file)
  {
    return delegate.changed(file);
  }
  
  public Long getSeenFile(File file)
  {
    return delegate.getSeenFile(file);
  }
  
  public boolean removed(File file)
  {
    return delegate.removed(file);
  }
  
  public void startPoll()
  {
    delegate.startPoll();
  }
  
  public void stopPoll()
  {
    delegate.stopPoll();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.extensionlocation.SiteListener
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
1 2

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