org.eclipse.mylyn.discovery.core_3.7.1.v20120425-0100

atch (IllegalAccessException e)
    {
      throw new RuntimeException(e);
    }
    catch (InvocationTargetException e)
    {
      if ((e.getCause() instanceof CoreException)) {
        throw ((CoreException)e.getCause());
      }
      if ((e.getCause() instanceof IOException)) {
        throw ((IOException)e.getCause());
      }
      throw new RuntimeException(e);
    }
  }
  
  public long getLastModified(URI location, IProgressMonitor monitor)
    throws CoreException, IOException
  {
    try
    {
      return ((Long)getLastModifiedMethod.invoke(transport, new Object[] { location, monitor })).longValue();
    }
    catch (IllegalAccessException e)
    {
      throw new RuntimeException(e);
    }
    catch (InvocationTargetException e)
    {
      if ((e.getCause() instanceof CoreException)) {
        throw ((CoreException)e.getCause());
      }
      if ((e.getCause() instanceof IOException)) {
        throw ((IOException)e.getCause());
      }
      throw new RuntimeException(e);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.discovery.core.util.P2TransportService
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.discovery.core.util;

import java.util.Comparator;
import org.eclipse.mylyn.internal.discovery.core.model.ConnectorCategory;
import org.eclipse.mylyn.internal.discovery.core.model.DiscoveryConnector;
import org.eclipse.mylyn.internal.discovery.core.model.Group;

public class DiscoveryConnectorComparator
  implements Comparator<DiscoveryConnector>
{
  private final ConnectorCategory category;
  
  public DiscoveryConnectorComparator(ConnectorCategory category)
  {
    if (category == null) {
      throw new IllegalArgumentException();
    }
    this.category = category;
  }
  
  private int computeGroupIndex(String groupId)
  {
    if (groupId != null)
    {
      int index = -1;
      for (Group group : category.getGroup())
      {
        index++;
        if (group.getId().equals(groupId)) {
          return index;
        }
      }
    }
    return -1;
  }
  
  public int compare(DiscoveryConnector o1, DiscoveryConnector o2)
  {
    if ((o1.getCategory() != category) || (o2.getCategory() != category)) {
      throw new IllegalArgumentException();
    }
    if (o1 == o2) {
      return 0;
    }
    int g1 = computeGroupIndex(o1.getGroupId());
    int g2 = computeGroupIndex(o2.getGroupId());
    int i;
    int i;
    if (g1 != g2)
    {
      int i;
      if (g1 == -1)
      {
        i = 1;
      }
      else
      {
        int i;
        if (g2 == -1) {
          i = -1;
        } else {
          i = g1 - g2;
        }
      }
    }
    else
    {
      i = o1.getName().compareToIgnoreCase(o2.getName());
      if (i == 0) {
        i = o1.getId().compareTo(o2.getId());
      }
    }
    return i;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.discovery.core.util.DiscoveryConnectorComparator
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.discovery.core.model;

public class Policy
{
  private static final boolean PERMISSIVE = Boolean.getBoolean(Policy.class.getName() + ".permissive");
  private static final Policy DEFAULT = new Policy(false);
  private final boolean permitCategories;
  
  public Policy(boolean permitCategories)
  {
    this.permitCategories = permitCategories;
  }
  
  public boolean isPermitCategories()
  {
    return (permitCategories) || (PERMISSIVE);
  }
  
  public static Policy defaultPolicy()
  {
    return DEFAULT;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.discovery.core.model.Policy
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.discovery.core.model;

public final class Directory$Entry
{
  private String location;
  private boolean permitCategories;
  
  public String getLocation()
  {
    return location;
  }
  
  public void setLocation(String location)
  {
    this.location = location;
  }
  
  public boolean isPermitCategories()
  {
    return permitCategories;
  }
  
  public void setPermitCategories(boolean permitCategories)
  {
    this.permitCategories = permitCategories;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.discovery.core.model.Directory.Entry
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.discovery.core.model;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
import java.util.PropertyResourceBundle;
import java.util.ResourceBundle;
import java.util.jar.JarFile;
import java.util.zip.ZipEntry;
import org.eclipse.core.runtime.IContributor;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.spi.RegistryStrategy;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.osgi.util.NLS;

class DiscoveryRegistryStrategy
  extends RegistryStrategy
{
  private final List<JarFile> jars = new ArrayList();
  private final Map<IContributor, File> contributorToJarFile = new HashMap();
  private final Map<IContributor, Directory.Entry> contributorToDirectoryEntry = new HashMap();
  private final Object token;
  private Map<File, Directory.Entry> bundleFileToDirectoryEntry;
  
  public DiscoveryRegistryStrategy(File[] storageDirs, boolean[] cacheReadOnly, Object token)
  {
    super(storageDirs, cacheReadOnly);
    this.token = token;
  }
  
  public void onStart(IExtensionRegistry registry, boolean loadedFromCache)
  {
    super.onStart(registry, loadedFromCache);
    if (!loadedFromCache)
    {
      processDiscoveryCoreBundle(registry);
      processBundles(registry);
    }
  }
  
  /* Error */
  private void processDiscoveryCoreBundle(IExtensionRegistry registry)
  {
    // Byte code:
    //   0: ldc 1
    //   2: invokestatic 306	org/eclipse/core/runtime/Platform:getBundle	(Ljava/lang/String;)Lorg/osgi/framework/Bundle;
    //   5: astore_2
    //   6: new 146	org/eclipse/core/runtime/spi/RegistryContributor
    //   9: dup
    //   10: aload_2
    //   11: invokeinterface 335 1 0
    //   16: aload_2
    //   17: invokeinterface 335 1 0
    //   22: aconst_null
    //   23: aconst_null
    //   24: invokespecial 308	org/eclipse/core/runtime/spi/RegistryContributor:<init>	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    //   27: astore_3
    //   28: aload_2
    //   29: ldc 3
    //   31: invokeinterface 336 2 0
    //   36: invokevirtual 294	java/net/URL:openStream	()Ljava/io/InputStream;
    //   39: astore 4
    //   41: aload_1
    //   42: aload 4
    //   44: aload_3
    //   45: iconst_0
    //   46: aload_2
    //   47: invokeinterface 335 1 0
    //   52: aconst_null
    //   53: aload_0
    //   54: getfield 274	org/eclipse/mylyn/internal/discovery/core/model/DiscoveryRegistryStrategy:token	Ljava/lang/Object;
    //   57: invokeinterface 333 7 0
    //   62: pop
    //   63: goto +13 -> 76
    //   66: astore 5
    //   68: aload 4
    //   70: invokevirtual 284	java/io/InputStream:close	()V
    //   73: aload 5
    //   75: athrow
    //   76: aload 4
    //   78: invokevirtual 284	java/io/InputStream:close	()V
    //   81: goto +12 -> 93
    //   84: pop
    //   85: new 126	java/lang/IllegalStateException
    //   88: dup
    //   89: invokespecial 287	java/lang/IllegalStateException:<init>	()V
    //   92: athrow
    //   93: return
    // Line number table:
    //   Java source line #73	-> byte code offset #0
    //   Java source line #74	-> byte code offset #6
    //   Java source line #75	-> byte code offset #22
    //   Java source line #74	-> byte code offset #24
    //   Java source line #77	-> byte code offset #28
    //   Java source line #79	-> byte code offset #41
    //   Java source line #80	-> byte code offset #66
    //   Java source line #81	-> byte code offset #68
    //   Java source line #82	-> byte code offset #73
    //   Java source line #81	-> byte code offset #76
    //   Java source line #83	-> byte code offset #84
    //   Java source line #84	-> byte code offset #85
    //   Java source line #86	-> byte code offset #93
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	94	0	this	DiscoveryRegistryStrategy
    //   0	94	1	registry	IExtensionRegistry
    //   5	42	2	bundle	org.osgi.framework.Bundle
    //   27	18	3	contributor	IContributor
    //   39	38	4	inputStream	InputStream
    //   66	8	5	localObject	Object
    //   84	1	6	localIOException	IOException
    // Exception table:
    //   from	to	target	type
    //   41	66	66	finally
    //   0	81	84	java/io/IOException
  }
  
  private void processBundles(IExtensionRegistry registry)
  {
    if (bundleFileToDirectoryEntry == null) {
      throw new IllegalStateException();
    }
    for (Map.Entry<File, Directory.Entry> bundleFile : bundleFileToDirectoryEntry.entrySet()) {
      try
      {
        processBundle(registry, (Directory.Entry)bundleFile.getValue(), (File)bundleFile.getKey());
      }
      catch (Exception e)
      {
        StatusHandler.log(new Status(4, "org.eclipse.mylyn.discovery.core", NLS.bind(
          Messages.DiscoveryRegistryStrategy_cannot_load_bundle, new Object[] {
          ((File)bundleFile.getKey()).getName(), ((Directory.Entry)bundleFile.getValue()).getLocation(), e.getMessage() }), 
          e));
      }
    }
  }
  
  /* Error */
  private void processBundle(IExtensionRegistry registry, Directory.Entry entry, File bundleFile)
    throws IOException
  {
    // Byte code:
    //   0: new 140	java/util/jar/JarFile
    //   3: dup
    //   4: aload_3
    //   5: invokespecial 303	java/util/jar/JarFile:<init>	(Ljava/io/File;)V
    //   8: astore 4
    //   10: aload_0
    //   11: getfield 275	org/eclipse/mylyn/internal/discovery/core/model/DiscoveryRegistryStrategy:jars	Ljava/util/List;
    //   14: aload 4
    //   16: invokeinterface 324 2 0
    //   21: pop
    //   22: aload 4
    //   24: ldc 3
    //   26: invokevirtual 305	java/util/jar/JarFile:getEntry	(Ljava/lang/String;)Ljava/util/zip/ZipEntry;
    //   29: astore 5
    //   31: aload 5
    //   33: ifnonnull +14 -> 47
    //   36: new 122	java/io/IOException
    //   39: dup
    //   40: getstatic 280	org/eclipse/mylyn/internal/discovery/core/model/Messages:DiscoveryRegistryStrategy_missing_pluginxml	Ljava/lang/String;
    //   43: invokespecial 283	java/io/IOException:<init>	(Ljava/lang/String;)V
    //   46: athrow
    //   47: new 146	org/eclipse/core/runtime/spi/RegistryContributor
    //   50: dup
    //   51: aload_3
    //   52: invokevirtual 281	java/io/File:getName	()Ljava/lang/String;
    //   55: aload_3
    //   56: invokevirtual 281	java/io/File:getName	()Ljava/lang/String;
    //   59: aconst_null
    //   60: aconst_null
    //   61: invokespecial 308	org/eclipse/core/runtime/spi/RegistryContributor:<init>	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    //   64: astore 6
    //   66: aload_1
    //   67: checkcast 145	org/eclipse/core/runtime/spi/IDynamicExtensionRegistry
    //   70: aload 6
    //   72: invokeinterface 334 2 0
    //   77: ifeq +9 -> 86
    //   80: aload 4
    //   82: invokevirtual 302	java/util/jar/JarFile:close	()V
    //   85: return
    //   86: aload_0
    //   87: getfield 278	org/eclipse/mylyn/internal/discovery/core/model/DiscoveryRegistryStrategy:contributorToJarFile	Ljava/util/Map;
    //   90: aload 6
    //   92: aload_3
    //   93: invokeinterface 328 3 0
    //   98: pop
    //   99: aload_0
    //   100: getfield 277	org/eclipse/mylyn/internal/discovery/core/model/DiscoveryRegistryStrategy:contributorToDirectoryEntry	Ljava/util/Map;
    //   103: aload 6
    //   105: aload_2
    //   106: invokeinterface 328 3 0
    //   111: pop
    //   112: aload_0
    //   113: aload 4
    //   115: invokespecial 317	org/eclipse/mylyn/internal/discovery/core/model/DiscoveryRegistryStrategy:loadTranslationBundle	(Ljava/util/jar/JarFile;)Ljava/util/ResourceBundle;
    //   118: astore 7
    //   120: aload 4
    //   122: aload 5
    //   124: invokevirtual 304	java/util/jar/JarFile:getInputStream	(Ljava/util/zip/ZipEntry;)Ljava/io/InputStream;
    //   127: astore 8
    //   129: aload_1
    //   130: aload 8
    //   132: aload 6
    //   134: iconst_0
    //   135: aload_3
    //   136: invokevirtual 282	java/io/File:getPath	()Ljava/lang/String;
    //   139: aload 7
    //   141: aload_0
    //   142: getfield 274	org/eclipse/mylyn/internal/discovery/core/model/DiscoveryRegistryStrategy:token	Ljava/lang/Object;
    //   145: invokeinterface 333 7 0
    //   150: pop
    //   151: goto +13 -> 164
    //   154: astore 9
    //   156: aload 8
    //   158: invokevirtual 284	java/io/InputStream:close	()V
    //   161: aload 9
    //   163: athrow
    //   164: aload 8
    //   166: invokevirtual 284	java/io/InputStream:close	()V
    //   169: return
    // Line number table:
    //   Java source line #105	-> byte code offset #0
    //   Java source line #106	-> byte code offset #10
    //   Java source line #108	-> byte code offset #22
    //   Java source line #109	-> byte code offset #31
    //   Java source line #110	-> byte code offset #36
    //   Java source line #112	-> byte code offset #47
    //   Java source line #113	-> byte code offset #66
    //   Java source line #114	-> byte code offset #80
    //   Java source line #115	-> byte code offset #85
    //   Java source line #117	-> byte code offset #86
    //   Java source line #118	-> byte code offset #99
    //   Java source line #120	-> byte code offset #112
    //   Java source line #122	-> byte code offset #120
    //   Java source line #124	-> byte code offset #129
    //   Java source line #125	-> byte code offset #154
    //   Java source line #126	-> byte code offset #156
    //   Java source line #127	-> byte code offset #161
    //   Java source line #126	-> byte code offset #164
    //   Java source line #128	-> byte code offset #169
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	170	0	this	DiscoveryRegistryStrategy
    //   0	170	1	registry	IExtensionRegistry
    //   0	170	2	entry	Directory.Entry
    //   0	170	3	bundleFile	File
    //   8	113	4	jarFile	JarFile
    //   29	94	5	pluginXmlEntry	ZipEntry
    //   64	69	6	contributor	IContributor
    //   118	22	7	translationBundle	ResourceBundle
    //   127	38	8	inputStream	InputStream
    //   154	8	9	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   129	154	154	finally
  }
  
  private ResourceBundle loadTranslationBundle(JarFile jarFile)
    throws IOException
  {
    List<String> bundleNames = computeBundleNames("plugin");
    for (String bundleName : bundleNames)
    {
      ZipEntry entry = jarFile.getEntry(bundleName);
      if (entry != null)
      {
        InputStream inputStream = jarFile.getInputStream(entry);
        try
        {
          PropertyResourceBundle resourceBundle = new PropertyResourceBundle(inputStream);
          return resourceBundle;
        }
        finally
        {
          inputStream.close();
        }
      }
    }
    return null;
  }
  
  private List<String> computeBundleNames(String baseName)
  {
    String suffix = ".properties";
    String name = baseName;
    List<String> bundleNames = new ArrayList();
    Locale locale = Locale.getDefault();
    bundleNames.add(name + suffix);
    if ((locale.getLanguage() != null) && (locale.getLanguage().length() > 0))
    {
      name = name + '_' + locale.getLanguage();
      bundleNames.add(0, name + suffix);
    }
    if ((locale.getCountry() != null) && (locale.getCountry().length() > 0))
    {
      name = name + '_' + locale.getCountry();
      bundleNames.add(0, name + suffix);
    }
    if ((locale.getVariant() != null) && (locale.getVariant().length() > 0))
    {
      name = name + '_' + locale.getVariant();
      bundleNames.add(0, name + suffix);
    }
    return bundleNames;
  }
  
  /* Error */
  public void onStop(IExtensionRegistry registry)
  {
    // Byte code:
    //   0: aload_0
    //   1: aload_1
    //   2: invokespecial 310	org/eclipse/core/runtime/spi/RegistryStrategy:onStop	(Lorg/eclipse/core/runtime/IExtensionRegistry;)V
    //   5: goto +58 -> 63
    //   8: astore_2
    //   9: aload_0
    //   10: getfield 275	org/eclipse/mylyn/internal/discovery/core/model/DiscoveryRegistryStrategy:jars	Ljava/util/List;
    //   13: invokeinterface 325 1 0
    //   18: astore 4
    //   20: goto +22 -> 42
    //   23: aload 4
    //   25: invokeinterface 321 1 0
    //   30: checkcast 140	java/util/jar/JarFile
    //   33: astore_3
    //   34: aload_3
    //   35: invokevirtual 302	java/util/jar/JarFile:close	()V
    //   38: goto +4 -> 42
    //   41: pop
    //   42: aload 4
    //   44: invokeinterface 320 1 0
    //   49: ifne -26 -> 23
    //   52: aload_0
    //   53: getfield 275	org/eclipse/mylyn/internal/discovery/core/model/DiscoveryRegistryStrategy:jars	Ljava/util/List;
    //   56: invokeinterface 322 1 0
    //   61: aload_2
    //   62: athrow
    //   63: aload_0
    //   64: getfield 275	org/eclipse/mylyn/internal/discovery/core/model/DiscoveryRegistryStrategy:jars	Ljava/util/List;
    //   67: invokeinterface 325 1 0
    //   72: astore 4
    //   74: goto +22 -> 96
    //   77: aload 4
    //   79: invokeinterface 321 1 0
    //   84: checkcast 140	java/util/jar/JarFile
    //   87: astore_3
    //   88: aload_3
    //   89: invokevirtual 302	java/util/jar/JarFile:close	()V
    //   92: goto +4 -> 96
    //   95: pop
    //   96: aload 4
    //   98: invokeinterface 320 1 0
    //   103: ifne -26 -> 77
    //   106: aload_0
    //   107: getfield 275	org/eclipse/mylyn/internal/discovery/core/model/DiscoveryRegistryStrategy:jars	Ljava/util/List;
    //   110: invokeinterface 322 1 0
    //   115: return
    // Line number table:
    //   Java source line #171	-> byte code offset #0
    //   Java source line #172	-> byte code offset #8
    //   Java source line #173	-> byte code offset #9
    //   Java source line #175	-> byte code offset #34
    //   Java source line #176	-> byte code offset #41
    //   Java source line #173	-> byte code offset #42
    //   Java source line #179	-> byte code offset #52
    //   Java source line #180	-> byte code offset #61
    //   Java source line #173	-> byte code offset #63
    //   Java source line #175	-> byte code offset #88
    //   Java source line #176	-> byte code offset #95
    //   Java source line #173	-> byte code offset #96
    //   Java source line #179	-> byte code offset #106
    //   Java source line #181	-> byte code offset #115
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	116	0	this	DiscoveryRegistryStrategy
    //   0	116	1	registry	IExtensionRegistry
    //   8	54	2	localObject	Object
    //   33	2	3	jar	JarFile
    //   87	2	3	jar	JarFile
    //   18	79	4	localIterator	java.util.Iterator
    //   41	1	6	localException1	Exception
    //   95	1	7	localException2	Exception
    // Exception table:
    //   from	to	target	type
    //   0	8	8	finally
    //   34	38	41	java/lang/Exception
    //   88	92	95	java/lang/Exception
  }
  
  public File getJarFile(IContributor contributor)
  {
    File file = (File)contributorToJarFile.get(contributor);
    if (file == null) {
      throw new IllegalArgumentException(contributor.getName());
    }
    return file;
  }
  
  public Directory.Entry getDirectoryEntry(IContributor contributor)
  {
    Directory.Entry entry = (Directory.Entry)contributorToDirectoryEntry.get(contributor);
    if (entry == null) {
      throw new IllegalArgumentException(contributor.getName());
    }
    return entry;
  }
  
  public void setBundles(Map<File, Directory.Entry> bundleFileToDirectoryEntry)
  {
    this.bundleFileToDirectoryEntry = bundleFileToDirectoryEntry;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.discovery.core.model.DiscoveryRegistryStrategy
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.discovery.core.model;

public enum ConnectorDescriptorKind
{
  DOCUMENT("document"),  TASK("task"),  VCS("vcs");
  
  private final String value;
  
  private ConnectorDescriptorKind(String value)
  {
    this.value = value;
  }
  
  public String getValue()
  {
    return value;
  }
  
  public static ConnectorDescriptorKind fromValue(String value)
    throws IllegalArgumentException
  {
    if (value == null) {
      return null;
    }
    ConnectorDescriptorKind[] arrayOfConnectorDescriptorKind;
    int j = (arrayOfConnectorDescriptorKind = values()).length;
    for (int i = 0; i < j; i++)
    {
      ConnectorDescriptorKind e = arrayOfConnectorDescriptorKind[i];
      if (e.getValue().equals(value)) {
        return e;
      }
    }
    throw new IllegalArgumentException(value);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.discovery.core.model.ConnectorDescriptorKind
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.discovery.core.model;

public class FeatureFilter
{
  protected String featureId;
  protected String version;
  protected ConnectorDescriptor connectorDescriptor;
  
  public String getFeatureId()
  {
    return featureId;
  }
  
  public void setFeatureId(String featureId)
  {
    this.featureId = featureId;
  }
  
  public String getVersion()
  {
    return version;
  }
  
  public void setVersion(String version)
  {
    this.version = version;
  }
  
  public ConnectorDescriptor getConnectorDescriptor()
  {
    return connectorDescriptor;
  }
  
  public void setConnectorDescriptor(ConnectorDescriptor connectorDescriptor)
  {
    this.connectorDescriptor = connectorDescriptor;
  }
  
  public void validate()
    throws ValidationException
  {
    if ((featureId == null) || (featureId.length() == 0)) {
      throw new ValidationException(Messages.FeatureFilter_must_specify_featureFilter_featureId);
    }
    if ((version == null) || (version.length() == 0)) {
      throw new ValidationException(Messages.FeatureFilter_must_specify_featureFilter_version);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.discovery.core.model.FeatureFilter
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.discovery.core.model;

import java.net.URI;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Callable;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.mylyn.internal.discovery.core.util.WebUtil;

class ConnectorDiscovery$VerifyUpdateSiteJob
  implements Callable<VerifyUpdateSiteJob>
{
  private final String url;
  private boolean ok = false;
  
  public ConnectorDiscovery$VerifyUpdateSiteJob(String url)
  {
    this.url = url;
  }
  
  public VerifyUpdateSiteJob call()
    throws Exception
  {
    URL baseUrl = new URL(url);
    List<URI> locations = new ArrayList();
    String[] arrayOfString;
    int j = (arrayOfString = new String[] { "content.jar", "content.xml", "compositeContent.jar", "compositeContent.xml", "site.xml" }).length;
    for (int i = 0; i < j; i++)
    {
      String location = arrayOfString[i];
      locations.add(new URL(baseUrl, location).toURI());
    }
    ok = WebUtil.verifyAvailability(locations, true, new NullProgressMonitor());
    return this;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.discovery.core.model.ConnectorDiscovery.VerifyUpdateSiteJob
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.discovery.core.model;

import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import org.eclipse.osgi.util.NLS;
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.Locator;
import org.xml.sax.SAXException;

class DirectoryParser$DirectoryContentHandler
  implements ContentHandler
{
  Directory directory;
  
  private DirectoryParser$DirectoryContentHandler(DirectoryParser paramDirectoryParser) {}
  
  public void characters(char[] ch, int start, int length)
    throws SAXException
  {}
  
  public void endDocument()
    throws SAXException
  {}
  
  public void endElement(String uri, String localName, String qName)
    throws SAXException
  {}
  
  public void endPrefixMapping(String prefix)
    throws SAXException
  {}
  
  public void ignorableWhitespace(char[] ch, int start, int length)
    throws SAXException
  {}
  
  public void processingInstruction(String target, String data)
    throws SAXException
  {}
  
  public void setDocumentLocator(Locator locator) {}
  
  public void skippedEntity(String name)
    throws SAXException
  {}
  
  public void startDocument()
    throws SAXException
  {}
  
  public void startElement(String uri, String localName, String qName, Attributes atts)
    throws SAXException
  {
    if ("directory".equals(localName))
    {
      if (directory != null) {
        unexpectedElement(localName);
      }
      directory = new Directory();
    }
    else if ((directory != null) && ("entry".equals(localName)))
    {
      String url = atts.getValue("", "url");
      if ((url != null) && (url.length() > 0))
      {
        try
        {
          URI entryUri = new URI(url);
          if ((this$0.baseUri != null) && (!entryUri.isAbsolute())) {
            url = this$0.baseUri.resolve(url).toString();
          }
        }
        catch (URISyntaxException localURISyntaxException) {}
        Directory.Entry entry = new Directory.Entry();
        entry.setLocation(url);
        entry.setPermitCategories(Boolean.parseBoolean(atts.getValue("permitCategories")));
        directory.getEntries().add(entry);
      }
    }
  }
  
  private void unexpectedElement(String localName)
    throws SAXException
  {
    throw new SAXException(NLS.bind(Messages.DirectoryParser_unexpected_element, localName));
  }
  
  public void startPrefixMapping(String prefix, String uri)
    throws SAXException
  {}
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.discovery.core.model.DirectoryParser.DirectoryContentHandler
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.discovery.core.model;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.util.Map;

public class DiscoveryConnector
  extends ConnectorDescriptor
{
  public static String ATTRIBUTE_INSTALL_MESSAGE = "installMessage";
  private AbstractDiscoverySource source;
  private DiscoveryCategory category;
  private boolean selected;
  private Boolean available;
  private DiscoveryCertification certification;
  private final PropertyChangeSupport changeSupport;
  
  public DiscoveryConnector()
  {
    changeSupport = new PropertyChangeSupport(this);
  }
  
  public DiscoveryCategory getCategory()
  {
    return category;
  }
  
  public void setCategory(DiscoveryCategory category)
  {
    this.category = category;
  }
  
  public AbstractDiscoverySource getSource()
  {
    return source;
  }
  
  public void setSource(AbstractDiscoverySource source)
  {
    this.source = source;
  }
  
  public DiscoveryCertification getCertification()
  {
    return certification;
  }
  
  public void setCertification(DiscoveryCertification certification)
  {
    this.certification = certification;
  }
  
  public boolean isSelected()
  {
    return selected;
  }
  
  public void setSelected(boolean selected)
  {
    this.selected = selected;
  }
  
  public Boolean getAvailable()
  {
    return available;
  }
  
  public void setAvailable(Boolean available)
  {
    if ((available != this.available) || ((available != null) && (!available.equals(this.available))))
    {
      Boolean previous = this.available;
      this.available = available;
      changeSupport.firePropertyChange("available", previous, this.available);
    }
  }
  
  public void addPropertyChangeListener(PropertyChangeListener listener)
  {
    changeSupport.addPropertyChangeListener(listener);
  }
  
  public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
  {
    changeSupport.addPropertyChangeListener(propertyName, listener);
  }
  
  public void removePropertyChangeListener(PropertyChangeListener listener)
  {
    changeSupport.removePropertyChangeListener(listener);
  }
  
  public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
  {
    changeSupport.removePropertyChangeListener(propertyName, listener);
  }
  
  public boolean isInstallable()
  {
    return getInstallMessage() == null;
  }
  
  public String getInstallMessage()
  {
    return (String)getAttributes().get(ATTRIBUTE_INSTALL_MESSAGE);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.discovery.core.model.DiscoveryConnector
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.discovery.core.model;

import java.util.List;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IContributor;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.osgi.util.NLS;

public class BundleDiscoveryStrategy
  extends AbstractDiscoveryStrategy
{
  /* Error */
  public void performDiscovery(IProgressMonitor monitor)
    throws org.eclipse.core.runtime.CoreException
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 208	org/eclipse/mylyn/internal/discovery/core/model/BundleDiscoveryStrategy:connectors	Ljava/util/List;
    //   4: ifnull +10 -> 14
    //   7: aload_0
    //   8: getfield 206	org/eclipse/mylyn/internal/discovery/core/model/BundleDiscoveryStrategy:categories	Ljava/util/List;
    //   11: ifnonnull +11 -> 22
    //   14: new 96	java/lang/IllegalStateException
    //   17: dup
    //   18: invokespecial 214	java/lang/IllegalStateException:<init>	()V
    //   21: athrow
    //   22: aload_0
    //   23: invokevirtual 225	org/eclipse/mylyn/internal/discovery/core/model/BundleDiscoveryStrategy:getExtensionRegistry	()Lorg/eclipse/core/runtime/IExtensionRegistry;
    //   26: ldc 5
    //   28: invokeinterface 251 2 0
    //   33: astore_2
    //   34: aload_2
    //   35: invokeinterface 250 1 0
    //   40: astore_3
    //   41: aload_1
    //   42: getstatic 211	org/eclipse/mylyn/internal/discovery/core/model/Messages:BundleDiscoveryStrategy_task_loading_local_extensions	Ljava/lang/String;
    //   45: aload_3
    //   46: arraylength
    //   47: ifne +7 -> 54
    //   50: iconst_1
    //   51: goto +5 -> 56
    //   54: aload_3
    //   55: arraylength
    //   56: invokeinterface 255 3 0
    //   61: aload_3
    //   62: arraylength
    //   63: ifle +32 -> 95
    //   66: aload_0
    //   67: new 109	org/eclipse/core/runtime/SubProgressMonitor
    //   70: dup
    //   71: aload_1
    //   72: aload_3
    //   73: arraylength
    //   74: invokespecial 219	org/eclipse/core/runtime/SubProgressMonitor:<init>	(Lorg/eclipse/core/runtime/IProgressMonitor;I)V
    //   77: aload_3
    //   78: invokevirtual 226	org/eclipse/mylyn/internal/discovery/core/model/BundleDiscoveryStrategy:processExtensions	(Lorg/eclipse/core/runtime/IProgressMonitor;[Lorg/eclipse/core/runtime/IExtension;)V
    //   81: goto +14 -> 95
    //   84: astore 4
    //   86: aload_1
    //   87: invokeinterface 252 1 0
    //   92: aload 4
    //   94: athrow
    //   95: aload_1
    //   96: invokeinterface 252 1 0
    //   101: return
    // Line number table:
    //   Java source line #38	-> byte code offset #0
    //   Java source line #39	-> byte code offset #14
    //   Java source line #41	-> byte code offset #22
    //   Java source line #42	-> byte code offset #26
    //   Java source line #41	-> byte code offset #28
    //   Java source line #43	-> byte code offset #34
    //   Java source line #44	-> byte code offset #41
    //   Java source line #45	-> byte code offset #50
    //   Java source line #46	-> byte code offset #54
    //   Java source line #44	-> byte code offset #56
    //   Java source line #48	-> byte code offset #61
    //   Java source line #49	-> byte code offset #66
    //   Java source line #51	-> byte code offset #84
    //   Java source line #52	-> byte code offset #86
    //   Java source line #53	-> byte code offset #92
    //   Java source line #52	-> byte code offset #95
    //   Java source line #54	-> byte code offset #101
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	102	0	this	BundleDiscoveryStrategy
    //   0	102	1	monitor	IProgressMonitor
    //   33	2	2	extensionPoint	org.eclipse.core.runtime.IExtensionPoint
    //   40	38	3	extensions	IExtension[]
    //   84	9	4	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   61	84	84	finally
  }
  
  protected void processExtensions(IProgressMonitor monitor, IExtension[] extensions)
  {
    monitor.beginTask(Messages.BundleDiscoveryStrategy_task_processing_extensions, extensions.length == 0 ? 
      1 : 
      extensions.length);
    try
    {
      ConnectorDiscoveryExtensionReader extensionReader = new ConnectorDiscoveryExtensionReader();
      IExtension[] arrayOfIExtension;
      int j = (arrayOfIExtension = extensions).length;
      for (int i = 0; i < j; i++)
      {
        IExtension extension = arrayOfIExtension[i];
        AbstractDiscoverySource discoverySource = computeDiscoverySource(extension.getContributor());
        IConfigurationElement[] elements = extension.getConfigurationElements();
        IConfigurationElement[] arrayOfIConfigurationElement1;
        int m = (arrayOfIConfigurationElement1 = elements).length;
        for (int k = 0; k < m; k++)
        {
          IConfigurationElement element = arrayOfIConfigurationElement1[k];
          if (monitor.isCanceled()) {
            return;
          }
          try
          {
            if ("connectorDescriptor".equals(element.getName()))
            {
              DiscoveryConnector descriptor = (DiscoveryConnector)extensionReader.readConnectorDescriptor(element, 
                DiscoveryConnector.class);
              descriptor.setSource(discoverySource);
              connectors.add(descriptor);
            }
            else if ("connectorCategory".equals(element.getName()))
            {
              DiscoveryCategory category = (DiscoveryCategory)extensionReader.readConnectorCategory(element, 
                DiscoveryCategory.class);
              category.setSource(discoverySource);
              if (!discoverySource.getPolicy().isPermitCategories()) {
                StatusHandler.log(new Status(4, "org.eclipse.mylyn.discovery.core", NLS.bind(
                  Messages.BundleDiscoveryStrategy_categoryDisallowed, 
                  new Object[] { category.getName(), category.getId(), 
                  element.getContributor().getName() }), null));
              } else {
                categories.add(category);
              }
            }
            else if ("certification".equals(element.getName()))
            {
              DiscoveryCertification certification = (DiscoveryCertification)extensionReader.readCertification(element, 
                DiscoveryCertification.class);
              certification.setSource(discoverySource);
              certifications.add(certification);
            }
            else
            {
              throw new ValidationException(NLS.bind(Messages.BundleDiscoveryStrategy_unexpected_element, 
                element.getName()));
            }
          }
          catch (ValidationException e)
          {
            StatusHandler.log(new Status(4, "org.eclipse.mylyn.discovery.core", 
              NLS.bind(Messages.BundleDiscoveryStrategy_3, element.getContributor().getName(), 
              e.getMessage()), e));
          }
        }
        monitor.worked(1);
      }
    }
    finally
    {
      monitor.done();
    }
    monitor.done();
  }
  
  protected AbstractDiscoverySource computeDiscoverySource(IContributor contributor)
  {
    Policy policy = new Policy(true);
    BundleDiscoverySource bundleDiscoverySource = new BundleDiscoverySource(
      Platform.getBundle(contributor.getName()));
    bundleDiscoverySource.setPolicy(policy);
    return bundleDiscoverySource;
  }
  
  protected IExtensionRegistry getExtensionRegistry()
  {
    return Platform.getExtensionRegistry();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.discovery.core.model.BundleDiscoveryStrategy
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.discovery.core.model;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;

class RemoteBundleDiscoveryStrategy$DownloadBundleJob$1
  extends NullProgressMonitor
{
  RemoteBundleDiscoveryStrategy$DownloadBundleJob$1(RemoteBundleDiscoveryStrategy.DownloadBundleJob paramDownloadBundleJob) {}
  
  public boolean isCanceled()
  {
    return (super.isCanceled()) || (RemoteBundleDiscoveryStrategy.DownloadBundleJob.access$1(this$1).isCanceled());
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.discovery.core.model.RemoteBundleDiscoveryStrategy.DownloadBundleJob.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.discovery.core.model;

import java.net.URL;

public abstract class AbstractDiscoverySource
{
  private Policy policy = Policy.defaultPolicy();
  
  public abstract Object getId();
  
  public abstract URL getResource(String paramString);
  
  public Policy getPolicy()
  {
    return policy;
  }
  
  public void setPolicy(Policy policy)
  {
    this.policy = policy;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.discovery.core.model.AbstractDiscoverySource
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.discovery.core.model;

import java.io.IOException;
import java.io.Reader;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.List;
import org.eclipse.mylyn.internal.discovery.core.util.DefaultSaxErrorHandler;
import org.eclipse.mylyn.internal.discovery.core.util.IOWithCauseException;
import org.eclipse.osgi.util.NLS;
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.InputSource;
import org.xml.sax.Locator;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.XMLReaderFactory;

public class DirectoryParser
{
  URI baseUri;
  
  public URI getBaseUri()
  {
    return baseUri;
  }
  
  public void setBaseUri(URI baseUri)
  {
    this.baseUri = baseUri;
  }
  
  public Directory parse(Reader directoryContents)
    throws IOException
  {
    try
    {
      xmlReader = XMLReaderFactory.createXMLReader();
    }
    catch (SAXException e)
    {
      XMLReader xmlReader;
      throw new IOWithCauseException(e.getMessage(), e);
    }
    XMLReader xmlReader;
    xmlReader.setErrorHandler(new DefaultSaxErrorHandler());
    
    DirectoryContentHandler contentHandler = new DirectoryContentHandler(null);
    xmlReader.setContentHandler(contentHandler);
    try
    {
      xmlReader.parse(new InputSource(directoryContents));
    }
    catch (SAXException e)
    {
      throw new IOWithCauseException(e.getMessage(), e);
    }
    if (directory == null) {
      throw new IOException(Messages.DirectoryParser_no_direc
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-2017. Infinite Loop Ltd