org.eclipse.ecf.provider.filetransfer.ssl_1.0.0.v20120610-1946

16:43:12.914 INFO  jd.cli.Main - Decompiling org.eclipse.ecf.provider.filetransfer.ssl_1.0.0.v20120610-1946.jar
package org.eclipse.ecf.internal.provider.filetransfer.ssl;

import java.net.URLConnection;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLSocketFactory;
import org.eclipse.ecf.internal.provider.filetransfer.IURLConnectionModifier;
import org.osgi.framework.BundleContext;
import org.osgi.util.tracker.ServiceTracker;

public class ECFURLConnectionModifier
  implements IURLConnectionModifier
{
  private BundleContext context;
  private ServiceTracker sslSocketFactoryTracker;
  
  public void init(BundleContext ctxt)
  {
    context = ctxt;
  }
  
  private SSLSocketFactory getSSLSocketFactory()
  {
    if (context == null) {
      return null;
    }
    if (sslSocketFactoryTracker == null)
    {
      sslSocketFactoryTracker = new ServiceTracker(context, SSLSocketFactory.class.getName(), null);
      sslSocketFactoryTracker.open();
    }
    return (SSLSocketFactory)sslSocketFactoryTracker.getService();
  }
  
  public void dispose()
  {
    context = null;
    if (sslSocketFactoryTracker != null)
    {
      sslSocketFactoryTracker.close();
      sslSocketFactoryTracker = null;
    }
  }
  
  public void setSocketFactoryForConnection(URLConnection urlConnection)
  {
    if ((urlConnection instanceof HttpsURLConnection))
    {
      HttpsURLConnection httpsURLConnection = (HttpsURLConnection)urlConnection;
      SSLSocketFactory sslSocketFactory = getSSLSocketFactory();
      if (sslSocketFactory != null) {
        httpsURLConnection.setSSLSocketFactory(sslSocketFactory);
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ecf.internal.provider.filetransfer.ssl.ECFURLConnectionModifier
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
1

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