org.eclipse.team.cvs.core_3.3.400.I20110510-0800

 private String asReference(IProject project)
    throws TeamException
  {
    CVSTeamProvider provider = (CVSTeamProvider)RepositoryProvider.getProvider(project);
    CVSWorkspaceRoot root = provider.getCVSWorkspaceRoot();
    CVSRepositoryLocation location = CVSRepositoryLocation.fromString(root.getRemoteLocation().getLocation(false));
    location.setUserMuteable(true);
    ICVSFolder folder = root.getLocalRoot();
    return asReference(location, folder, project);
  }
  
  private String asReference(CVSRepositoryLocation location, ICVSFolder folder, IProject project)
    throws TeamException
  {
    StringBuffer buffer = new StringBuffer();
    buffer.append("1.0,");
    
    String repoLocation = location.getLocation();
    buffer.append(repoLocation);
    buffer.append(",");
    
    FolderSyncInfo syncInfo = folder.getFolderSyncInfo();
    String module = syncInfo.getRepository();
    buffer.append(module);
    buffer.append(",");
    
    String projectName = project.getName();
    buffer.append(projectName);
    CVSTag tag = syncInfo.getTag();
    if ((tag != null) && 
      (tag.getType() != 3))
    {
      buffer.append(",");
      String tagName = tag.getName();
      buffer.append(tagName);
    }
    return buffer.toString();
  }
  
  public IProject[] addToWorkspace(String[] referenceStrings, ProjectSetSerializationContext context, IProgressMonitor monitor)
    throws TeamException
  {
    monitor = Policy.monitorFor(monitor);
    Policy.checkCanceled(monitor);
    
    Map infoMap = new HashMap(referenceStrings.length);
    IProject[] projects = asProjects(referenceStrings, infoMap);
    
    projects = confirmOverwrite(context, projects);
    if ((projects == null) || (projects.length == 0)) {
      return new IProject[0];
    }
    Map suggestedRepositoryLocations = 
      CVSRepositoryLocationMatcher.prepareSuggestedRepositoryLocations(projects, infoMap);
    applySinglePerfectMatchesToInfoMap(suggestedRepositoryLocations, infoMap);
    if (CVSRepositoryLocationMatcher.isPromptRequired(suggestedRepositoryLocations))
    {
      Map userSelectedRepositoryLocations = promptForAdditionRepositoryInformation(suggestedRepositoryLocations);
      if (userSelectedRepositoryLocations != null) {
        applyUserSelectionToInfoMap(userSelectedRepositoryLocations, infoMap);
      } else {
        return new IProject[0];
      }
    }
    return checkout(projects, infoMap, monitor);
  }
  
  private void applySinglePerfectMatchesToInfoMap(Map suggestedRepositoryLocations, Map infoMap)
    throws CVSException
  {
    for (Iterator i = infoMap.values().iterator(); i.hasNext();)
    {
      LoadInfo loadInfoForProject = (LoadInfo)i.next();
      ICVSRepositoryLocation key = repositoryLocation;
      List suggestedList = (List)suggestedRepositoryLocations.get(key);
      if ((suggestedList != null) && 
        (suggestedList.size() == 1) && 
        (CVSRepositoryLocationMatcher.isMatching(
        (ICVSRepositoryLocation)suggestedList.get(0), 
        repositoryLocation)))
      {
        repositoryLocation = getRepositoryLocationFromString(
          repositoryLocation.getLocation(true), 
          true, false);
        
        suggestedRepositoryLocations.remove(key);
      }
    }
  }
  
  private void applyUserSelectionToInfoMap(Map userSelectedRepositoryLocations, Map infoMap)
    throws CVSException
  {
    for (Iterator i = infoMap.values().iterator(); i.hasNext();)
    {
      LoadInfo loadInfoForProject = (LoadInfo)i.next();
      ICVSRepositoryLocation userSelectedRepository = (ICVSRepositoryLocation)userSelectedRepositoryLocations
        .get(repositoryLocation);
      if (userSelectedRepository != null) {
        repositoryLocation = userSelectedRepository;
      }
    }
  }
  
  public static IProject[] asProjects(String[] referenceStrings, Map infoMap)
    throws CVSException
  {
    Collection result = new ArrayList();
    for (int i = 0; i < referenceStrings.length; i++)
    {
      StringTokenizer tokenizer = new StringTokenizer(referenceStrings[i], ",");
      String version = tokenizer.nextToken();
      if (version.equals("1.0"))
      {
        LoadInfo info = new LoadInfo(tokenizer, false, false);
        IProject proj = info.getProject();
        result.add(proj);
        infoMap.put(proj, info);
      }
    }
    return (IProject[])result.toArray(new IProject[result.size()]);
  }
  
  private IProject[] checkout(IProject[] projects, Map infoMap, IProgressMonitor monitor)
    throws TeamException
  {
    List result = new ArrayList();
    try
    {
      ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable()
      {
        private final IProject[] val$projects;
        private final Map val$infoMap;
        private final List val$result;
        
        /* Error */
        public void run(IProgressMonitor monitor)
          throws CoreException
        {
          // Byte code:
          //   0: aload_1
          //   1: ldc 1
          //   3: sipush 1000
          //   6: aload_0
          //   7: getfield 73	org/eclipse/team/internal/ccvs/core/CVSProjectSetCapability$1:val$projects	[Lorg/eclipse/core/resources/IProject;
          //   10: arraylength
          //   11: imul
          //   12: invokeinterface 82 3 0
          //   17: iconst_0
          //   18: istore_2
          //   19: goto +75 -> 94
          //   22: aload_1
          //   23: invokeinterface 81 1 0
          //   28: ifeq +6 -> 34
          //   31: goto +86 -> 117
          //   34: aload_0
          //   35: getfield 73	org/eclipse/team/internal/ccvs/core/CVSProjectSetCapability$1:val$projects	[Lorg/eclipse/core/resources/IProject;
          //   38: iload_2
          //   39: aaload
          //   40: astore_3
          //   41: aload_0
          //   42: getfield 72	org/eclipse/team/internal/ccvs/core/CVSProjectSetCapability$1:val$infoMap	Ljava/util/Map;
          //   45: aload_3
          //   46: invokeinterface 79 2 0
          //   51: checkcast 44	org/eclipse/team/internal/ccvs/core/CVSProjectSetCapability$LoadInfo
          //   54: astore 4
          //   56: aload 4
          //   58: ifnull +33 -> 91
          //   61: aload 4
          //   63: new 41	org/eclipse/core/runtime/SubProgressMonitor
          //   66: dup
          //   67: aload_1
          //   68: sipush 1000
          //   71: invokespecial 76	org/eclipse/core/runtime/SubProgressMonitor:<init>	(Lorg/eclipse/core/runtime/IProgressMonitor;I)V
          //   74: invokevirtual 77	org/eclipse/team/internal/ccvs/core/CVSProjectSetCapability$LoadInfo:checkout	(Lorg/eclipse/core/runtime/IProgressMonitor;)Z
          //   77: ifeq +14 -> 91
          //   80: aload_0
          //   81: getfield 71	org/eclipse/team/internal/ccvs/core/CVSProjectSetCapability$1:val$result	Ljava/util/List;
          //   84: aload_3
          //   85: invokeinterface 78 2 0
          //   90: pop
          //   91: iinc 2 1
          //   94: iload_2
          //   95: aload_0
          //   96: getfield 73	org/eclipse/team/internal/ccvs/core/CVSProjectSetCapability$1:val$projects	[Lorg/eclipse/core/resources/IProject;
          //   99: arraylength
          //   100: if_icmplt -78 -> 22
          //   103: goto +14 -> 117
          //   106: astore 5
          //   108: aload_1
          //   109: invokeinterface 80 1 0
          //   114: aload 5
          //   116: athrow
          //   117: aload_1
          //   118: invokeinterface 80 1 0
          //   123: return
          // Line number table:
          //   Java source line #227	-> byte code offset #0
          //   Java source line #229	-> byte code offset #17
          //   Java source line #230	-> byte code offset #22
          //   Java source line #231	-> byte code offset #31
          //   Java source line #232	-> byte code offset #34
          //   Java source line #233	-> byte code offset #41
          //   Java source line #234	-> byte code offset #56
          //   Java source line #235	-> byte code offset #80
          //   Java source line #229	-> byte code offset #91
          //   Java source line #238	-> byte code offset #106
          //   Java source line #239	-> byte code offset #108
          //   Java source line #240	-> byte code offset #114
          //   Java source line #239	-> byte code offset #117
          //   Java source line #241	-> byte code offset #123
          // Local variable table:
          //   start	length	slot	name	signature
          //   0	124	0	this	1
          //   0	124	1	monitor	IProgressMonitor
          //   18	77	2	i	int
          //   40	45	3	project	IProject
          //   54	8	4	info	CVSProjectSetCapability.LoadInfo
          //   106	9	5	localObject	Object
          // Exception table:
          //   from	to	target	type
          //   17	106	106	finally
        }
      }, getCheckoutRule(projects), 0, monitor);
    }
    catch (CoreException e)
    {
      throw TeamException.asTeamException(e);
    }
    return (IProject[])result.toArray(new IProject[result.size()]);
  }
  
  static class LoadInfo
  {
    ICVSRepositoryLocation repositoryLocation;
    private final String module;
    private final IProject project;
    private final CVSTag tag;
    
    LoadInfo(StringTokenizer tokenizer, boolean useKnown, boolean addIfNotFound)
      throws CVSException
    {
      String repo = tokenizer.nextToken();
      repositoryLocation = CVSProjectSetCapability.getRepositoryLocationFromString(repo, useKnown, addIfNotFound);
      module = tokenizer.nextToken();
      String projectName = tokenizer.nextToken();
      project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
      if (tokenizer.hasMoreTokens())
      {
        String tagName = tokenizer.nextToken();
        tag = new CVSTag(tagName, 1);
      }
      else
      {
        tag = null;
      }
    }
    
    LoadInfo(StringTokenizer tokenizer)
      throws CVSException
    {
      this(tokenizer, true, true);
    }
    
    private IProject getProject()
    {
      return project;
    }
    
    boolean checkout(IProgressMonitor monitor)
      throws TeamException
    {
      if (repositoryLocation == null) {
        return false;
      }
      CVSProjectSetCapability.checkout(
        repositoryLocation, 
        project, 
        module, 
        tag, 
        monitor);
      return true;
    }
  }
  
  private static ICVSRepositoryLocation getRepositoryLocationFromString(String repo, boolean useKnown, boolean addIfNotFound)
    throws CVSException
  {
    ICVSRepositoryLocation newLocation = CVSRepositoryLocation.fromString(repo);
    if ((useKnown) && ((newLocation.getUsername() == null) || (newLocation.getUsername().length() == 0)))
    {
      ICVSRepositoryLocation[] locations = CVSProviderPlugin.getPlugin().getKnownRepositories();
      for (int i = 0; i < locations.length; i++)
      {
        ICVSRepositoryLocation location = locations[i];
        if (CVSRepositoryLocationMatcher.isMatching(newLocation, location)) {
          return location;
        }
      }
    }
    if (addIfNotFound) {
      KnownRepositories.getInstance().addRepository(newLocation, true);
    }
    return newLocation;
  }
  
  public static void checkout(ICVSRepositoryLocation repository, IProject project, String sourceModule, CVSTag tag, IProgressMonitor monitor)
    throws TeamException
  {
    if (sourceModule == null) {
      sourceModule = project.getName();
    }
    checkout(new ICVSRemoteFolder[] { new RemoteFolder(null, repository, sourceModule, tag) }, 
      new IProject[] { project }, monitor);
  }
  
  /* Error */
  public static void checkout(ICVSRemoteFolder[] resources, IProject[] projects, IProgressMonitor monitor)
    throws TeamException
  {
    // Byte code:
    //   0: iconst_1
    //   1: anewarray 244	org/eclipse/team/core/TeamException
    //   4: astore_3
    //   5: new 249	org/eclipse/team/internal/ccvs/core/CVSProjectSetCapability$2
    //   8: dup
    //   9: aload_0
    //   10: aload_1
    //   11: aload_3
    //   12: invokespecial 531	org/eclipse/team/internal/ccvs/core/CVSProjectSetCapability$2:<init>	([Lorg/eclipse/team/internal/ccvs/core/ICVSRemoteFolder;[Lorg/eclipse/core/resources/IProject;[Lorg/eclipse/team/core/TeamException;)V
    //   15: astore 4
    //   17: invokestatic 508	org/eclipse/core/resources/ResourcesPlugin:getWorkspace	()Lorg/eclipse/core/resources/IWorkspace;
    //   20: aload 4
    //   22: aload_1
    //   23: invokestatic 523	org/eclipse/team/internal/ccvs/core/CVSProjectSetCapability:getCheckoutRule	([Lorg/eclipse/core/resources/IProject;)Lorg/eclipse/core/runtime/jobs/ISchedulingRule;
    //   26: iconst_0
    //   27: aload_2
    //   28: invokeinterface 599 5 0
    //   33: goto +22 -> 55
    //   36: astore 4
    //   38: aload 4
    //   40: invokestatic 517	org/eclipse/team/internal/ccvs/core/CVSException:wrapException	(Lorg/eclipse/core/runtime/CoreException;)Lorg/eclipse/team/internal/ccvs/core/CVSException;
    //   43: athrow
    //   44: astore 5
    //   46: aload_2
    //   47: invokeinterface 602 1 0
    //   52: aload 5
    //   54: athrow
    //   55: aload_2
    //   56: invokeinterface 602 1 0
    //   61: aload_3
    //   62: iconst_0
    //   63: aaload
    //   64: ifnull +7 -> 71
    //   67: aload_3
    //   68: iconst_0
    //   69: aaload
    //   70: athrow
    //   71: return
    // Line number table:
    //   Java source line #379	-> byte code offset #0
    //   Java source line #381	-> byte code offset #5
    //   Java source line #484	-> byte code offset #17
    //   Java source line #485	-> byte code offset #36
    //   Java source line #486	-> byte code offset #38
    //   Java source line #487	-> byte code offset #44
    //   Java source line #488	-> byte code offset #46
    //   Java source line #489	-> byte code offset #52
    //   Java source line #488	-> byte code offset #55
    //   Java source line #491	-> byte code offset #61
    //   Java source line #492	-> byte code offset #67
    //   Java source line #494	-> byte code offset #71
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	72	0	resources	ICVSRemoteFolder[]
    //   0	72	1	projects	IProject[]
    //   0	72	2	monitor	IProgressMonitor
    //   4	64	3	eHolder	TeamException[]
    //   15	6	4	workspaceRunnable	IWorkspaceRunnable
    //   36	3	4	e	CoreException
    //   44	9	5	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   5	33	36	org/eclipse/core/runtime/CoreException
    //   5	44	44	finally
  }
  
  private static ISchedulingRule getCheckoutRule(IProject[] projects)
  {
    if (projects.length == 1) {
      return ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(projects[0]);
    }
    Set rules = new HashSet();
    for (int i = 0; i < projects.length; i++)
    {
      ISchedulingRule modifyRule = ResourcesPlugin.getWorkspace().getRuleFactory().modifyRule(projects[i]);
      if (((modifyRule instanceof IResource)) && (((IResource)modifyRule).getType() == 8)) {
        return modifyRule;
      }
      rules.add(modifyRule);
    }
    return new MultiRule((ISchedulingRule[])rules.toArray(new ISchedulingRule[rules.size()]));
  }
  
  /* Error */
  static void refreshProjects(IProject[] projects, IProgressMonitor monitor)
    throws CoreException, TeamException
  {
    // Byte code:
    //   0: aload_1
    //   1: getstatic 489	org/eclipse/team/internal/ccvs/core/CVSMessages:CVSProvider_Creating_projects_2	Ljava/lang/String;
    //   4: aload_0
    //   5: arraylength
    //   6: bipush 100
    //   8: imul
    //   9: invokeinterface 604 3 0
    //   14: iconst_0
    //   15: istore_2
    //   16: goto +40 -> 56
    //   19: aload_0
    //   20: iload_2
    //   21: aaload
    //   22: astore_3
    //   23: aload_3
    //   24: invokestatic 538	org/eclipse/team/internal/ccvs/core/CVSProviderPlugin:getTypeId	()Ljava/lang/String;
    //   27: invokestatic 513	org/eclipse/team/core/RepositoryProvider:map	(Lorg/eclipse/core/resources/IProject;Ljava/lang/String;)V
    //   30: aload_3
    //   31: invokestatic 538	org/eclipse/team/internal/ccvs/core/CVSProviderPlugin:getTypeId	()Ljava/lang/String;
    //   34: invokestatic 515	org/eclipse/team/core/RepositoryProvider:getProvider	(Lorg/eclipse/core/resources/IProject;Ljava/lang/String;)Lorg/eclipse/team/core/RepositoryProvider;
    //   37: checkcast 254	org/eclipse/team/internal/ccvs/core/CVSTeamProvider
    //   40: astore 4
    //   42: aload 4
    //   44: invokestatic 540	org/eclipse/team/internal/ccvs/core/CVSProviderPlugin:getPlugin	()Lorg/eclipse/team/internal/ccvs/core/CVSProviderPlugin;
    //   47: invokevirtual 537	org/eclipse/team/internal/ccvs/core/CVSProviderPlugin:isWatchEditEnabled	()Z
    //   50: invokevirtual 547	org/eclipse/team/internal/ccvs/core/CVSTeamProvider:setWatchEditEnabled	(Z)V
    //   53: iinc 2 1
    //   56: iload_2
    //   57: aload_0
    //   58: arraylength
    //   59: if_icmplt -40 -> 19
    //   62: goto +14 -> 76
    //   65: astore 5
    //   67: aload_1
    //   68: invokeinterface 602 1 0
    //   73: aload 5
    //   75: athrow
    //   76: aload_1
    //   77: invokeinterface 602 1 0
    //   82: return
    // Line number table:
    //   Java source line #517	-> byte code offset #0
    //   Java source line #519	-> byte code offset #14
    //   Java source line #520	-> byte code offset #19
    //   Java source line #522	-> byte code offset #23
    //   Java source line #523	-> byte code offset #30
    //   Java source line #524	-> byte code offset #42
    //   Java source line #519	-> byte code offset #53
    //   Java source line #527	-> byte code offset #65
    //   Java source line #528	-> byte code offset #67
    //   Java source line #529	-> byte code offset #73
    //   Java source line #528	-> byte code offset #76
    //   Java source line #530	-> byte code offset #82
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	83	0	projects	IProject[]
    //   0	83	1	monitor	IProgressMonitor
    //   15	42	2	i	int
    //   22	9	3	project	IProject
    //   40	3	4	provider	CVSTeamProvider
    //   65	9	5	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   14	65	65	finally
  }
  
  /* Error */
  static void scrubProjects(IProject[] projects, IProgressMonitor monitor)
    throws CVSException
  {
    // Byte code:
    //   0: aload_0
    //   1: ifnonnull +10 -> 11
    //   4: aload_1
    //   5: invokeinterface 602 1 0
    //   10: return
    //   11: aload_1
    //   12: getstatic 491	org/eclipse/team/internal/ccvs/core/CVSMessages:CVSProvider_Scrubbing_projects_1	Ljava/lang/String;
    //   15: aload_0
    //   16: arraylength
    //   17: bipush 100
    //   19: imul
    //   20: invokeinterface 604 3 0
    //   25: iconst_0
    //   26: istore_2
    //   27: goto +222 -> 249
    //   30: aload_0
    //   31: iload_2
    //   32: aaload
    //   33: astore_3
    //   34: aload_3
    //   35: ifnull +163 -> 198
    //   38: aload_3
    //   39: invokeinterface 587 1 0
    //   44: ifeq +154 -> 198
    //   47: aload_3
    //   48: invokeinterface 588 1 0
    //   53: ifne +15 -> 68
    //   56: aload_3
    //   57: aload_1
    //   58: bipush 10
    //   60: invokestatic 551	org/eclipse/team/internal/ccvs/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   63: invokeinterface 592 2 0
    //   68: aload_1
    //   69: getstatic 490	org/eclipse/team/internal/ccvs/core/CVSMessages:CVSProvider_Scrubbing_local_project_1	Ljava/lang/String;
    //   72: invokeinterface 603 2 0
    //   77: aload_3
    //   78: invokestatic 514	org/eclipse/team/core/RepositoryProvider:getProvider	(Lorg/eclipse/core/resources/IProject;)Lorg/eclipse/team/core/RepositoryProvider;
    //   81: ifnull +7 -> 88
    //   84: aload_3
    //   85: invokestatic 512	org/eclipse/team/core/RepositoryProvider:unmap	(Lorg/eclipse/core/resources/IProject;)V
    //   88: aload_3
    //   89: iconst_2
    //   90: invokeinterface 591 2 0
    //   95: astore 4
    //   97: aload_1
    //   98: bipush 80
    //   100: invokestatic 551	org/eclipse/team/internal/ccvs/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   103: astore 5
    //   105: aload 5
    //   107: aconst_null
    //   108: aload 4
    //   110: arraylength
    //   111: bipush 100
    //   113: imul
    //   114: invokeinterface 604 3 0
    //   119: iconst_0
    //   120: istore 6
    //   122: goto +43 -> 165
    //   125: aload 4
    //   127: iload 6
    //   129: aaload
    //   130: invokeinterface 594 1 0
    //   135: ldc_w 213
    //   138: invokevirtual 499	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   141: ifne +21 -> 162
    //   144: aload 4
    //   146: iload 6
    //   148: aaload
    //   149: iconst_1
    //   150: aload 5
    //   152: bipush 100
    //   154: invokestatic 551	org/eclipse/team/internal/ccvs/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   157: invokeinterface 595 3 0
    //   162: iinc 6 1
    //   165: iload 6
    //   167: aload 4
    //   169: arraylength
    //   170: if_icmplt -45 -> 125
    //   173: goto +15 -> 188
    //   176: astore 7
    //   178: aload 5
    //   180: invokeinterface 602 1 0
    //   185: aload 7
    //   187: athrow
    //   188: aload 5
    //   190: invokeinterface 602 1 0
    //   195: goto +51 -> 246
    //   198: aload_3
    //   199: ifnull +47 -> 246
    //   202: new 217	java/io/File
    //   205: dup
    //   206: aload_3
    //   207: invokeinterface 590 1 0
    //   212: invokeinterface 586 1 0
    //   217: invokeinterface 601 1 0
    //   222: aload_3
    //   223: invokeinterface 589 1 0
    //   228: invokespecial 497	java/io/File:<init>	(Ljava/io/File;Ljava/lang/String;)V
    //   231: astore 4
    //   233: aload 4
    //   235: invokevirtual 494	java/io/File:exists	()Z
    //   238: ifeq +8 -> 246
    //   241: aload 4
    //   243: invokestatic 518	org/eclipse/team/internal/ccvs/core/CVSProjectSetCapability:deepDelete	(Ljava/io/File;)V
    //   246: iinc 2 1
    //   249: iload_2
    //   250: aload_0
    //   251: arraylength
    //   252: if_icmplt -222 -> 30
    //   255: goto +20 -> 275
    //   258: astore_2
    //   259: aload_2
    //   260: invokestatic 517	org/eclipse/team/internal/ccvs/core/CVSException:wrapException	(Lorg/eclipse/core/runtime/CoreException;)Lorg/eclipse/team/internal/ccvs/core/CVSException;
    //   263: athrow
    //   264: astore 8
    //   266: aload_1
    //   267: invokeinterface 602 1 0
    //   272: aload 8
    //   274: athrow
    //   275: aload_1
    //   276: invokeinterface 602 1 0
    //   281: return
    // Line number table:
    //   Java source line #536	-> byte code offset #0
    //   Java source line #537	-> byte code offset #4
    //   Java source line #538	-> byte code offset #10
    //   Java source line #540	-> byte code offset #11
    //   Java source line #542	-> byte code offset #25
    //   Java source line #543	-> byte code offset #30
    //   Java source line #544	-> byte code offset #34
    //   Java source line #545	-> byte code offset #47
    //   Java source line #546	-> byte code offset #56
    //   Java source line #550	-> byte code offset #68
    //   Java source line #552	-> byte code offset #77
    //   Java source line #553	-> byte code offset #84
    //   Java source line #554	-> byte code offset #88
    //   Java source line #555	-> byte code offset #97
    //   Java source line #556	-> byte code offset #105
    //   Java source line #558	-> byte code offset #119
    //   Java source line #559	-> byte code offset #125
    //   Java source line #560	-> byte code offset #144
    //   Java source line #558	-> byte code offset #162
    //   Java source line #563	-> byte code offset #176
    //   Java source line #564	-> byte code offset #178
    //   Java source line #565	-> byte code offset #185
    //   Java source line #564	-> byte code offset #188
    //   Java source line #566	-> byte code offset #198
    //   Java source line #568	-> byte code offset #202
    //   Java source line #569	-> byte code offset #233
    //   Java source line #570	-> byte code offset #241
    //   Java source line #542	-> byte code offset #246
    //   Java source line #574	-> byte code offset #258
    //   Java source line #575	-> byte code offset #259
    //   Java source line #576	-> byte code offset #264
    //   Java source line #577	-> byte code offset #266
    //   Java source line #578	-> byte code offset #272
    //   Java source line #577	-> byte code offset #275
    //   Java source line #579	-> byte code offset #281
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	282	0	projects	IProject[]
    //   0	282	1	monitor	IProgressMonitor
    //   26	224	2	i	int
    //   258	2	2	e	CoreException
    //   33	190	3	project	IProject
    //   95	73	4	children	IResource[]
    //   231	11	4	location	File
    //   103	86	5	subMonitor	IProgressMonitor
    //   120	46	6	j	int
    //   176	10	7	localObject1	Object
    //   264	9	8	localObject2	Object
    // Exception table:
    //   from	to	target	type
    //   119	176	176	finally
    //   25	255	258	org/eclipse/core/runtime/CoreException
    //   25	264	264	finally
  }
  
  private static void deepDelete(File resource)
  {
    if (resource.isDirectory())
    {
      File[] fileList = resource.listFiles();
      for (int i = 0; i < fileList.length; i++) {
        deepDelete(fileList[i]);
      }
    }
    resource.delete();
  }
  
  public String getProject(String referenceString)
  {
    StringTokenizer tokenizer = new StringTokenizer(referenceString, ",");
    String version = tokenizer.nextToken();
    if (!version.equals("1.0")) {
      return null;
    }
    try
    {
      LoadInfo info = new LoadInfo(tokenizer);
      return info.getProject().getName();
    }
    catch (CVSException e)
    {
      CVSProviderPlugin.log(e);
    }
    return null;
  }
  
  public URI getURI(String referenceString)
  {
    StringTokenizer tokenizer = new StringTokenizer(referenceString, ",");
    String version = tokenizer.nextToken();
    if (!version.equals("1.0")) {
      return null;
    }
    try
    {
      LoadInfo info = new LoadInfo(tokenizer);
      CVSURI cvsURI = new CVSURI(repositoryLocation, new Path(module), tag);
      return cvsURI.toURI();
    }
    catch (CVSException e)
    {
      CVSProviderPlugin.log(e);
    }
    return null;
  }
  
  public String asReference(URI uri, String projectName)
  {
    try
    {
      CVSURI cvsURI = CVSURI.fromUri(uri);
      ICVSRepositoryLocation location = cvsURI.getRepository();
      ICVSFolder folder = cvsURI.toFolder();
      if (projectName == null)
      {
        projectName = cvsURI.getProjectName();
        if (projectName == null) {
          projectName = cvsURI.getLastSegment();
        }
        if (projectName == null) {
          return null;
        }
      }
      IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
      return asReference((CVSRepositoryLocation)location, folder, project);
    }
    catch (TeamException e)
    {
      CVSProviderPlugin.log(e);
    }
    return null;
  }
  
  private Map promptForAdditionRepositoryInformation(Map alternativeMap)
  {
    IUserAuthenticator authenticator = CVSRepositoryLocation.getAuthenticator();
    return authenticator.promptToConfigureRepositoryLocations(alternativeMap);
  }
}

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

import org.eclipse.core.runtime.ISafeRunnable;

class CVSProviderPlugin$1
  implements ISafeRunnable
{
  private final ICVSDecoratorEnablementListener val$listener;
  private final boolean val$enabled;
  
  CVSProviderPlugin$1(ICVSDecoratorEnablementListener paramICVSDecoratorEnablementListener, boolean paramBoolean)
  {
    val$listener = paramICVSDecoratorEnablementListener;val$enabled = paramBoolean;
  }
  
  public void run()
    throws Exception
  {
    val$listener.decoratorEnablementChanged(val$enabled);
  }
  
  public void handleException(Throwable e) {}
}

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

import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.ILog;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.jsch.core.IJSchService;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.core.IFileContentManager;
import org.eclipse.team.core.Team;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.internal.ccvs.core.client.Command;
import org.eclipse.team.internal.ccvs.core.client.Command.KSubstOption;
import org.eclipse.team.internal.ccvs.core.client.Command.QuietOption;
import org.eclipse.team.internal.ccvs.core.client.ConsoleListeners;
import org.eclipse.team.internal.ccvs.core.client.listeners.IConsoleListener;
import org.eclipse.team.internal.ccvs.core.mapping.CVSActiveChangeSetCollector;
import org.eclipse.team.internal.ccvs.core.resources.FileModificationManager;
import org.eclipse.team.internal.ccvs.core.util.BuildCleanupListener;
import org.eclipse.team.internal.ccvs.core.util.KnownRepositories;
import org.eclipse.team.internal.ccvs.core.util.SyncFileChangeListener;
import org.eclipse.team.internal.ccvs.core.util.Util;
import org.eclipse.team.internal.core.subscribers.ActiveChangeSetManager;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.util.tracker.ServiceTracker;

public class CVSProviderPlugin
  extends Plugin
{
  public static final String READ_ONLY = "cvs.read.only";
  public static final String ENABLE_WATCH_ON_EDIT = "cvs.watch.on.edit";
  public static final String DEFAULT_CVS_RSH = "ssh";
  public static final String DEFAULT_CVS_RSH_PARAMETERS = "-l {user} {host}";
  public static final String DEFAULT_CVS_SERVER = "cvs";
  public static final boolean DEFAULT_PRUNE = true;
  public static final boolean DEFAULT_CONFIRM_MOVE_TAG = true;
  public static final boolean DEFAULT_FETCH = true;
  public static final int DEFAULT_TIMEOUT = 60;
  public static final int DEFAULT_COMPRESSION_LEVEL = 0;
  public static final Command.KSubstOption DEFAULT_TEXT_KSUBST_OPTION = Command.KSUBST_TEXT_EXPAND;
  public static final String ID = "org.eclipse.team.cvs.core";
  public static final QualifiedName CVS_WORKSPACE_SUBSCRIBER_ID = new QualifiedName("org.eclipse.team.cvs.ui.cvsworkspace-participant", "syncparticipant");
  public static final String PT_AUTHENTICATOR = "authenticator";
  public static final String PT_CONNECTIONMETHODS = "connectionmethods";
  public static final String PT_FILE_MODIFICATION_VALIDATOR = "filemodificationvalidator";
  private Command.QuietOption quietness;
  private int compressionLevel = 0;
  private Command.KSubstOption defaultTextKSubstOption = DEFAULT_TEXT_KSUBST_OPTION;
  private boolean usePlatformLineend = true;
  private int communicationsTimeout = 60;
  private boolean pruneEmptyDirectories = true;
  private boolean fetchAbsentDirectories = true;
  private boolean replaceUnmanaged = true;
  private boolean repositoriesAreBinary = false;
  private String cvsRshCommand = "ssh";
  private String cvsRshParameters = "-l {user} {host}";
  private String cvsServer = "cvs";
  private boolean determineVersionEnabled = true;
  private static volatile CVSProviderPlugin instance;
  private BuildCleanupListener addDeleteMoveListener;
  private FileModificationManager fileModificationManager;
  private SyncFileChangeListener metaFileSyncListener;
  private static final String REPOSITORIES_STATE_FILE = ".cvsProviderState";
  private static final int REPOSITORIES_STATE_FILE_VERSION_2 = -1;
  private static List decoratorEnablementListeners = new ArrayList();
  private CVSWorkspaceSubscriber cvsWorkspaceSubscriber;
  private static final String NATURE_ID = "org.eclipse.team.cvs.core.cvsnature";
  private static final String CRASH_INDICATION_FILE = ".running";
  private boolean crash;
  private boolean autoShareOnImport;
  private boolean useProxy;
  public static final String PROXY_TYPE_HTTP = "HTTP";
  public static final String PROXY_TYPE_SOCKS5 = "SOCKS5";
  public static final String HTTP_DEFAULT_PORT = "80";
  public static final String SOCKS5_DEFAULT_PORT = "1080";
  private String proxyType;
  private String proxyHost;
  private String proxyPort;
  private boolean useProxyAuth;
  private CVSActiveChangeSetCollector changeSetManager;
  private ServiceTracker tracker;
  private static final String INFO_PROXY_USER = "org.eclipse.team.cvs.core.proxy.user";
  private static final String INFO_PROXY_PASS = "org.eclipse.team.cvs.core.proxy.pass";
  private static final URL FAKE_URL;
  
  static
  {
    URL temp = null;
    try
    {
      temp = new URL("http://org.eclipse.team.cvs.proxy.auth");
    }
    catch (MalformedURLException localMalformedURLException) {}
    FAKE_URL = temp;
  }
  
  public synchronized CVSWorkspaceSubscriber getCVSWorkspaceSubscriber()
  {
    if (cvsWorkspaceSubscriber == null) {
      cvsWorkspaceSubscriber = new CVSWorkspaceSubscriber(
        CVS_WORKSPACE_SUBSCRIBER_ID, 
        CVSMessages.CVSProviderPlugin_20);
    }
    return cvsWorkspaceSubscriber;
  }
  
  public CVSProviderPlugin()
  {
    instance = this;
  }
  
  public static void log(CoreException e)
  {
    log(e.getStatus().getSeverity(), e.getMessage(), e);
  }
  
  public static void log(int severity, String message, Throwable e)
  {
    log(new Status(severity, "org.eclipse.team.cvs.core", 0, message, e));
  }
  
  public static void log(IStatus status)
  {
    getPlugin().getLog().log(status);
  }
  
  public static CVSProviderPlugin getPlugin()
  {
    return instance;
  }
  
  public static String getTypeId()
  {
    return "org.eclipse.team.cvs.core.cvsnature";
  }
  
  public void setCompressionLevel(int level)
  {
    compressionLevel = level;
  }
  
  public int getCompressionLevel()
  {
    return compressionLevel;
  }
  
  public void setDefaultTextKSubstOption(Command.KSubstOption ksubst)
  {
    defaultTextKSubstOption = ksubst;
  }
  
  public Command.KSubstOption getDefaultTextKSubstOption()
  {
    return defaultTextKSubstOption;
  }
  
  public boolean getPruneEmptyDirectories()
  {
    return pruneEmptyDirectories;
  }
  
  public void setPruneEmptyDirectories(boolean prune)
  {
    pruneEmptyDirectories = prune;
  }
  
  public int getTimeout()
  {
    return communicationsTimeout;
  }
  
  public void setTimeout(int timeout)
  {
    communicationsTimeout = Math.max(0, timeout);
  }
  
  public void setQuietness(Command.QuietOption option)
  {
    quietness = option;
  }
  
  public Command.QuietOption getQuietness()
  {
    return quietness;
  }
  
  public void setConsoleListener(IConsoleListener consoleListener)
  {
    ConsoleListeners.getInstance().addListener(consoleListener);
  }
  
  public void start(BundleContext context)
    throws Exception
  {
    super.start(context);
    
    loadOldState();
    crash = createCrashFile();
    
    IWorkspace workspace = ResourcesPlugin.getWorkspace();
    addDeleteMoveListener = new BuildCleanupListener();
    fileModificationManager = new FileModificationManager();
    metaFileSyncListener = new SyncFileChangeListener();
    workspace.addResourceChangeListener(addDeleteMoveListener, 16);
    workspace.addResourceChangeListener(metaFileSyncListener, 1);
    workspace.addResourceChangeListener(fileModificationManager, 1);
    
    getCVSWorkspaceSubscriber();
    
    getChangeSetManager();
    
    tracker = new ServiceTracker(getBundle().getBundleContext(), IJSchService.class.getName(), null);
    tracker.open();
  }
  
  /* Error */
  public void stop(BundleContext context)
    throws Exception
  {
    // Byte code:
    //   0: aload_0
    //   1: invokevirtual 687	org/eclipse/team/internal/ccvs/core/CVSProviderPlugin:savePluginPreferences	()V
    //   4: invokestatic 667	org/eclipse/core/resources/ResourcesPlugin:getWorkspace	()Lorg/eclipse/core/resources/IWorkspace;
    //   7: astore_2
    //   8: aload_2
    //   9: aload_0
    //   10: getfield 644	org/eclipse/team/internal/ccvs/core/CVSProviderPlugin:metaFileSyncListener	Lorg/eclipse/team/internal/ccvs/core/util/SyncFileChangeListener;
    //   13: invokeinterface 729 2 0
    //   18: aload_2
    //   19: aload_0
    //   20: getfield 642	org/eclipse/team/internal/ccvs/core/CVSProviderPlugin:fileModificationManager	Lorg/eclipse/team/internal/ccvs/core/resources/FileModificationManager;
    //   23: invokeinterface 729 2 0
    //   28: aload_2
    //   29: aload_0
    //   30: getfield 643	org/eclipse/team/internal/ccvs/core/CVSProviderPlugin:addDeleteMoveListener	Lorg/eclipse/team/internal/ccvs/core/util/BuildCleanupListener;
    //   33: invokeinterface 729 2 0
    //   38: aload_2
    //   39: aload_0
    //   40: invokeinterface 731 2 0
    //   45: aload_0
    //   46: invokevirtual 699	org/eclipse/team/internal/ccvs/core/CVSProviderPlugin:getChangeSetManager	()Lorg/eclipse/team/internal/core/subscribers/ActiveChangeSetManager;
    //   49: invokevirtual 717	org/eclipse/team/internal/core/subscribers/ActiveChangeSetManager:dispose	()V
    //   52: aload_0
    //   53: getfield 645	org/eclipse/team/internal/ccvs/core/CVSProviderPlugin:tracker	Lorg/osgi/util/tracker/ServiceTracker;
    //   56: invokevirtual 718	org/osgi/util/tracker/ServiceTracker:close	()V
    //   59: aload_0
    //   60: invokespecial 685	org/eclipse/team/internal/ccvs/core/CVSProviderPlugin:deleteCrashFile	()V
    //   63: goto +11 -> 74
    //   66: astore_3
    //   67: aload_0
    //   68: aload_1
    //   69: invokespecial 675	org/eclipse/core/runtime/Plugin:stop	(Lorg/osgi/framework/BundleContext;)V
    //   72: aload_3
    //   73: athrow
    //   74: aload_0
    //   75: aload_1
    //   76: invokespecial 675	org/eclipse/core/runtime/Plugin:stop	(Lorg/osgi/framework/BundleContext;)V
    //   79: return
    // Line number table:
    //   Java source line #317	-> byte code offset #0
    //   Java source line #320	-> byte code offset #4
    //   Java source line #321	-> byte code offset #8
    //   Java source line #322	-> byte code offset #18
    //   Java source line #323	-> byte code offset #28
    //   Java source line #327	-> byte code offset #38
    //   Java source line #329	-> byte code offset #45
    //   Java source line #331	-> byte code offset #52
    //   Java source line #333	-> byte code offset #59
    //   Java source line #334	-> byte code offset #66
    //   Java source line #335	-> byte code offset #67
    //   Java source line #336	-> byte code offset #72
    //   Java source line #335	-> byte code offset #74
    //   Java source line #337	-> byte code offset #79
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	80	0	this	CVSProviderPlugin
    //   0	80	1	context	BundleContext
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 27 28 29 30 31 32 33 34 35 36

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-2019. Infinite Loop Ltd