org.eclipse.team.core_3.6.0.I20110525-0800

16:47:54.279 INFO  jd.cli.Main - Decompiling org.eclipse.team.core_3.6.0.I20110525-0800.jar
package org.eclipse.team.core;

public final class DefaultRepositoryProviderType
  extends RepositoryProviderType
{}

/* Location:
 * Qualified Name:     org.eclipse.team.core.DefaultRepositoryProviderType
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.core;

public abstract interface ICache
{
  public abstract void put(String paramString, Object paramObject);
  
  public abstract Object get(String paramString);
  
  public abstract void remove(String paramString);
  
  public abstract void addCacheListener(ICacheListener paramICacheListener);
  
  public abstract void removeCacheListener(ICacheListener paramICacheListener);
  
  /**
   * @deprecated
   */
  public abstract void removeDisposeListener(ICacheListener paramICacheListener);
}

/* Location:
 * Qualified Name:     org.eclipse.team.core.ICache
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.core;

public abstract interface ICacheListener
{
  public abstract void cacheDisposed(ICache paramICache);
}

/* Location:
 * Qualified Name:     org.eclipse.team.core.ICacheListener
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.core;

import org.eclipse.core.resources.IStorage;

public abstract interface IFileContentManager
{
  public abstract int getType(IStorage paramIStorage);
  
  public abstract boolean isKnownFilename(String paramString);
  
  public abstract boolean isKnownExtension(String paramString);
  
  public abstract int getTypeForName(String paramString);
  
  public abstract int getTypeForExtension(String paramString);
  
  public abstract void addNameMappings(String[] paramArrayOfString, int[] paramArrayOfInt);
  
  public abstract void addExtensionMappings(String[] paramArrayOfString, int[] paramArrayOfInt);
  
  public abstract void setNameMappings(String[] paramArrayOfString, int[] paramArrayOfInt);
  
  public abstract void setExtensionMappings(String[] paramArrayOfString, int[] paramArrayOfInt);
  
  public abstract IStringMapping[] getNameMappings();
  
  public abstract IStringMapping[] getExtensionMappings();
  
  public abstract IStringMapping[] getDefaultNameMappings();
  
  public abstract IStringMapping[] getDefaultExtensionMappings();
}

/* Location:
 * Qualified Name:     org.eclipse.team.core.IFileContentManager
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.core;

/**
 * @deprecated
 */
public abstract interface IFileTypeInfo
{
  public abstract String getExtension();
  
  public abstract int getType();
}

/* Location:
 * Qualified Name:     org.eclipse.team.core.IFileTypeInfo
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.core;

public abstract interface IIgnoreInfo
{
  public abstract String getPattern();
  
  public abstract boolean getEnabled();
}

/* Location:
 * Qualified Name:     org.eclipse.team.core.IIgnoreInfo
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.core;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IProgressMonitor;

/**
 * @deprecated
 */
public abstract interface IProjectSetSerializer
{
  public abstract String[] asReference(IProject[] paramArrayOfIProject, Object paramObject, IProgressMonitor paramIProgressMonitor)
    throws TeamException;
  
  public abstract IProject[] addToWorkspace(String[] paramArrayOfString, String paramString, Object paramObject, IProgressMonitor paramIProgressMonitor)
    throws TeamException;
}

/* Location:
 * Qualified Name:     org.eclipse.team.core.IProjectSetSerializer
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.core;

public abstract interface IStringMapping
{
  public abstract String getString();
  
  public abstract int getType();
}

/* Location:
 * Qualified Name:     org.eclipse.team.core.IStringMapping
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.core;

import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IStatus;

public abstract interface ITeamStatus
  extends IStatus
{
  public static final int RESOURCE_SYNC_INFO_ERROR = 1;
  public static final int SYNC_INFO_SET_ERROR = 2;
  public static final int SYNC_INFO_SET_CANCELLATION = 3;
  public static final int READ_ONLY_LOCAL = 279;
  
  public abstract IResource getResource();
}

/* Location:
 * Qualified Name:     org.eclipse.team.core.ITeamStatus
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.core;

import java.io.File;
import java.net.URI;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.internal.core.Messages;

public abstract class ProjectSetCapability
{
  public static final String SCHEME_SCM = "scm";
  private IProjectSetSerializer serializer;
  
  public static void ensureBackwardsCompatible(RepositoryProviderType type, ProjectSetCapability capability)
  {
    if (capability != null)
    {
      IProjectSetSerializer oldSerializer = Team.getProjectSetSerializer(type.getID());
      if (oldSerializer != null) {
        capability.setSerializer(oldSerializer);
      }
    }
  }
  
  /**
   * @deprecated
   */
  public void projectSetCreated(File file, Object context, IProgressMonitor monitor) {}
  
  public void projectSetCreated(File file, ProjectSetSerializationContext context, IProgressMonitor monitor)
  {
    projectSetCreated(file, context.getShell(), monitor);
  }
  
  public String[] asReference(IProject[] providerProjects, ProjectSetSerializationContext context, IProgressMonitor monitor)
    throws TeamException
  {
    if (serializer != null) {
      return serializer.asReference(providerProjects, context.getShell(), monitor);
    }
    throw new TeamException(Messages.ProjectSetCapability_0);
  }
  
  public IProject[] addToWorkspace(String[] referenceStrings, ProjectSetSerializationContext context, IProgressMonitor monitor)
    throws TeamException
  {
    if (serializer != null) {
      return serializer.addToWorkspace(referenceStrings, context.getFilename(), context.getShell(), monitor);
    }
    throw new TeamException(Messages.ProjectSetCapability_1);
  }
  
  protected IProject[] confirmOverwrite(ProjectSetSerializationContext context, IProject[] projects)
    throws TeamException
  {
    Collection existingProjects = new ArrayList();
    for (int i = 0; i < projects.length; i++)
    {
      IProject eachProj = projects[i];
      if (eachProj.exists()) {
        existingProjects.add(eachProj);
      } else if (new File(eachProj.getParent().getLocation().toFile(), eachProj.getName()).exists()) {
        existingProjects.add(eachProj);
      }
    }
    if (existingProjects.size() == 0) {
      return projects;
    }
    IProject[] confirmed = 
      context.confirmOverwrite(
      (IProject[])existingProjects.toArray(
      new IProject[existingProjects.size()]));
    if (confirmed == null) {
      return null;
    }
    if (existingProjects.size() == confirmed.length) {
      return projects;
    }
    Collection result = new ArrayList(projects.length);
    result.addAll(Arrays.asList(projects));
    result.removeAll(existingProjects);
    for (int i = 0; i < confirmed.length; i++)
    {
      IProject eachProj = confirmed[i];
      if (existingProjects.contains(eachProj)) {
        result.add(eachProj);
      }
    }
    return (IProject[])result.toArray(new IProject[result.size()]);
  }
  
  void setSerializer(IProjectSetSerializer serializer)
  {
    this.serializer = serializer;
  }
  
  public URI getURI(String referenceString)
  {
    return null;
  }
  
  public String getProject(String referenceString)
  {
    return null;
  }
  
  public String asReference(URI uri, String projectName)
  {
    return null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.core.ProjectSetCapability
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.core;

import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.resources.IProject;

public class ProjectSetSerializationContext
{
  private final String filename;
  private final Map properties = new HashMap();
  
  public ProjectSetSerializationContext()
  {
    this(null);
  }
  
  public ProjectSetSerializationContext(String filename)
  {
    this.filename = filename;
  }
  
  public IProject[] confirmOverwrite(IProject[] projects)
    throws TeamException
  {
    return new IProject[0];
  }
  
  public Object getShell()
  {
    return null;
  }
  
  public String getFilename()
  {
    return filename;
  }
  
  public void setProperty(String key, Object value)
  {
    properties.put(key, value);
  }
  
  public Object getProperty(String key)
  {
    return properties.get(key);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.core.ProjectSetSerializationContext
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.core;

import java.net.URI;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceProxy;
import org.eclipse.core.resources.IResourceProxyVisitor;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Status;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.internal.core.Messages;

class RepositoryProvider$1
  implements IResourceProxyVisitor
{
  private final RepositoryProvider val$provider;
  private final IProject val$project;
  private final String val$id;
  
  RepositoryProvider$1(RepositoryProvider paramRepositoryProvider, IProject paramIProject, String paramString)
  {
    val$provider = paramRepositoryProvider;val$project = paramIProject;val$id = paramString;
  }
  
  public boolean visit(IResourceProxy proxy)
    throws CoreException
  {
    if ((proxy.isLinked()) && (
      (!val$provider.canHandleLinkedResources()) || 
      (proxy.requestFullPath().segmentCount() > 2) || 
      (!"file".equals(proxy.requestResource().getLocationURI().getScheme())))) {
      throw new TeamException(new Status(4, "org.eclipse.team.core", 378, NLS.bind(Messages.RepositoryProvider_linkedURIsExist, new String[] { val$project.getName(), val$id }), null));
    }
    return true;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.core.RepositoryProvider.1
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.core;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFileModificationValidator;
import org.eclipse.core.resources.team.FileModificationValidationContext;
import org.eclipse.core.resources.team.FileModificationValidator;
import org.eclipse.core.runtime.IStatus;

class RepositoryProvider$2
  extends FileModificationValidator
{
  final RepositoryProvider this$0;
  private final IFileModificationValidator val$fileModificationValidator;
  
  RepositoryProvider$2(RepositoryProvider paramRepositoryProvider, IFileModificationValidator paramIFileModificationValidator)
  {
    this$0 = paramRepositoryProvider;val$fileModificationValidator = paramIFileModificationValidator;
  }
  
  public IStatus validateSave(IFile file)
  {
    return val$fileModificationValidator.validateSave(file);
  }
  
  public IStatus validateEdit(IFile[] files, FileModificationValidationContext context)
  {
    Object shell;
    Object shell;
    if (context == null) {
      shell = null;
    } else {
      shell = context.getShell();
    }
    return val$fileModificationValidator.validateEdit(files, shell);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.core.RepositoryProvider.2
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.core;

import java.net.URI;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.eclipse.core.filesystem.URIUtil;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFileModificationValidator;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.IProjectNature;
import org.eclipse.core.resources.IProjectNatureDescriptor;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceProxy;
import org.eclipse.core.resources.IResourceProxyVisitor;
import org.eclipse.core.resources.IResourceRuleFactory;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.resources.team.FileModificationValidationContext;
import org.eclipse.core.resources.team.FileModificationValidator;
import org.eclipse.core.resources.team.IMoveDeleteHook;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.IJobManager;
import org.eclipse.core.runtime.jobs.ILock;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.core.history.IFileHistoryProvider;
import org.eclipse.team.core.subscribers.Subscriber;
import org.eclipse.team.internal.core.Messages;
import org.eclipse.team.internal.core.PessimisticResourceRuleFactory;
import org.eclipse.team.internal.core.RepositoryProviderManager;
import org.eclipse.team.internal.core.TeamHookDispatcher;
import org.eclipse.team.internal.core.TeamPlugin;

public abstract class RepositoryProvider
  implements IProjectNature, IAdaptable
{
  private static final String TEAM_SETID = "org.eclipse.team.repository-provider";
  private static final List AllProviderTypeIds = ;
  private IProject project;
  private static final ILock mappingLock = Job.getJobManager().newLock();
  private static final Object NOT_MAPPED = new Object();
  
  public static void map(IProject project, String id)
    throws TeamException
  {
    ISchedulingRule rule = ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(project);
    try
    {
      Job.getJobManager().beginRule(rule, null);
      try
      {
        mappingLock.acquire();
        RepositoryProvider existingProvider = null;
        if (project.getPersistentProperty(TeamPlugin.PROVIDER_PROP_KEY) != null) {
          existingProvider = getProvider(project);
        }
        if (existingProvider != null)
        {
          if (existingProvider.getID().equals(id))
          {
            mappingLock.release();return;
          }
          unmap(project);
        }
        RepositoryProvider provider = mapNewProvider(project, id);
        try
        {
          project.setPersistentProperty(TeamPlugin.PROVIDER_PROP_KEY, id);
        }
        catch (CoreException outer)
        {
          try
          {
            project.setSessionProperty(TeamPlugin.PROVIDER_PROP_KEY, null);
          }
          catch (CoreException inner)
          {
            TeamPlugin.log(4, NLS.bind(Messages.RepositoryProvider_couldNotClearAfterError, new String[] { project.getName(), id }), inner);
          }
          throw outer;
        }
        provider.configure();
        
        project.touch(null);
        
        TeamHookDispatcher.setProviderRuleFactory(project, provider.getRuleFactory());
        
        RepositoryProviderManager.getInstance().providerMapped(provider);
      }
      finally
      {
        mappingLock.release();
      }
      mappingLock.release();
    }
    catch (CoreException e)
    {
      throw TeamPlugin.wrapException(e);
    }
    finally
    {
      Job.getJobManager().endRule(rule);
    }
    Job.getJobManager().endRule(rule);
  }
  
  private static RepositoryProvider mapNewProvider(IProject project, String id)
    throws TeamException
  {
    RepositoryProvider provider = newProvider(id);
    if (provider == null) {
      throw new TeamException(NLS.bind(Messages.RepositoryProvider_couldNotInstantiateProvider, new String[] { project.getName(), id }));
    }
    if (!provider.canHandleLinkedResourceURI()) {
      try
      {
        project.accept(new IResourceProxyVisitor()
        {
          private final IProject val$project;
          private final String val$id;
          
          public boolean visit(IResourceProxy proxy)
            throws CoreException
          {
            if ((proxy.isLinked()) && (
              (!canHandleLinkedResources()) || 
              (proxy.requestFullPath().segmentCount() > 2) || 
              (!"file".equals(proxy.requestResource().getLocationURI().getScheme())))) {
              throw new TeamException(new Status(4, "org.eclipse.team.core", 378, NLS.bind(Messages.RepositoryProvider_linkedURIsExist, new String[] { val$project.getName(), val$id }), null));
            }
            return true;
          }
        }, 0);
      }
      catch (CoreException e)
      {
        if ((e instanceof TeamException))
        {
          TeamException te = (TeamException)e;
          throw te;
        }
        throw new TeamException(e);
      }
    }
    if (!provider.canHandleLinkedResources()) {
      try
      {
        IResource[] members = project.members();
        for (int i = 0; i < members.length; i++)
        {
          IResource resource = members[i];
          if (resource.isLinked()) {
            throw new TeamException(new Status(4, "org.eclipse.team.core", 378, NLS.bind(Messages.RepositoryProvider_linkedResourcesExist, new String[] { project.getName(), id }), null));
          }
        }
      }
      catch (CoreException e)
      {
        throw TeamPlugin.wrapException(e);
      }
    }
    try
    {
      project.setSessionProperty(TeamPlugin.PROVIDER_PROP_KEY, provider);
      provider.setProject(project);
    }
    catch (CoreException e)
    {
      throw TeamPlugin.wrapException(e);
    }
    return provider;
  }
  
  private static RepositoryProvider mapExistingProvider(IProject project, String id)
    throws TeamException
  {
    try
    {
      mappingLock.acquire();
      RepositoryProvider localRepositoryProvider;
      try
      {
        String currentId = project.getPersistentProperty(TeamPlugin.PROVIDER_PROP_KEY);
        if (currentId == null) {
          return null;
        }
        if (!currentId.equals(id)) {
          return lookupProviderProp(project);
        }
      }
      catch (CoreException e)
      {
        throw TeamPlugin.wrapException(e);
      }
      return mapNewProvider(project, id);
    }
    finally
    {
      mappingLock.release();
    }
  }
  
  /* Error */
  public static void unmap(IProject project)
    throws TeamException
  {
    // Byte code:
    //   0: invokestatic 460	org/eclipse/core/resources/ResourcesPlugin:getWorkspace	()Lorg/eclipse/core/resources/IWorkspace;
    //   3: invokeinterface 529 1 0
    //   8: aload_0
    //   9: invokeinterface 527 2 0
    //   14: astore_1
    //   15: invokestatic 465	org/eclipse/core/runtime/jobs/Job:getJobManager	()Lorg/eclipse/core/runtime/jobs/IJobManager;
    //   18: aload_1
    //   19: aconst_null
    //   20: invokeinterface 540 3 0
    //   25: getstatic 438	org/eclipse/team/core/RepositoryProvider:mappingLock	Lorg/eclipse/core/runtime/jobs/ILock;
    //   28: invokeinterface 541 1 0
    //   33: aload_0
    //   34: getstatic 449	org/eclipse/team/internal/core/TeamPlugin:PROVIDER_PROP_KEY	Lorg/eclipse/core/runtime/QualifiedName;
    //   37: invokeinterface 519 2 0
    //   42: astore_2
    //   43: aload_2
    //   44: ifnonnull +30 -> 74
    //   47: new 236	org/eclipse/team/core/TeamException
    //   50: dup
    //   51: getstatic 441	org/eclipse/team/internal/core/Messages:RepositoryProvider_No_Provider_Registered	Ljava/lang/String;
    //   54: iconst_1
    //   55: anewarray 201	java/lang/String
    //   58: dup
    //   59: iconst_0
    //   60: aload_0
    //   61: invokeinterface 512 1 0
    //   66: aastore
    //   67: invokestatic 466	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
    //   70: invokespecial 494	org/eclipse/team/core/TeamException:<init>	(Ljava/lang/String;)V
    //   73: athrow
    //   74: aload_0
    //   75: invokestatic 484	org/eclipse/team/core/RepositoryProvider:getProvider	(Lorg/eclipse/core/resources/IProject;)Lorg/eclipse/team/core/RepositoryProvider;
    //   78: astore_3
    //   79: aload_3
    //   80: ifnonnull +31 -> 111
    //   83: iconst_4
    //   84: getstatic 443	org/eclipse/team/internal/core/Messages:RepositoryProvider_couldNotInstantiateProvider	Ljava/lang/String;
    //   87: iconst_2
    //   88: anewarray 201	java/lang/String
    //   91: dup
    //   92: iconst_0
    //   93: aload_0
    //   94: invokeinterface 512 1 0
    //   99: aastore
    //   100: dup
    //   101: iconst_1
    //   102: aload_2
    //   103: aastore
    //   104: invokestatic 466	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
    //   107: aconst_null
    //   108: invokestatic 504	org/eclipse/team/internal/core/TeamPlugin:log	(ILjava/lang/String;Ljava/lang/Throwable;)V
    //   111: aload_3
    //   112: ifnull +7 -> 119
    //   115: aload_3
    //   116: invokevirtual 469	org/eclipse/team/core/RepositoryProvider:deconfigure	()V
    //   119: aload_0
    //   120: getstatic 449	org/eclipse/team/internal/core/TeamPlugin:PROVIDER_PROP_KEY	Lorg/eclipse/core/runtime/QualifiedName;
    //   123: aconst_null
    //   124: invokeinterface 518 3 0
    //   129: aload_0
    //   130: getstatic 449	org/eclipse/team/internal/core/TeamPlugin:PROVIDER_PROP_KEY	Lorg/eclipse/core/runtime/QualifiedName;
    //   133: aconst_null
    //   134: invokeinterface 520 3 0
    //   139: aload_3
    //   140: ifnull +7 -> 147
    //   143: aload_3
    //   144: invokevirtual 470	org/eclipse/team/core/RepositoryProvider:deconfigured	()V
    //   147: aload_0
    //   148: aconst_null
    //   149: invokeinterface 516 2 0
    //   154: aload_0
    //   155: aconst_null
    //   156: invokestatic 501	org/eclipse/team/internal/core/TeamHookDispatcher:setProviderRuleFactory	(Lorg/eclipse/core/resources/IProject;Lorg/eclipse/core/resources/IResourceRuleFactory;)V
    //   159: invokestatic 500	org/eclipse/team/internal/core/RepositoryProviderManager:getInstance	()Lorg/eclipse/team/internal/core/RepositoryProviderManager;
    //   162: aload_0
    //   163: invokevirtual 498	org/eclipse/team/internal/core/RepositoryProviderManager:providerUnmapped	(Lorg/eclipse/core/resources/IProject;)V
    //   166: goto +16 -> 182
    //   169: astore 4
    //   171: getstatic 438	org/eclipse/team/core/RepositoryProvider:mappingLock	Lorg/eclipse/core/runtime/jobs/ILock;
    //   174: invokeinterface 542 1 0
    //   179: aload 4
    //   181: athrow
    //   182: getstatic 438	org/eclipse/team/core/RepositoryProvider:mappingLock	Lorg/eclipse/core/runtime/jobs/ILock;
    //   185: invokeinterface 542 1 0
    //   190: goto +23 -> 213
    //   193: astore_2
    //   194: aload_2
    //   195: invokestatic 505	org/eclipse/team/internal/core/TeamPlugin:wrapException	(Lorg/eclipse/core/runtime/CoreException;)Lorg/eclipse/team/core/TeamException;
    //   198: athrow
    //   199: astore 5
    //   201: invokestatic 465	org/eclipse/core/runtime/jobs/Job:getJobManager	()Lorg/eclipse/core/runtime/jobs/IJobManager;
    //   204: aload_1
    //   205: invokeinterface 539 2 0
    //   210: aload 5
    //   212: athrow
    //   213: invokestatic 465	org/eclipse/core/runtime/jobs/Job:getJobManager	()Lorg/eclipse/core/runtime/jobs/IJobManager;
    //   216: aload_1
    //   217: invokeinterface 539 2 0
    //   222: return
    // Line number table:
    //   Java source line #246	-> byte code offset #0
    //   Java source line #249	-> byte code offset #15
    //   Java source line #251	-> byte code offset #25
    //   Java source line #252	-> byte code offset #33
    //   Java source line #255	-> byte code offset #43
    //   Java source line #256	-> byte code offset #47
    //   Java source line #261	-> byte code offset #74
    //   Java source line #262	-> byte code offset #79
    //   Java source line #266	-> byte code offset #83
    //   Java source line #269	-> byte code offset #111
    //   Java source line #271	-> byte code offset #119
    //   Java source line #272	-> byte code offset #129
    //   Java source line #274	-> byte code offset #139
    //   Java source line #277	-> byte code offset #147
    //   Java source line #281	-> byte code offset #154
    //   Java source line #284	-> byte code offset #159
    //   Java source line #285	-> byte code offset #169
    //   Java source line #286	-> byte code offset #171
    //   Java source line #287	-> byte code offset #179
    //   Java source line #286	-> byte code offset #182
    //   Java source line #288	-> byte code offset #193
    //   Java source line #289	-> byte code offset #194
    //   Java source line #290	-> byte code offset #199
    //   Java source line #291	-> byte code offset #201
    //   Java source line #292	-> byte code offset #210
    //   Java source line #291	-> byte code offset #213
    //   Java source line #293	-> byte code offset #222
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	223	0	project	IProject
    //   14	203	1	rule	ISchedulingRule
    //   42	61	2	id	String
    //   193	2	2	e	CoreException
    //   78	66	3	provider	RepositoryProvider
    //   169	11	4	localObject1	Object
    //   199	12	5	localObject2	Object
    // Exception table:
    //   from	to	target	type
    //   25	169	169	finally
    //   15	190	193	org/eclipse/core/runtime/CoreException
    //   15	199	199	finally
  }
  
  private static RepositoryProvider lookupProviderProp(IProject project)
    throws CoreException
  {
    Object provider = project.getSessionProperty(TeamPlugin.PROVIDER_PROP_KEY);
    if ((provider instanceof RepositoryProvider)) {
      return (RepositoryProvider)provider;
    }
    return null;
  }
  
  public abstract void configureProject()
    throws CoreException;
  
  public final void configure()
    throws CoreException
  {
    try
    {
      configureProject();
    }
    catch (CoreException e)
    {
      try
      {
        unmap(getProject());
      }
      catch (TeamException e2)
      {
        throw new CoreException(new Status(4, "org.eclipse.team.core", 0, Messages.RepositoryProvider_Error_removing_nature_from_project___1 + getID(), e2));
      }
      throw e;
    }
  }
  
  protected void deconfigured() {}
  
  public abstract String getID();
  
  /**
   * @deprecated
   */
  public IFileModificationValidator getFileModificationValidator()
  {
    return null;
  }
  
  public FileModificationValidator getFileModificationValidator2()
  {
    IFileModificationValidator fileModificationValidator = getFileModificationValidator();
    if (fileModificationValidator == null) {
      return null;
    }
    new FileModificationValidator()
    {
      private final IFileModificationValidator val$fileModificationValidator;
      
      public IStatus validateSave(IFile file)
      {
        return val$fileModificationValidator.validateSave(file);
      }
      
      public IStatus validateEdit(IFile[] files, FileModificationValidationContext context)
      {
        Object shell;
        Object shell;
        if (context == null) {
          shell = null;
        } else {
          shell = context.getShell();
        }
        return val$fileModificationValidator.validateEdit(files, shell);
      }
    };
  }
  
  public IFileHistoryProvider getFileHistoryProvider()
  {
    return null;
  }
  
  public IMoveDeleteHook getMoveDeleteHook()
  {
    return null;
  }
  
  public String toString()
  {
    return NLS.bind(Messages.RepositoryProvider_toString, new String[] { getProject().getName(), getID() });
  }
  
  public static final String[] getAllProviderTypeIds()
  {
    IProjectNatureDescriptor[] desc = ResourcesPlugin.getWorkspace().getNatureDescriptors();
    Set teamSet = new HashSet();
    
    teamSet.addAll(AllProviderTypeIds);
    for (int i = 0; i < desc.length; i++)
    {
      String[] setIds = desc[i].getNatureSetIds();
      for (int j = 0; j < setIds.length; j++) {
        if (setIds[j].equals("org.eclipse.team.repository-provider")) {
          teamSet.add(desc[i].getNatureId());
        }
      }
    }
    return (String[])teamSet.toArray(new String[teamSet.size()]);
  }
  
  public static final RepositoryProvider getProvider(IProject project)
  {
    try
    {
      if (project.isAccessible())
      {
        RepositoryProvider provider = lookupProviderProp(project);
        if (provider != null) {
          return provider;
        }
        if (isMarkedAsUnshared(project)) {
          return null;
        }
        String id = project.getPersistentProperty(TeamPlugin.PROVIDER_PROP_KEY);
        if (id != null) {
          return mapExistingProvider(project, id);
        }
        IProjectDescription projectDesc = project.getDescription();
        String[] natureIds = projectDesc.getNatureIds();
        IWorkspace workspace = ResourcesPlugin.getWorkspace();
        for (int i = 0; i < natureIds.length; i++)
        {
          IProjectNatureDescriptor desc = workspace.getNatureDescriptor(natureIds[i]);
          if (desc != null)
          {
            String[] setIds = desc.getNatureSetIds();
            for (int j = 0; j < setIds.length; j++) {
              if (setIds[j].equals("org.eclipse.team.repository-provider")) {
                return getProvider(project, natureIds[i]);
              }
            }
          }
        }
      }
    }
    catch (CoreException e)
    {
      if (!isAcceptableException(e)) {
        TeamPlugin.log(e);
      }
    }
    markAsUnshared(project);
    return null;
  }
  
  private static boolean isAcceptableException(CoreException e)
  {
    return e.getStatus().getCode() == 368;
  }
  
  public static final RepositoryProvider getProvider(IProject project, String id)
  {
    try
    {
      if (project.isAccessible())
      {
        RepositoryProvider provider = lookupProviderProp(project);
        if (provider != null)
        {
          if (provider.getID().equals(id)) {
            return provider;
          }
          return null;
        }
        if (isMarkedAsUnshared(project)) {
          return null;
        }
        String existingID = project.getPersistentProperty(TeamPlugin.PROVIDER_PROP_KEY);
        if (id.equals(existingID))
        {
          RepositoryProvider newProvider = mapExistingProvider(project, id);
          if ((newProvider != null) && (newProvider.getID().equals(id))) {
            return newProvider;
          }
          return null;
        }
        IProjectNatureDescriptor desc = ResourcesPlugin.getWorkspace().getNatureDescriptor(id);
        if (desc == null) {
          return null;
        }
        String[] setIds = desc.getNatureSetIds();
        for (int i = 0; i < setIds.length; i++) {
          if (setIds[i].equals("org.eclipse.team.repository-provider")) {
            return (RepositoryProvider)project.getNature(id);
          }
        }
      }
    }
    catch (CoreException e)
    {
      if (!isAcceptableException(e)) {
        TeamPlugin.log(e);
      }
    }
    markAsUnshared(project);
    return null;
  }
  
  public static boolean isShared(IProject project)
  {
    if (!project.isAccessible()) {
      return false;
    }
    try
    {
      if (lookupProviderProp(project) != null) {
        return true;
      }
      if (isMarkedAsUnshared(project)) {
        return false;
      }
      boolean shared = project.getPersistentProperty(TeamPlugin.PROVIDER_PROP_KEY) != null;
      if (!shared) {
        markAsUnshared(project);
      }
      return shared;
    }
    catch (CoreException e)
    {
      TeamPlugin.log(e);
    }
    return false;
  }
  
  private static boolean isMarkedAsUnshared(IProject project)
  {
    try
    {
      return project.getSessionProperty(TeamPlugin.PROVIDER_PROP_KEY) == NOT_MAPPED;
    }
    catch (CoreException localCoreException) {}
    return false;
  }
  
  private static void markAsUnshared(IProject project)
  {
    try
    {
      project.setSessionProperty(TeamPlugin.PROVIDER_PROP_KEY, NOT_MAPPED);
    }
    catch (CoreException localCoreException) {}
  }
  
  public IProject getProject()
  {
    return project;
  }
  
  public void setProject(IProject project)
  {
    this.project = project;
  }
  
  private static List initializeAllProviderTypes()
  {
    List allIDs = new ArrayList();
    
    TeamPlugin plugin = TeamPlugin.getPlugin();
    if (plugin != null)
    {
      IExtensionPoint extension = Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.team.core", "repository");
      if (extension != null)
      {
        IExtension[] extensions = extension.getExtensions();
        for (int i = 0; i < extensions.length; i++)
        {
          IConfigurationElement[] configElements = extensions[i].getConfigurationElements();
          for (int j = 0; j < configElements.length; j++)
          {
            String extensionId = configElements[j].getAttribute("id");
            allIDs.add(extensionId);
          }
        }
      }
    }
    return allIDs;
  }
  
  private static RepositoryProvider newProvider(String id)
  {
    TeamPlugin plugin = TeamPlugin.getPlugin();
    if (plugin != null)
    {
      IExtensionPoint extension = Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.team.core", "repository");
      if (extension != null)
      {
        IExtension[] extensions = extension.getExtensions();
        for (int i = 0; i < extensions.length; i++)
        {
          IConfigurationElement[] configElements = extensions[i].getConfigurationElements();
          for (int j = 0; j < configElements.length; j++)
          {
            String extensionId = configElements[j].getAttribute("id");
            if ((extensionId != null) && (extensionId.equals(id)))
            {
              try
              {
                return (RepositoryProvider)configElements[j].createExecutableExtension("class");
              }
              catch (CoreException e)
              {
                TeamPlugin.log(e);
              }
              catch (ClassCastException e)
              {
                String className = configElements[j].getAttribute("class");
                TeamPlugin.log(4, NLS.bind(Messages.RepositoryProvider_invalidClass, new String[] { id, className }), e);
              }
              return null;
            }
          }
        }
      }
    }
    return null;
  }
  
  /**
   * @deprecated
   */
  public IStatus validateCreateLink(IResource resource, int updateFlags, IPath location)
  {
    if (canHandleLinkedResources()) {
      return Team.OK_STATUS;
    }
    return new Status(4, "org.eclipse.team.core", 378, NLS.bind(Messages.RepositoryProvider_linkedResourcesNotSupported, new String[] { getProject().getName(), getID() }), null);
  }
  
  public IStatus validateCreateLink(IResource resource, int updateFlags, URI location)
  {
    if ((resource.getProjectRelativePath().segmentCount() == 1) && ("file".equals(location.getScheme()))) {
      return validateCreateLink(resource, updateFlags, URIUtil.toPath(location));
    }
    if (canHandleLinkedResourceURI()) {
      return Team.OK_STATUS;
    }
    return new Status(4, "org.eclipse.team.core", 378, NLS.bind(Messages.RepositoryProvider_linkedURIsNotSupported, new String[] { getProject().getName(), getID() }), null);
  }
  
  /**
   * @deprecated
   */
  public boolean canHandleLinkedResources()
  {
    return canHandleLinkedResourceURI();
  }
  
  public boolean canHandleLinkedResourceURI()
  {
    return false;
  }
  
  public Object getAdapter(Class adapter)
  {
    return null;
  }
  
  public IResourceRuleFactory getRuleFactory()
  {
    return new PessimisticResourceRuleFactory();
  }
  
  public final Subscriber getSubscriber()
  {
    RepositoryProviderType type = RepositoryProviderType.getProviderType(getID());
    if (type != null) {
      return type.getSubscriber();
    }
    return null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.core.RepositoryProvider
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.core;

import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.PlatformObject;
import org.eclipse.team.core.subscribers.Subscriber;
import org.eclipse.team.internal.core.DefaultProjectSetCapability;
import org.eclipse.team.internal.core.TeamPlugin;

public abstract class RepositoryProviderType
  extends PlatformObject
{
  private static Map allProviderTypes = new HashMap();
  private String id;
  private String scheme;
  
  public static RepositoryProviderType getProviderType(String id)
  {
    RepositoryProviderType type = (RepositoryProviderType)allProviderTypes.get(id);
    if (type != null) {
      return type;
    }
    return newProviderType(id);
  }
  
  public static RepositoryProviderType getTypeForScheme(String scheme)
  {
    for (Iterator iter = allProviderTypes.values().iterator(); iter.hasNext();)
    {
      RepositoryProviderType type = (RepositoryProviderType)iter.next();
      if ((type.getFileSystemScheme() != null) && (type.getFileSystemScheme().equals(scheme))) {
        return type;
      }
    }
    return findProviderForScheme(scheme);
  }
  
  private static RepositoryProviderType findProviderForScheme(String scheme)
  {
    IExtensionPoint extension = Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.team.core", "repository");
    if (extension != null)
    {
      IExtension[] extensions = extension.getExtensions();
      for (int i = 0; i < extensions.length; i++)
      {
        IConfigurationElement[] configElements = extensions[i].getConfigurationElements();
        for (int j = 0; j < configElements.length; j++)
        {
          String extensionId = configElements[j].getAttribute("id");
          String typeScheme = configElements[j].getAttribute("fileSystemScheme");
          if ((typeScheme != null) && (typeScheme.equals(scheme)) && (extensionId != null)) {
            return newProviderType(extensionId);
          }
        }
      }
    }
    return null;
  }
  
  private void setID(String id)
  {
    this.id = id;
  }
  
  private static RepositoryProviderType newProviderType(String id)
  {
    IExtensionPoint extension = Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.team.core", "repository");
    if (extension != null)
    {
      IExtension[] extensions = extension.getExtensions();
      for (int i = 0; i < extensions.length; i++)
      {
        IConfigurationElement[] configElements = extensions[i].getConfigurationElements();
        for (int j = 0; j < configElements.length; j++)
        {
          Stri
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

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