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

16:46:39.994 INFO  jd.cli.Main - Decompiling org.eclipse.mylyn.discovery.core_3.7.1.v20120425-0100.jar
package org.eclipse.mylyn.internal.discovery.core.util;

import org.xml.sax.ErrorHandler;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;

public class DefaultSaxErrorHandler
  implements ErrorHandler
{
  public void warning(SAXParseException exception)
    throws SAXException
  {}
  
  public void fatalError(SAXParseException exception)
    throws SAXException
  {
    throw exception;
  }
  
  public void error(SAXParseException exception)
    throws SAXException
  {
    throw exception;
  }
}

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

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URI;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;

public abstract interface ITransportService
{
  public abstract IStatus download(URI paramURI, OutputStream paramOutputStream, IProgressMonitor paramIProgressMonitor);
  
  public abstract InputStream stream(URI paramURI, IProgressMonitor paramIProgressMonitor)
    throws IOException, CoreException;
  
  public abstract long getLastModified(URI paramURI, IProgressMonitor paramIProgressMonitor)
    throws CoreException, IOException;
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.discovery.core.util.ITransportService
 * 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.DiscoveryCategory;

public class DiscoveryCategoryComparator
  implements Comparator<DiscoveryCategory>
{
  public int compare(DiscoveryCategory o1, DiscoveryCategory o2)
  {
    if (o1 == o2) {
      return 0;
    }
    String r1 = o1.getRelevance();
    String r2 = o2.getRelevance();
    int i;
    if ((r1 != null) && (r2 != null))
    {
      i = new Integer(r2).compareTo(new Integer(r1));
    }
    else
    {
      if (r1 == null) {
        return 1;
      }
      return -1;
    }
    int i;
    if (i == 0)
    {
      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.DiscoveryCategoryComparator
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.discovery.core.util;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Reader;
import java.net.URI;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;

public class WebUtil
{
  private static ITransportService transport;
  
  /* Error */
  public static IStatus download(URI uri, java.io.File target, IProgressMonitor monitor)
    throws IOException
  {
    // Byte code:
    //   0: new 64	java/io/BufferedOutputStream
    //   3: dup
    //   4: new 68	java/io/FileOutputStream
    //   7: dup
    //   8: aload_1
    //   9: invokespecial 142	java/io/FileOutputStream:<init>	(Ljava/io/File;)V
    //   12: invokespecial 139	java/io/BufferedOutputStream:<init>	(Ljava/io/OutputStream;)V
    //   15: astore 4
    //   17: aload_0
    //   18: aload 4
    //   20: aload_2
    //   21: invokestatic 155	org/eclipse/mylyn/internal/discovery/core/util/WebUtil:download	(Ljava/net/URI;Ljava/io/OutputStream;Lorg/eclipse/core/runtime/IProgressMonitor;)Lorg/eclipse/core/runtime/IStatus;
    //   24: astore_3
    //   25: goto +13 -> 38
    //   28: astore 5
    //   30: aload 4
    //   32: invokevirtual 145	java/io/OutputStream:close	()V
    //   35: aload 5
    //   37: athrow
    //   38: aload 4
    //   40: invokevirtual 145	java/io/OutputStream:close	()V
    //   43: aload_3
    //   44: invokeinterface 161 1 0
    //   49: ifne +44 -> 93
    //   52: aload_1
    //   53: invokevirtual 141	java/io/File:delete	()Z
    //   56: pop
    //   57: aload_3
    //   58: invokeinterface 162 1 0
    //   63: instanceof 69
    //   66: ifeq +13 -> 79
    //   69: aload_3
    //   70: invokeinterface 162 1 0
    //   75: checkcast 69	java/io/IOException
    //   78: athrow
    //   79: new 83	org/eclipse/mylyn/internal/discovery/core/util/IOWithCauseException
    //   82: dup
    //   83: aload_3
    //   84: invokeinterface 162 1 0
    //   89: invokespecial 150	org/eclipse/mylyn/internal/discovery/core/util/IOWithCauseException:<init>	(Ljava/lang/Throwable;)V
    //   92: athrow
    //   93: aload_3
    //   94: areturn
    // Line number table:
    //   Java source line #64	-> byte code offset #0
    //   Java source line #66	-> byte code offset #17
    //   Java source line #67	-> byte code offset #28
    //   Java source line #68	-> byte code offset #30
    //   Java source line #69	-> byte code offset #35
    //   Java source line #68	-> byte code offset #38
    //   Java source line #70	-> byte code offset #43
    //   Java source line #71	-> byte code offset #52
    //   Java source line #72	-> byte code offset #57
    //   Java source line #73	-> byte code offset #69
    //   Java source line #75	-> byte code offset #79
    //   Java source line #77	-> byte code offset #93
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	95	0	uri	URI
    //   0	95	1	target	java.io.File
    //   0	95	2	monitor	IProgressMonitor
    //   24	2	3	result	IStatus
    //   38	56	3	result	IStatus
    //   15	24	4	out	OutputStream
    //   28	8	5	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   17	28	28	finally
  }
  
  /* Error */
  public static void readResource(URI uri, TextContentProcessor processor, IProgressMonitor monitor)
    throws IOException, CoreException
  {
    // Byte code:
    //   0: aload_0
    //   1: aload_2
    //   2: invokestatic 154	org/eclipse/mylyn/internal/discovery/core/util/WebUtil:stream	(Ljava/net/URI;Lorg/eclipse/core/runtime/IProgressMonitor;)Ljava/io/InputStream;
    //   5: astore_3
    //   6: new 65	java/io/BufferedReader
    //   9: dup
    //   10: new 71	java/io/InputStreamReader
    //   13: dup
    //   14: aload_3
    //   15: ldc 1
    //   17: invokespecial 144	java/io/InputStreamReader:<init>	(Ljava/io/InputStream;Ljava/lang/String;)V
    //   20: invokespecial 140	java/io/BufferedReader:<init>	(Ljava/io/Reader;)V
    //   23: astore 4
    //   25: aload_1
    //   26: aload 4
    //   28: invokeinterface 166 2 0
    //   33: goto +12 -> 45
    //   36: astore 5
    //   38: aload_3
    //   39: invokevirtual 143	java/io/InputStream:close	()V
    //   42: aload 5
    //   44: athrow
    //   45: aload_3
    //   46: invokevirtual 143	java/io/InputStream:close	()V
    //   49: return
    // Line number table:
    //   Java source line #95	-> byte code offset #0
    //   Java source line #98	-> byte code offset #6
    //   Java source line #99	-> byte code offset #25
    //   Java source line #100	-> byte code offset #36
    //   Java source line #101	-> byte code offset #38
    //   Java source line #102	-> byte code offset #42
    //   Java source line #101	-> byte code offset #45
    //   Java source line #103	-> byte code offset #49
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	50	0	uri	URI
    //   0	50	1	processor	TextContentProcessor
    //   0	50	2	monitor	IProgressMonitor
    //   5	41	3	in	InputStream
    //   23	4	4	reader	java.io.BufferedReader
    //   36	7	5	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   6	36	36	finally
  }
  
  public static boolean verifyAvailability(List<? extends URI> locations, boolean one, IProgressMonitor monitor)
    throws IOException, CoreException
  {
    if ((locations.isEmpty()) || (locations.size() > 5)) {
      throw new IllegalArgumentException();
    }
    int countFound = 0;
    for (URI location : locations) {
      try
      {
        getLastModified(location, monitor);
        if (one) {
          return true;
        }
        countFound++;
      }
      catch (FileNotFoundException localFileNotFoundException)
      {
        if (!one) {
          return false;
        }
      }
    }
    return countFound == locations.size();
  }
  
  public static synchronized ITransportService getTransport()
  {
    if (transport == null)
    {
      if (Platform.isRunning()) {
        try
        {
          transport = new P2TransportService();
        }
        catch (ClassNotFoundException localClassNotFoundException) {}
      }
      if (transport == null) {
        transport = new HttpClientTransportService();
      }
    }
    return transport;
  }
  
  public static IStatus download(URI uri, OutputStream out, IProgressMonitor monitor)
  {
    return getTransport().download(uri, out, monitor);
  }
  
  public static InputStream stream(URI uri, IProgressMonitor monitor)
    throws IOException, CoreException
  {
    return getTransport().stream(uri, monitor);
  }
  
  private static long getLastModified(URI location, IProgressMonitor monitor)
    throws CoreException, IOException
  {
    return getTransport().getLastModified(location, monitor);
  }
  
  public static abstract interface TextContentProcessor
  {
    public abstract void process(Reader paramReader)
      throws IOException;
  }
}

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

import java.io.IOException;

public class IOWithCauseException
  extends IOException
{
  private static final long serialVersionUID = 1L;
  private final Throwable cause;
  
  public IOWithCauseException(String message, Throwable cause)
  {
    super(message);
    this.cause = cause;
  }
  
  public IOWithCauseException(Throwable cause)
  {
    this.cause = cause;
  }
  
  public Throwable getCause()
  {
    return cause;
  }
}

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

public class HttpClientTransportService
  implements ITransportService
{
  /* Error */
  public org.eclipse.core.runtime.IStatus download(java.net.URI uri, java.io.OutputStream out, org.eclipse.core.runtime.IProgressMonitor monitor)
  {
    // Byte code:
    //   0: new 98	org/eclipse/mylyn/commons/net/WebLocation
    //   3: dup
    //   4: aload_1
    //   5: invokevirtual 174	java/net/URI:toString	()Ljava/lang/String;
    //   8: invokespecial 187	org/eclipse/mylyn/commons/net/WebLocation:<init>	(Ljava/lang/String;)V
    //   11: astore 4
    //   13: aload_3
    //   14: invokestatic 185	org/eclipse/mylyn/commons/net/Policy:monitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   17: astore_3
    //   18: aload_3
    //   19: getstatic 164	org/eclipse/mylyn/internal/discovery/core/util/Messages:WebUtil_task_retrievingUrl	Ljava/lang/String;
    //   22: aload 4
    //   24: invokevirtual 186	org/eclipse/mylyn/commons/net/WebLocation:getUrl	()Ljava/lang/String;
    //   27: invokestatic 192	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;
    //   30: iconst_m1
    //   31: invokeinterface 195 3 0
    //   36: new 89	org/apache/commons/httpclient/HttpClient
    //   39: dup
    //   40: invokespecial 177	org/apache/commons/httpclient/HttpClient:<init>	()V
    //   43: astore 5
    //   45: aload 5
    //   47: ldc 1
    //   49: invokestatic 188	org/eclipse/mylyn/commons/net/WebUtil:configureHttpClient	(Lorg/apache/commons/httpclient/HttpClient;Ljava/lang/String;)V
    //   52: new 90	org/apache/commons/httpclient/methods/GetMethod
    //   55: dup
    //   56: aload 4
    //   58: invokevirtual 186	org/eclipse/mylyn/commons/net/WebLocation:getUrl	()Ljava/lang/String;
    //   61: invokespecial 179	org/apache/commons/httpclient/methods/GetMethod:<init>	(Ljava/lang/String;)V
    //   64: astore 6
    //   66: aload 5
    //   68: aload 4
    //   70: aload_3
    //   71: invokestatic 190	org/eclipse/mylyn/commons/net/WebUtil:createHostConfiguration	(Lorg/apache/commons/httpclient/HttpClient;Lorg/eclipse/mylyn/commons/net/AbstractWebLocation;Lorg/eclipse/core/runtime/IProgressMonitor;)Lorg/apache/commons/httpclient/HostConfiguration;
    //   74: astore 7
    //   76: aload 5
    //   78: aload 7
    //   80: aload 6
    //   82: aload_3
    //   83: invokestatic 191	org/eclipse/mylyn/commons/net/WebUtil:execute	(Lorg/apache/commons/httpclient/HttpClient;Lorg/apache/commons/httpclient/HostConfiguration;Lorg/apache/commons/httpclient/HttpMethod;Lorg/eclipse/core/runtime/IProgressMonitor;)I
    //   86: istore 8
    //   88: iload 8
    //   90: sipush 200
    //   93: if_icmpne +90 -> 183
    //   96: aload 6
    //   98: aload_3
    //   99: invokestatic 189	org/eclipse/mylyn/commons/net/WebUtil:getResponseBodyAsStream	(Lorg/apache/commons/httpclient/HttpMethodBase;Lorg/eclipse/core/runtime/IProgressMonitor;)Ljava/io/InputStream;
    //   102: astore 9
    //   104: new 79	java/io/BufferedInputStream
    //   107: dup
    //   108: aload 9
    //   110: invokespecial 165	java/io/BufferedInputStream:<init>	(Ljava/io/InputStream;)V
    //   113: astore 9
    //   115: goto +9 -> 124
    //   118: aload_2
    //   119: iload 10
    //   121: invokevirtual 171	java/io/OutputStream:write	(I)V
    //   124: aload 9
    //   126: invokevirtual 168	java/io/InputStream:read	()I
    //   129: dup
    //   130: istore 10
    //   132: iconst_m1
    //   133: if_icmpne -15 -> 118
    //   136: getstatic 162	org/eclipse/core/runtime/Status:OK_STATUS	Lorg/eclipse/core/runtime/IStatus;
    //   139: astore 12
    //   141: aload_2
    //   142: invokevirtual 170	java/io/OutputStream:close	()V
    //   145: aload 9
    //   147: invokevirtual 169	java/io/InputStream:close	()V
    //   150: aload 6
    //   152: invokevirtual 178	org/apache/commons/httpclient/methods/GetMethod:releaseConnection	()V
    //   155: aload_3
    //   156: invokeinterface 194 1 0
    //   161: aload 12
    //   163: areturn
    //   164: astore 11
    //   166: aload_2
    //   167: invokevirtual 170	java/io/OutputStream:close	()V
    //   170: aload 11
    //   172: athrow
    //   173: astore 13
    //   175: aload 9
    //   177: invokevirtual 169	java/io/InputStream:close	()V
    //   180: aload 13
    //   182: athrow
    //   183: new 81	java/io/IOException
    //   186: dup
    //   187: getstatic 163	org/eclipse/mylyn/internal/discovery/core/util/Messages:WebUtil_cannotDownload	Ljava/lang/String;
    //   190: aload 4
    //   192: invokevirtual 186	org/eclipse/mylyn/commons/net/WebLocation:getUrl	()Ljava/lang/String;
    //   195: iload 8
    //   197: invokestatic 172	java/lang/Integer:valueOf	(I)Ljava/lang/Integer;
    //   200: invokestatic 193	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/String;
    //   203: invokespecial 167	java/io/IOException:<init>	(Ljava/lang/String;)V
    //   206: athrow
    //   207: astore 14
    //   209: aload 6
    //   211: invokevirtual 178	org/apache/commons/httpclient/methods/GetMethod:releaseConnection	()V
    //   214: aload 14
    //   216: athrow
    //   217: pop
    //   218: new 96	org/eclipse/core/runtime/Status
    //   221: dup
    //   222: iconst_4
    //   223: ldc 4
    //   225: ldc 2
    //   227: aload_1
    //   228: invokevirtual 174	java/net/URI:toString	()Ljava/lang/String;
    //   231: invokestatic 192	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;
    //   234: invokespecial 184	org/eclipse/core/runtime/Status:<init>	(ILjava/lang/String;Ljava/lang/String;)V
    //   237: astore 16
    //   239: aload_3
    //   240: invokeinterface 194 1 0
    //   245: aload 16
    //   247: areturn
    //   248: astore 15
    //   250: aload_3
    //   251: invokeinterface 194 1 0
    //   256: aload 15
    //   258: athrow
    // Line number table:
    //   Java source line #60	-> byte code offset #0
    //   Java source line #61	-> byte code offset #13
    //   Java source line #62	-> byte code offset #18
    //   Java source line #64	-> byte code offset #36
    //   Java source line #65	-> byte code offset #45
    //   Java source line #67	-> byte code offset #52
    //   Java source line #70	-> byte code offset #66
    //   Java source line #69	-> byte code offset #71
    //   Java source line #71	-> byte code offset #76
    //   Java source line #72	-> byte code offset #88
    //   Java source line #73	-> byte code offset #96
    //   Java source line #75	-> byte code offset #104
    //   Java source line #78	-> byte code offset #115
    //   Java source line #79	-> byte code offset #118
    //   Java source line #78	-> byte code offset #124
    //   Java source line #81	-> byte code offset #136
    //   Java source line #83	-> byte code offset #141
    //   Java source line #86	-> byte code offset #145
    //   Java source line #92	-> byte code offset #150
    //   Java source line #98	-> byte code offset #155
    //   Java source line #81	-> byte code offset #161
    //   Java source line #82	-> byte code offset #164
    //   Java source line #83	-> byte code offset #166
    //   Java source line #84	-> byte code offset #170
    //   Java source line #85	-> byte code offset #173
    //   Java source line #86	-> byte code offset #175
    //   Java source line #87	-> byte code offset #180
    //   Java source line #89	-> byte code offset #183
    //   Java source line #91	-> byte code offset #207
    //   Java source line #92	-> byte code offset #209
    //   Java source line #93	-> byte code offset #214
    //   Java source line #94	-> byte code offset #217
    //   Java source line #95	-> byte code offset #218
    //   Java source line #96	-> byte code offset #225
    //   Java source line #95	-> byte code offset #234
    //   Java source line #98	-> byte code offset #239
    //   Java source line #95	-> byte code offset #245
    //   Java source line #97	-> byte code offset #248
    //   Java source line #98	-> byte code offset #250
    //   Java source line #99	-> byte code offset #256
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	259	0	this	HttpClientTransportService
    //   0	259	1	uri	java.net.URI
    //   0	259	2	out	java.io.OutputStream
    //   0	259	3	monitor	org.eclipse.core.runtime.IProgressMonitor
    //   11	180	4	location	org.eclipse.mylyn.commons.net.WebLocation
    //   43	34	5	client	org.apache.commons.httpclient.HttpClient
    //   64	146	6	method	org.apache.commons.httpclient.methods.GetMethod
    //   74	5	7	hostConfiguration	org.apache.commons.httpclient.HostConfiguration
    //   86	110	8	result	int
    //   102	74	9	in	java.io.InputStream
    //   118	2	10	i	int
    //   130	3	10	i	int
    //   164	7	11	localObject1	Object
    //   139	23	12	localIStatus	org.eclipse.core.runtime.IStatus
    //   173	8	13	localObject2	Object
    //   207	8	14	localObject3	Object
    //   248	9	15	localObject4	Object
    //   237	9	16	localStatus	org.eclipse.core.runtime.Status
    //   217	1	18	localIOException	java.io.IOException
    // Exception table:
    //   from	to	target	type
    //   115	141	164	finally
    //   104	145	173	finally
    //   164	173	173	finally
    //   66	150	207	finally
    //   164	207	207	finally
    //   36	155	217	java/io/IOException
    //   164	217	217	java/io/IOException
    //   36	155	248	finally
    //   164	239	248	finally
  }
  
  /* Error */
  public java.io.InputStream stream(java.net.URI uri, org.eclipse.core.runtime.IProgressMonitor monitor)
    throws java.io.IOException, org.eclipse.core.runtime.CoreException
  {
    // Byte code:
    //   0: new 98	org/eclipse/mylyn/commons/net/WebLocation
    //   3: dup
    //   4: aload_1
    //   5: invokevirtual 174	java/net/URI:toString	()Ljava/lang/String;
    //   8: invokespecial 187	org/eclipse/mylyn/commons/net/WebLocation:<init>	(Ljava/lang/String;)V
    //   11: astore_3
    //   12: aload_2
    //   13: invokestatic 185	org/eclipse/mylyn/commons/net/Policy:monitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   16: astore_2
    //   17: aload_2
    //   18: getstatic 164	org/eclipse/mylyn/internal/discovery/core/util/Messages:WebUtil_task_retrievingUrl	Ljava/lang/String;
    //   21: aload_3
    //   22: invokevirtual 186	org/eclipse/mylyn/commons/net/WebLocation:getUrl	()Ljava/lang/String;
    //   25: invokestatic 192	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;
    //   28: iconst_m1
    //   29: invokeinterface 195 3 0
    //   34: new 89	org/apache/commons/httpclient/HttpClient
    //   37: dup
    //   38: invokespecial 177	org/apache/commons/httpclient/HttpClient:<init>	()V
    //   41: astore 4
    //   43: aload 4
    //   45: ldc 1
    //   47: invokestatic 188	org/eclipse/mylyn/commons/net/WebUtil:configureHttpClient	(Lorg/apache/commons/httpclient/HttpClient;Ljava/lang/String;)V
    //   50: iconst_0
    //   51: istore 5
    //   53: new 90	org/apache/commons/httpclient/methods/GetMethod
    //   56: dup
    //   57: aload_3
    //   58: invokevirtual 186	org/eclipse/mylyn/commons/net/WebLocation:getUrl	()Ljava/lang/String;
    //   61: invokespecial 179	org/apache/commons/httpclient/methods/GetMethod:<init>	(Ljava/lang/String;)V
    //   64: astore 6
    //   66: aload 4
    //   68: aload_3
    //   69: aload_2
    //   70: invokestatic 190	org/eclipse/mylyn/commons/net/WebUtil:createHostConfiguration	(Lorg/apache/commons/httpclient/HttpClient;Lorg/eclipse/mylyn/commons/net/AbstractWebLocation;Lorg/eclipse/core/runtime/IProgressMonitor;)Lorg/apache/commons/httpclient/HostConfiguration;
    //   73: astore 7
    //   75: aload 4
    //   77: aload 7
    //   79: aload 6
    //   81: aload_2
    //   82: invokestatic 191	org/eclipse/mylyn/commons/net/WebUtil:execute	(Lorg/apache/commons/httpclient/HttpClient;Lorg/apache/commons/httpclient/HostConfiguration;Lorg/apache/commons/httpclient/HttpMethod;Lorg/eclipse/core/runtime/IProgressMonitor;)I
    //   85: istore 8
    //   87: iload 8
    //   89: sipush 200
    //   92: if_icmpne +37 -> 129
    //   95: aload 6
    //   97: aload_2
    //   98: invokestatic 189	org/eclipse/mylyn/commons/net/WebUtil:getResponseBodyAsStream	(Lorg/apache/commons/httpclient/HttpMethodBase;Lorg/eclipse/core/runtime/IProgressMonitor;)Ljava/io/InputStream;
    //   101: astore 9
    //   103: iconst_1
    //   104: istore 5
    //   106: aload 9
    //   108: astore 11
    //   110: iload 5
    //   112: ifne +8 -> 120
    //   115: aload 6
    //   117: invokevirtual 178	org/apache/commons/httpclient/methods/GetMethod:releaseConnection	()V
    //   120: aload_2
    //   121: invokeinterface 194 1 0
    //   126: aload 11
    //   128: areturn
    //   129: new 81	java/io/IOException
    //   132: dup
    //   133: getstatic 163	org/eclipse/mylyn/internal/discovery/core/util/Messages:WebUtil_cannotDownload	Ljava/lang/String;
    //   136: aload_3
    //   137: invokevirtual 186	org/eclipse/mylyn/commons/net/WebLocation:getUrl	()Ljava/lang/String;
    //   140: iload 8
    //   142: invokestatic 172	java/lang/Integer:valueOf	(I)Ljava/lang/Integer;
    //   145: invokestatic 193	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/String;
    //   148: invokespecial 167	java/io/IOException:<init>	(Ljava/lang/String;)V
    //   151: athrow
    //   152: astore 10
    //   154: iload 5
    //   156: ifne +8 -> 164
    //   159: aload 6
    //   161: invokevirtual 178	org/apache/commons/httpclient/methods/GetMethod:releaseConnection	()V
    //   164: aload 10
    //   166: athrow
    //   167: astore 12
    //   169: aload_2
    //   170: invokeinterface 194 1 0
    //   175: aload 12
    //   177: athrow
    // Line number table:
    //   Java source line #115	-> byte code offset #0
    //   Java source line #116	-> byte code offset #12
    //   Java source line #117	-> byte code offset #17
    //   Java source line #119	-> byte code offset #34
    //   Java source line #120	-> byte code offset #43
    //   Java source line #122	-> byte code offset #50
    //   Java source line #123	-> byte code offset #53
    //   Java source line #126	-> byte code offset #66
    //   Java source line #125	-> byte code offset #70
    //   Java source line #127	-> byte code offset #75
    //   Java source line #128	-> byte code offset #87
    //   Java source line #129	-> byte code offset #95
    //   Java source line #130	-> byte code offset #103
    //   Java source line #131	-> byte code offset #106
    //   Java source line #136	-> byte code offset #110
    //   Java source line #137	-> byte code offset #115
    //   Java source line #141	-> byte code offset #120
    //   Java source line #131	-> byte code offset #126
    //   Java source line #133	-> byte code offset #129
    //   Java source line #135	-> byte code offset #152
    //   Java source line #136	-> byte code offset #154
    //   Java source line #137	-> byte code offset #159
    //   Java source line #139	-> byte code offset #164
    //   Java source line #140	-> byte code offset #167
    //   Java source line #141	-> byte code offset #169
    //   Java source line #142	-> byte code offset #175
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	178	0	this	HttpClientTransportService
    //   0	178	1	uri	java.net.URI
    //   0	178	2	monitor	org.eclipse.core.runtime.IProgressMonitor
    //   11	126	3	location	org.eclipse.mylyn.commons.net.WebLocation
    //   41	35	4	client	org.apache.commons.httpclient.HttpClient
    //   51	104	5	success	boolean
    //   64	96	6	method	org.apache.commons.httpclient.methods.GetMethod
    //   73	5	7	hostConfiguration	org.apache.commons.httpclient.HostConfiguration
    //   129	1	7	hostConfiguration	org.apache.commons.httpclient.HostConfiguration
    //   85	3	8	result	int
    //   129	12	8	result	int
    //   101	6	9	in	java.io.InputStream
    //   152	13	10	localObject1	Object
    //   108	19	11	localInputStream1	java.io.InputStream
    //   167	9	12	localObject2	Object
    // Exception table:
    //   from	to	target	type
    //   66	110	152	finally
    //   129	152	152	finally
    //   34	120	167	finally
    //   129	167	167	finally
  }
  
  /* Error */
  public long getLastModified(java.net.URI uri, org.eclipse.core.runtime.IProgressMonitor monitor)
    throws org.eclipse.core.runtime.CoreException, java.io.IOException
  {
    // Byte code:
    //   0: new 98	org/eclipse/mylyn/commons/net/WebLocation
    //   3: dup
    //   4: aload_1
    //   5: invokevirtual 174	java/net/URI:toString	()Ljava/lang/String;
    //   8: invokespecial 187	org/eclipse/mylyn/commons/net/WebLocation:<init>	(Ljava/lang/String;)V
    //   11: astore_3
    //   12: aload_2
    //   13: invokestatic 185	org/eclipse/mylyn/commons/net/Policy:monitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   16: astore_2
    //   17: aload_2
    //   18: getstatic 164	org/eclipse/mylyn/internal/discovery/core/util/Messages:WebUtil_task_retrievingUrl	Ljava/lang/String;
    //   21: aload_3
    //   22: invokevirtual 186	org/eclipse/mylyn/commons/net/WebLocation:getUrl	()Ljava/lang/String;
    //   25: invokestatic 192	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;
    //   28: iconst_m1
    //   29: invokeinterface 195 3 0
    //   34: new 89	org/apache/commons/httpclient/HttpClient
    //   37: dup
    //   38: invokespecial 177	org/apache/commons/httpclient/HttpClient:<init>	()V
    //   41: astore 4
    //   43: aload 4
    //   45: ldc 1
    //   47: invokestatic 188	org/eclipse/mylyn/commons/net/WebUtil:configureHttpClient	(Lorg/apache/commons/httpclient/HttpClient;Ljava/lang/String;)V
    //   50: new 91	org/apache/commons/httpclient/methods/HeadMethod
    //   53: dup
    //   54: aload_3
    //   55: invokevirtual 186	org/eclipse/mylyn/commons/net/WebLocation:getUrl	()Ljava/lang/String;
    //   58: invokespecial 181	org/apache/commons/httpclient/methods/HeadMethod:<init>	(Ljava/lang/String;)V
    //   61: astore 5
    //   63: aload 4
    //   65: aload_3
    //   66: aload_2
    //   67: invokestatic 190	org/eclipse/mylyn/commons/net/WebUtil:createHostConfiguration	(Lorg/apache/commons/httpclient/HttpClient;Lorg/eclipse/mylyn/commons/net/AbstractWebLocation;Lorg/eclipse/core/runtime/IProgressMonitor;)Lorg/apache/commons/httpclient/HostConfiguration;
    //   70: astore 6
    //   72: aload 4
    //   74: aload 6
    //   76: aload 5
    //   78: aload_2
    //   79: invokestatic 191	org/eclipse/mylyn/commons/net/WebUtil:execute	(Lorg/apache/commons/httpclient/HttpClient;Lorg/apache/commons/httpclient/HostConfiguration;Lorg/apache/commons/httpclient/HttpMethod;Lorg/eclipse/core/runtime/IProgressMonitor;)I
    //   82: istore 7
    //   84: iload 7
    //   86: sipush 200
    //   89: if_icmpne +58 -> 147
    //   92: aload 5
    //   94: ldc 3
    //   96: invokevirtual 182	org/apache/commons/httpclient/methods/HeadMethod:getResponseHeader	(Ljava/lang/String;)Lorg/apache/commons/httpclient/Header;
    //   99: astore 8
    //   101: aload 8
    //   103: ifnull +31 -> 134
    //   106: aload 8
    //   108: invokevirtual 176	org/apache/commons/httpclient/Header:getValue	()Ljava/lang/String;
    //   111: invokestatic 183	org/apache/commons/httpclient/util/DateUtil:parseDate	(Ljava/lang/String;)Ljava/util/Date;
    //   114: invokevirtual 175	java/util/Date:getTime	()J
    //   117: lstore 10
    //   119: aload 5
    //   121: invokevirtual 180	org/apache/commons/httpclient/methods/HeadMethod:releaseConnection	()V
    //   124: aload_2
    //   125: invokeinterface 194 1 0
    //   130: lload 10
    //   132: lreturn
    //   133: pop
    //   134: aload 5
    //   136: invokevirtual 180	org/apache/commons/httpclient/methods/HeadMethod:releaseConnection	()V
    //   139: aload_2
    //   140: invokeinterface 194 1 0
    //   145: lconst_0
    //   146: lreturn
    //   147: iload 7
    //   149: sipush 404
    //   152: if_icmpne +26 -> 178
    //   155: new 80	java/io/FileNotFoundException
    //   158: dup
    //   159: getstatic 163	org/eclipse/mylyn/internal/discovery/core/util/Messages:WebUtil_cannotDownload	Ljava/lang/String;
    //   162: aload_3
    //   163: invokevirtual 186	org/eclipse/mylyn/commons/net/WebLocation:getUrl	()Ljava/lang/String;
    //   166: iload 7
    //   168: invokestatic 172	java/lang/Integer:valueOf	(I)Ljava/lang/Integer;
    //   171: invokestatic 193	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/String;
    //   174: invokespecial 166	java/io/FileNotFoundException:<init>	(Ljava/lang/String;)V
    //   177: athrow
    //   178: new 81	java/io/IOException
    //   181: dup
    //   182: getstatic 163	org/eclipse/mylyn/internal/discovery/core/util/Messages:WebUtil_cannotDownload	Ljava/lang/String;
    //   185: aload_3
    //   186: invokevirtual 186	org/eclipse/mylyn/commons/net/WebLocation:getUrl	()Ljava/lang/String;
    //   189: iload 7
    //   191: invokestatic 172	java/lang/Integer:valueOf	(I)Ljava/lang/Integer;
    //   194: invokestatic 193	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/String;
    //   197: invokespecial 167	java/io/IOException:<init>	(Ljava/lang/String;)V
    //   200: athrow
    //   201: astore 9
    //   203: aload 5
    //   205: invokevirtual 180	org/apache/commons/httpclient/methods/HeadMethod:releaseConnection	()V
    //   208: aload 9
    //   210: athrow
    //   211: astore 12
    //   213: aload_2
    //   214: invokeinterface 194 1 0
    //   219: aload 12
    //   221: athrow
    // Line number table:
    //   Java source line #157	-> byte code offset #0
    //   Java source line #158	-> byte code offset #12
    //   Java source line #159	-> byte code offset #17
    //   Java source line #161	-> byte code offset #34
    //   Java source line #162	-> byte code offset #43
    //   Java source line #164	-> byte code offset #50
    //   Java source line #167	-> byte code offset #63
    //   Java source line #166	-> byte code offset #67
    //   Java source line #168	-> byte code offset #72
    //   Java source line #169	-> byte code offset #84
    //   Java source line #170	-> byte code offset #92
    //   Java source line #171	-> byte code offset #101
    //   Java source line #173	-> byte code offset #106
    //   Java source line #186	-> byte code offset #119
    //   Java source line #189	-> byte code offset #124
    //   Java source line #173	-> byte code offset #130
    //   Java source line #174	-> byte code offset #133
    //   Java source line #186	-> byte code offset #134
    //   Java source line #189	-> byte code offset #139
    //   Java source line #178	-> byte code offset #145
    //   Java source line #179	-> byte code offset #147
    //   Java source line #180	-> byte code offset #155
    //   Java source line #181	-> byte code offset #159
    //   Java source line #180	-> byte code offset #174
    //   Java source line #183	-> byte code offset #178
    //   Java source line #185	-> byte code offset #201
    //   Java source line #186	-> byte code offset #203
    //   Java source line #187	-> byte code offset #208
    //   Java source line #188	-> byte code offset #211
    //   Java source line #189	-> byte code offset #213
    //   Java source line #190	-> byte code offset #219
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	222	0	this	HttpClientTransportService
    //   0	222	1	uri	java.net.URI
    //   0	222	2	monitor	org.eclipse.core.runtime.IProgressMonitor
    //   11	175	3	location	org.eclipse.mylyn.commons.net.WebLocation
    //   41	32	4	client	org.apache.commons.httpclient.HttpClient
    //   61	143	5	method	org.apache.commons.httpclient.methods.HeadMethod
    //   70	5	6	hostConfiguration	org.apache.commons.httpclient.HostConfiguration
    //   82	108	7	result	int
    //   99	8	8	lastModified	org.apache.commons.httpclient.Header
    //   201	8	9	localObject1	Object
    //   117	14	10	l	long
    //   133	1	12	localDateParseException	org.apache.commons.httpclient.util.DateParseException
    //   211	9	12	localObject2	Object
    // Exception table:
    //   from	to	target	type
    //   106	119	133	org/apache/commons/httpclient/util/DateParseException
    //   63	119	201	finally
    //   133	134	201	finally
    //   147	201	201	finally
    //   34	124	211	finally
    //   133	139	211	finally
    //   147	211	211	finally
  }
}

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

import java.io.IOException;
import java.io.Reader;

public abstract interface WebUtil$TextContentProcessor
{
  public abstract void process(Reader paramReader)
    throws IOException;
}

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

import org.eclipse.osgi.util.NLS;

class Messages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.eclipse.mylyn.internal.discovery.core.util.messages";
  public static String WebUtil_cannotDownload;
  public static String WebUtil_task_retrievingUrl;
  
  static
  {
    NLS.initializeMessages("org.eclipse.mylyn.internal.discovery.core.util.messages", Messages.class);
  }
}

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

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URI;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;

public class P2TransportService
  implements ITransportService
{
  private Object transport;
  private Method downloadMethod;
  private Method streamMethod;
  private Method getLastModifiedMethod;
  
  public P2TransportService()
    throws ClassNotFoundException
  {
    try
    {
      Class<?> clazz;
      try
      {
        Class<?> clazz = Class.forName("org.eclipse.equinox.internal.p2.repository.RepositoryTransport");
        Method getInstanceMethod = clazz.getDeclaredMethod("getInstance", new Class[0]);
        transport = getInstanceMethod.invoke(null, new Object[0]);
      }
      catch (ClassNotFoundException localClassNotFoundException)
      {
        clazz = Class.forName("org.eclipse.equinox.internal.p2.repository.Transport");
        transport = getTransportEclipse37();
      }
      downloadMethod = clazz.getDeclaredMethod("download", new Class[] { URI.class, OutputStream.class, IProgressMonitor.class });
      streamMethod = clazz.getDeclaredMethod("stream", new Class[] { URI.class, IProgressMonitor.class });
      getLastModifiedMethod = clazz.getDeclaredMethod("getLastModified", new Class[] { URI.class, IProgressMonitor.class });
    }
    catch (LinkageError e)
    {
      throw new ClassNotFoundException("Failed to load P2 transport", e);
    }
    catch (Exception e)
    {
      throw new ClassNotFoundException("Failed to load P2 transport", e);
    }
  }
  
  private Object getTransportEclipse37()
    throws Exception
  {
    BundleContext bundleContext = Platform.getBundle("org.eclipse.core.runtime").getBundleContext();
    ServiceReference serviceReference = bundleContext.getServiceReference("org.eclipse.equinox.p2.core.IProvisioningAgent");
    if (serviceReference != null) {
      try
      {
        Object agent = bundleContext.getService(serviceReference);
        if (agent != null)
        {
          Method method = agent.getClass().getDeclaredMethod("getService", new Class[] { String.class });
          return method.invoke(agent, new Object[] { "org.eclipse.equinox.internal.p2.repository.Transport" });
        }
        throw new Exception("Provisioning agent instance not available");
      }
      finally
      {
        bundleContext.ungetService(serviceReference);
      }
    }
    throw new Exception("Service reference for org.eclipse.equinox.p2.core.IProvisioningAgent not available");
  }
  
  public IStatus download(URI uri, OutputStream out, IProgressMonitor monitor)
  {
    try
    {
      return (IStatus)downloadMethod.invoke(transport, new Object[] { uri, out, monitor });
    }
    catch (Exception e)
    {
      throw new RuntimeException(e);
    }
  }
  
  public InputStream stream(URI uri, IProgressMonitor monitor)
    throws IOException, CoreException
  {
    try
    {
      return (InputStream)streamMethod.invoke(transport, new Object[] { uri, monitor });
    }
    c
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