org.eclipse.mylyn.commons.repositories_0.9.1.v20120412-0100

16:46:30.124 INFO  jd.cli.Main - Decompiling org.eclipse.mylyn.commons.repositories_0.9.1.v20120412-0100.jar
package org.eclipse.mylyn.commons.repositories;

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

@Deprecated
public abstract class RepositoryValidator
{
  private final RepositoryLocation location;
  private IStatus result;
  
  public RepositoryValidator(RepositoryLocation location)
  {
    this.location = location;
  }
  
  public RepositoryLocation getLocation()
  {
    return location;
  }
  
  public IStatus getResult()
  {
    return result;
  }
  
  public abstract IStatus run(IProgressMonitor paramIProgressMonitor);
  
  public void setResult(IStatus result)
  {
    this.result = result;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.commons.repositories.RepositoryValidator
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.commons.repositories.auth;

/**
 * @deprecated
 */
public enum AuthenticationType
{
  HTTP,  PROXY,  REPOSITORY;
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.commons.repositories.auth.AuthenticationType
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.commons.repositories.auth;

import org.eclipse.equinox.security.storage.StorageException;

@Deprecated
public abstract class AuthenticationCredentials
{
  public abstract void save(ICredentialsStore paramICredentialsStore, String paramString)
    throws StorageException;
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.commons.repositories.auth.AuthenticationCredentials
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.commons.repositories.auth;

import java.io.IOException;
import org.eclipse.equinox.security.storage.StorageException;

@Deprecated
public abstract interface ICredentialsStore
{
  public abstract void clear();
  
  public abstract void flush()
    throws IOException;
  
  public abstract String get(String paramString1, String paramString2)
    throws StorageException;
  
  public abstract byte[] getByteArray(String paramString, byte[] paramArrayOfByte)
    throws StorageException;
  
  public abstract String[] keys();
  
  public abstract void put(String paramString1, String paramString2, boolean paramBoolean)
    throws StorageException;
  
  public abstract void putByteArray(String paramString, byte[] paramArrayOfByte, boolean paramBoolean)
    throws StorageException;
  
  public abstract void remove(String paramString);
  
  public abstract void copyTo(ICredentialsStore paramICredentialsStore)
    throws StorageException;
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.commons.repositories.auth.ICredentialsStore
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.commons.repositories.auth;

import org.eclipse.equinox.security.storage.StorageException;

@Deprecated
public class UsernamePasswordCredentials
  extends AuthenticationCredentials
{
  private final String userName;
  private final String password;
  
  public UsernamePasswordCredentials(String userName, String password)
  {
    if (userName == null) {
      throw new IllegalArgumentException();
    }
    if (password == null) {
      throw new IllegalArgumentException();
    }
    this.userName = userName;
    this.password = password;
  }
  
  public String getUserName()
  {
    return userName;
  }
  
  public String getPassword()
  {
    return password;
  }
  
  public int hashCode()
  {
    int result = 1;
    result = 31 * result + (password == null ? 0 : password.hashCode());
    result = 31 * result + (userName == null ? 0 : userName.hashCode());
    return result;
  }
  
  public boolean equals(Object obj)
  {
    if (this == obj) {
      return true;
    }
    if (obj == null) {
      return false;
    }
    if (getClass() != obj.getClass()) {
      return false;
    }
    UsernamePasswordCredentials other = (UsernamePasswordCredentials)obj;
    if (password == null)
    {
      if (password != null) {
        return false;
      }
    }
    else if (!password.equals(password)) {
      return false;
    }
    if (userName == null)
    {
      if (userName != null) {
        return false;
      }
    }
    else if (!userName.equals(userName)) {
      return false;
    }
    return true;
  }
  
  public static UsernamePasswordCredentials create(ICredentialsStore store, String prefix)
    throws StorageException
  {
    String userName = store.get(prefix + ".user", "");
    String password = store.get(prefix + ".password", "");
    return new UsernamePasswordCredentials(userName, password);
  }
  
  public void save(ICredentialsStore store, String prefix)
    throws StorageException
  {
    store.put(prefix + ".user", userName, false);
    store.put(prefix + ".password", password, true);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.commons.repositories.auth.UsernamePasswordCredentials
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.commons.repositories;

import org.eclipse.core.runtime.PlatformObject;

@Deprecated
public class RepositoryCategory
  extends PlatformObject
{
  private final String id;
  private final String label;
  private final int rank;
  public static final String ID_CATEGORY_BUGS = "org.eclipse.mylyn.category.bugs";
  public static final String ID_CATEGORY_BUILDS = "org.eclipse.mylyn.category.build";
  public static final String ID_CATEGORY_OTHER = "org.eclipse.mylyn.category.other";
  public static final String ID_CATEGORY_REVIEWS = "org.eclipse.mylyn.category.review";
  public static final String ID_CATEGORY_TASKS = "org.eclipse.mylyn.category.tasks";
  public static final String ID_CATEGORY_ALL = "org.eclipse.mylyn.category.all";
  public static final String ID_CATEGORY_ROOT = "org.eclipse.mylyn.category.root";
  
  public RepositoryCategory(String id, String label, int rank)
  {
    this.id = id;
    this.label = label;
    this.rank = rank;
  }
  
  public String getId()
  {
    return id;
  }
  
  public int compareTo(Object arg0)
  {
    if ((arg0 instanceof RepositoryCategory)) {
      return getRank() - ((RepositoryCategory)arg0).getRank();
    }
    return 0;
  }
  
  public int getRank()
  {
    return rank;
  }
  
  public String getLabel()
  {
    return label;
  }
  
  public String toString()
  {
    return getLabel();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.commons.repositories.RepositoryCategory
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.commons.repositories;

import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.PlatformObject;
import org.eclipse.equinox.security.storage.StorageException;
import org.eclipse.mylyn.commons.repositories.auth.AuthenticationCredentials;
import org.eclipse.mylyn.commons.repositories.auth.AuthenticationType;
import org.eclipse.mylyn.commons.repositories.auth.ICredentialsStore;
import org.eclipse.mylyn.internal.commons.repositories.CredentialsFactory;
import org.eclipse.mylyn.internal.commons.repositories.InMemoryCredentialsStore;
import org.eclipse.mylyn.internal.commons.repositories.LocationService;

@Deprecated
public class RepositoryLocation
  extends PlatformObject
{
  private static final String AUTH_HTTP = "org.eclipse.mylyn.tasklist.repositories.httpauth";
  private static final String AUTH_PROXY = "org.eclipse.mylyn.tasklist.repositories.proxy";
  private static final String AUTH_REPOSITORY = "org.eclipse.mylyn.tasklist.repositories";
  private static final String ENABLED = ".enabled";
  private static final String ID_PLUGIN = "org.eclipse.mylyn.commons.repository";
  public static final String PROPERTY_CATEGORY = "category";
  public static final String PROPERTY_ENCODING = "encoding";
  public static final String PROPERTY_ID = "id";
  public static final String PROPERTY_LABEL = "label";
  public static final String PROPERTY_OFFLINE = "org.eclipse.mylyn.tasklist.repositories.offline";
  public static final String PROPERTY_TIMEZONE = "timezone";
  public static final String PROPERTY_URL = "url";
  public static final String PROPERTY_USERNAME = "org.eclipse.mylyn.repositories.username";
  public static final String PROPERTY_PROXY_HOST = "org.eclipse.mylyn.repositories.proxy.host";
  public static final String PROPERTY_PROXY_PORT = "org.eclipse.mylyn.repositories.proxy.port";
  public static final String PROPERTY_PROXY_USEDEFAULT = "org.eclipse.mylyn.repositories.proxy.usedefault";
  private static final String SAVE_PASSWORD = ".savePassword";
  private static final String USERNAME = ".username";
  private String cachedUserName;
  private ICredentialsStore credentialsStore;
  
  private static String getKeyPrefix(AuthenticationType type)
  {
    switch (type)
    {
    case HTTP: 
      return "org.eclipse.mylyn.tasklist.repositories.httpauth";
    case PROXY: 
      return "org.eclipse.mylyn.tasklist.repositories.proxy";
    case REPOSITORY: 
      return "org.eclipse.mylyn.tasklist.repositories";
    }
    throw new IllegalArgumentException("Unknown authentication type: " + type);
  }
  
  private IStatus errorStatus = null;
  private boolean isCachedUserName;
  private final Map<String, String> properties = new LinkedHashMap();
  private final Set<PropertyChangeListener> propertyChangeListeners = new HashSet();
  private ILocationService service;
  private boolean workingCopy;
  
  public RepositoryLocation()
  {
    service = LocationService.getDefault();
  }
  
  public RepositoryLocation(Map<String, String> properties)
  {
    this.properties.putAll(properties);
    workingCopy = true;
    service = LocationService.getDefault();
  }
  
  public RepositoryLocation(RepositoryLocation source)
  {
    properties.putAll(properties);
    workingCopy = true;
    service = source.getService();
  }
  
  public void addChangeListener(PropertyChangeListener listener)
  {
    propertyChangeListeners.add(listener);
  }
  
  public void clearCredentials()
  {
    getCredentialsStore().clear();
  }
  
  public <T extends AuthenticationCredentials> T getCredentials(AuthenticationType authType, Class<T> credentialsKind)
  {
    String prefix = getKeyPrefix(authType);
    if (getBooleanPropery(prefix + ".enabled"))
    {
      if (getId() == null) {
        return null;
      }
      try
      {
        return CredentialsFactory.create(credentialsKind, getCredentialsStore(), prefix);
      }
      catch (StorageException localStorageException) {}
    }
    return null;
  }
  
  public ICredentialsStore getCredentialsStore()
  {
    if (credentialsStore == null) {
      return getService().getCredentialsStore(getId());
    }
    return credentialsStore;
  }
  
  public String getId()
  {
    String id = getProperty("id");
    if (id == null) {
      throw new IllegalStateException("Repository ID is not set");
    }
    return id;
  }
  
  public Map<String, String> getProperties()
  {
    return new LinkedHashMap(properties);
  }
  
  public String getProperty(String name)
  {
    return (String)properties.get(name);
  }
  
  public String getLabel()
  {
    String label = (String)properties.get("label");
    if ((label != null) && (label.length() > 0)) {
      return label;
    }
    return getUrl();
  }
  
  public boolean getSavePassword(AuthenticationType authType)
  {
    return getBooleanPropery(getKeyPrefix(authType) + ".savePassword");
  }
  
  public boolean getBooleanPropery(String key)
  {
    String value = getProperty(key);
    return (value != null) && (Boolean.parseBoolean(value));
  }
  
  public ILocationService getService()
  {
    return service;
  }
  
  public IStatus getStatus()
  {
    return errorStatus;
  }
  
  public String getUrl()
  {
    return getProperty("url");
  }
  
  public String getUserName()
  {
    return getProperty("org.eclipse.mylyn.repositories.username");
  }
  
  public void setUserName(String userName)
  {
    setProperty("org.eclipse.mylyn.repositories.username", userName);
  }
  
  private void handlePropertyChange(String key, Object old, Object value)
  {
    if ("id".equals(key)) {
      credentialsStore = null;
    }
    PropertyChangeEvent event = new PropertyChangeEvent(this, key, old, value);
    for (PropertyChangeListener listener : propertyChangeListeners) {
      listener.propertyChange(event);
    }
  }
  
  private boolean hasChanged(Object oldValue, Object newValue)
  {
    return ((oldValue != null) && (!oldValue.equals(newValue))) || ((oldValue == null) && (newValue != null));
  }
  
  public boolean hasProperty(String name)
  {
    String value = getProperty(name);
    return (value != null) && (value.trim().length() > 0);
  }
  
  public boolean isOffline()
  {
    return Boolean.parseBoolean(getProperty("org.eclipse.mylyn.tasklist.repositories.offline"));
  }
  
  public boolean isWorkingCopy()
  {
    return workingCopy;
  }
  
  public void removeChangeListener(PropertyChangeListener listener)
  {
    propertyChangeListeners.remove(listener);
  }
  
  public void removeProperty(String key)
  {
    setProperty(key, null);
  }
  
  public <T extends AuthenticationCredentials> void setCredentials(AuthenticationType authType, T credentials)
  {
    String prefix = getKeyPrefix(authType);
    if (credentials == null)
    {
      if (authType == AuthenticationType.REPOSITORY) {
        cachedUserName = null;
      }
      setProperty(prefix + ".enabled", String.valueOf(false));
    }
    else
    {
      setProperty(prefix + ".enabled", String.valueOf(true));
      try
      {
        credentials.save(getCredentialsStore(), prefix);
      }
      catch (StorageException localStorageException) {}
    }
  }
  
  public void setCredentialsStore(ICredentialsStore credentialsStore)
  {
    this.credentialsStore = credentialsStore;
  }
  
  public void setLabel(String label)
  {
    setProperty("label", label);
  }
  
  public void setOffline(boolean offline)
  {
    properties.put("org.eclipse.mylyn.tasklist.repositories.offline", String.valueOf(offline));
  }
  
  public void setProperty(String key, String newValue)
  {
    Assert.isNotNull(key);
    String oldValue = (String)properties.get(key);
    if (hasChanged(oldValue, newValue))
    {
      properties.put(key.intern(), newValue != null ? newValue.intern() : null);
      handlePropertyChange(key, oldValue, newValue);
    }
  }
  
  public void setService(ILocationService service)
  {
    this.service = service;
  }
  
  public void setStatus(IStatus errorStatus)
  {
    this.errorStatus = errorStatus;
  }
  
  public String toString()
  {
    return getLabel();
  }
  
  public void apply(RepositoryLocation location)
  {
    String oldId = getProperty("id");
    ICredentialsStore oldCredentialsStore = null;
    if (oldId != null) {
      oldCredentialsStore = getCredentialsStore();
    }
    HashSet<String> removed = new HashSet(properties.keySet());
    removed.removeAll(properties.keySet());
    for (Map.Entry<String, String> entry : properties.entrySet()) {
      setProperty((String)entry.getKey(), (String)entry.getValue());
    }
    for (String key : removed) {
      setProperty(key, null);
    }
    String newId = getProperty("id");
    if (newId != null)
    {
      ICredentialsStore newCredentialsStore = getCredentialsStore();
      if ((!newId.equals(oldId)) && 
        (oldCredentialsStore != null)) {
        try
        {
          oldCredentialsStore.copyTo(newCredentialsStore);
          oldCredentialsStore.clear();
        }
        catch (StorageException localStorageException1) {}
      }
      if ((location.getCredentialsStore() instanceof InMemoryCredentialsStore)) {
        try
        {
          ((InMemoryCredentialsStore)location.getCredentialsStore()).copyTo(newCredentialsStore);
        }
        catch (StorageException localStorageException2) {}
      }
    }
  }
  
  public void setIdPreservingCredentialsStore(String id)
  {
    ICredentialsStore store = getCredentialsStore();
    setProperty("id", id);
    if (credentialsStore == null) {
      setCredentialsStore(store);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.commons.repositories.RepositoryLocation
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.commons.repositories;

import java.net.Proxy;
import javax.net.ssl.X509TrustManager;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.mylyn.commons.repositories.auth.AuthenticationCredentials;
import org.eclipse.mylyn.commons.repositories.auth.AuthenticationType;
import org.eclipse.mylyn.commons.repositories.auth.ICredentialsStore;

@Deprecated
public abstract interface ILocationService
{
  public abstract Proxy getProxyForHost(String paramString1, String paramString2);
  
  public abstract X509TrustManager getTrustManager();
  
  public abstract <T extends AuthenticationCredentials> T requestCredentials(AuthenticationType paramAuthenticationType, Class<T> paramClass, String paramString, IProgressMonitor paramIProgressMonitor);
  
  public abstract ICredentialsStore getCredentialsStore(String paramString);
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.commons.repositories.ILocationService
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.commons.repositories;

import java.net.Proxy;
import org.eclipse.mylyn.commons.net.IProxyProvider;
import org.eclipse.mylyn.commons.net.WebUtil;

class LocationService$PlatformProxyProvider
  implements IProxyProvider
{
  public Proxy getProxyForHost(String host, String proxyType)
  {
    return WebUtil.getProxy(host, proxyType);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.commons.repositories.LocationService.PlatformProxyProvider
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.commons.repositories;

import org.eclipse.equinox.security.storage.StorageException;
import org.eclipse.mylyn.commons.repositories.auth.AuthenticationCredentials;
import org.eclipse.mylyn.commons.repositories.auth.ICredentialsStore;
import org.eclipse.mylyn.commons.repositories.auth.UsernamePasswordCredentials;

@Deprecated
public class CredentialsFactory
{
  public static <T extends AuthenticationCredentials> T create(Class<T> credentialsKind, ICredentialsStore credentialsStore, String key)
    throws StorageException
  {
    if (credentialsKind == UsernamePasswordCredentials.class) {
      return UsernamePasswordCredentials.create(credentialsStore, key);
    }
    throw new IllegalArgumentException("Unknown credentials type: " + credentialsKind);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.commons.repositories.CredentialsFactory
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.commons.repositories;

import java.io.IOException;
import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.eclipse.equinox.security.storage.StorageException;
import org.eclipse.mylyn.commons.repositories.auth.ICredentialsStore;

@Deprecated
public class InMemoryCredentialsStore
  implements ICredentialsStore
{
  private final ConcurrentHashMap<String, Object> store;
  private final ICredentialsStore parent;
  
  public InMemoryCredentialsStore(ICredentialsStore parent)
  {
    this.parent = parent;
    store = new ConcurrentHashMap();
  }
  
  public void clear()
  {
    store.clear();
  }
  
  public void flush()
    throws IOException
  {}
  
  public String get(String key, String def)
    throws StorageException
  {
    String value = (String)store.get(key);
    if ((value == null) && (parent != null)) {
      return parent.get(key, def);
    }
    return value != null ? value : def;
  }
  
  public byte[] getByteArray(String key, byte[] def)
    throws StorageException
  {
    byte[] value = (byte[])store.get(key);
    if ((value == null) && (parent != null)) {
      return parent.getByteArray(key, def);
    }
    return value != null ? value : def;
  }
  
  public String[] keys()
  {
    return (String[])store.keySet().toArray(new String[0]);
  }
  
  public void put(String key, String value, boolean encrypt)
    throws StorageException
  {
    store.put(key, value);
  }
  
  public void putByteArray(String key, byte[] value, boolean encrypt)
    throws StorageException
  {
    store.put(key, value);
  }
  
  public void remove(String key)
  {
    store.remove(key);
  }
  
  public void copyTo(ICredentialsStore target)
    throws StorageException
  {
    for (Map.Entry<String, Object> entry : store.entrySet()) {
      if ((entry.getValue() instanceof String)) {
        target.put((String)entry.getKey(), (String)entry.getValue(), true);
      } else if ((entry.getValue() instanceof byte[])) {
        target.putByteArray((String)entry.getKey(), (byte[])entry.getValue(), true);
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.commons.repositories.InMemoryCredentialsStore
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.commons.repositories;

import java.io.IOException;
import org.eclipse.equinox.security.storage.EncodingUtils;
import org.eclipse.equinox.security.storage.ISecurePreferences;
import org.eclipse.equinox.security.storage.SecurePreferencesFactory;
import org.eclipse.equinox.security.storage.StorageException;
import org.eclipse.mylyn.commons.repositories.auth.ICredentialsStore;

@Deprecated
public class SecureCredentialsStore
  implements ICredentialsStore
{
  private static final String ID_PLUGIN = "org.eclipse.mylyn.commons.repository";
  private final String url;
  
  public SecureCredentialsStore(String url)
  {
    this.url = url;
  }
  
  public void clear()
  {
    getSecurePreferences().removeNode();
  }
  
  public void flush()
    throws IOException
  {
    getSecurePreferences().flush();
  }
  
  public String get(String key, String def)
    throws StorageException
  {
    return getSecurePreferences().get(key, def);
  }
  
  public byte[] getByteArray(String key, byte[] def)
    throws StorageException
  {
    return getSecurePreferences().getByteArray(key, def);
  }
  
  private ISecurePreferences getSecurePreferences()
  {
    ISecurePreferences securePreferences = SecurePreferencesFactory.getDefault().node("org.eclipse.mylyn.commons.repository");
    securePreferences = securePreferences.node(EncodingUtils.encodeSlashes(getUrl()));
    return securePreferences;
  }
  
  public String getUrl()
  {
    return url;
  }
  
  public String[] keys()
  {
    return getSecurePreferences().keys();
  }
  
  public void put(String key, String value, boolean encrypt)
    throws StorageException
  {
    getSecurePreferences().put(key, value, encrypt);
  }
  
  public void putByteArray(String key, byte[] value, boolean encrypt)
    throws StorageException
  {
    getSecurePreferences().putByteArray(key, value, encrypt);
  }
  
  public void remove(String key)
  {
    getSecurePreferences().remove(key);
  }
  
  public void copyTo(ICredentialsStore target)
    throws StorageException
  {
    ISecurePreferences preferences = getSecurePreferences();
    String[] arrayOfString;
    int j = (arrayOfString = preferences.keys()).length;
    for (int i = 0; i < j; i++)
    {
      String key = arrayOfString[i];
      target.put(key, preferences.get(key, null), preferences.isEncrypted(key));
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.commons.repositories.SecureCredentialsStore
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.commons.repositories;

import java.net.Proxy;
import java.util.HashMap;
import java.util.Map;
import javax.net.ssl.X509TrustManager;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.mylyn.commons.net.IProxyProvider;
import org.eclipse.mylyn.commons.net.WebUtil;
import org.eclipse.mylyn.commons.repositories.ILocationService;
import org.eclipse.mylyn.commons.repositories.auth.AuthenticationCredentials;
import org.eclipse.mylyn.commons.repositories.auth.AuthenticationType;
import org.eclipse.mylyn.commons.repositories.auth.ICredentialsStore;
import org.eclipse.mylyn.commons.repositories.auth.UsernamePasswordCredentials;

@Deprecated
public class LocationService
  implements ILocationService
{
  public static final String ID_PLUGIN = "org.eclipse.mylyn.commons.repository";
  private static LocationService instance = new LocationService(null, null, new PlatformProxyProvider(null));
  private final Map<AuthenticationType, UsernamePasswordCredentials> credentialsByType;
  private final IProxyProvider proxyProvider;
  
  public static LocationService getDefault()
  {
    return instance;
  }
  
  private static class PlatformProxyProvider
    implements IProxyProvider
  {
    public Proxy getProxyForHost(String host, String proxyType)
    {
      return WebUtil.getProxy(host, proxyType);
    }
  }
  
  public LocationService(String username, String password, IProxyProvider proxyProvider)
  {
    credentialsByType = new HashMap();
    this.proxyProvider = proxyProvider;
    if ((username != null) && (password != null)) {
      setCredentials(AuthenticationType.REPOSITORY, username, password);
    }
  }
  
  public UsernamePasswordCredentials getCredentials(AuthenticationType authType)
  {
    return (UsernamePasswordCredentials)credentialsByType.get(authType);
  }
  
  public Proxy getProxyForHost(String host, String proxyType)
  {
    if (proxyProvider != null) {
      return proxyProvider.getProxyForHost(host, proxyType);
    }
    return null;
  }
  
  public void setCredentials(AuthenticationType authType, String username, String password)
  {
    credentialsByType.put(authType, new UsernamePasswordCredentials(username, password));
  }
  
  public X509TrustManager getTrustManager()
  {
    return null;
  }
  
  public <T extends AuthenticationCredentials> T requestCredentials(AuthenticationType type, Class<T> credentialsKind, String message, IProgressMonitor monitor)
  {
    throw new UnsupportedOperationException();
  }
  
  public ICredentialsStore getCredentialsStore(String id)
  {
    return new SecureCredentialsStore(id);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.commons.repositories.LocationService
 * Java Class Version: 5 (49.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