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

 isFolder()
  {
    return true;
  }
  
  public boolean childExists(String path)
  {
    try
    {
      return getChild(path) != null;
    }
    catch (CVSException localCVSException) {}
    return false;
  }
  
  public ICVSResource getChild(String path)
    throws CVSException
  {
    if ((path.equals(".")) || (path.length() == 0)) {
      return this;
    }
    if (path.indexOf("/") != -1)
    {
      IPath p = new Path(null, path);
      try
      {
        return ((RemoteFolder)getChild(p.segment(0))).getChild(p.removeFirstSegments(1).toString());
      }
      catch (CVSException e)
      {
        IStatus status = new CVSStatus(4, 1000, NLS.bind(CVSMessages.RemoteFolder_invalidChild, new String[] { path, getName() }), e, repository);
        throw new CVSException(status);
      }
    }
    ICVSRemoteResource[] children = getChildren();
    if (children == null)
    {
      IStatus status = new CVSStatus(4, 1000, NLS.bind(CVSMessages.RemoteFolder_invalidChild, new String[] { path, getName() }), repository);
      throw new CVSException(status);
    }
    for (int i = 0; i < children.length; i++) {
      if (children[i].getName().equals(path)) {
        return children[i];
      }
    }
    IStatus status = new CVSStatus(4, 1000, NLS.bind(CVSMessages.RemoteFolder_invalidChild, new String[] { path, getName() }), repository);
    throw new CVSException(status);
  }
  
  public void mkdir()
    throws CVSException
  {
    IStatus status = new CVSStatus(4, CVSMessages.RemoteResource_invalidOperation);
    throw new CVSException(status);
  }
  
  public void flush(boolean deep) {}
  
  public FolderSyncInfo getFolderSyncInfo()
  {
    return folderInfo;
  }
  
  public String getRemoteLocation(ICVSFolder stopSearching)
    throws CVSException
  {
    if (folderInfo == null) {
      return Util.appendPath(parent.getRemoteLocation(stopSearching), getName());
    }
    return folderInfo.getRemoteLocation();
  }
  
  public boolean isCVSFolder()
  {
    return folderInfo != null;
  }
  
  public void acceptChildren(ICVSResourceVisitor visitor)
    throws CVSException
  {
    IStatus status = new CVSStatus(4, CVSMessages.RemoteResource_invalidOperation);
    throw new CVSException(status);
  }
  
  public boolean isContainer()
  {
    return true;
  }
  
  public ICVSRemoteResource[] members(IProgressMonitor progress)
    throws TeamException
  {
    return getMembers(progress);
  }
  
  public ICVSRemoteResource[] getChildren()
  {
    return children;
  }
  
  protected void setChildren(ICVSRemoteResource[] children)
  {
    this.children = children;
  }
  
  public void setTag(CVSTag tag)
  {
    MutableFolderSyncInfo newInfo = folderInfo.cloneMutable();
    newInfo.setTag(tag);
    setFolderSyncInfo(newInfo);
  }
  
  public CVSTag getTag()
  {
    if (folderInfo == null) {
      return null;
    }
    return folderInfo.getTag();
  }
  
  public void setFolderSyncInfo(FolderSyncInfo folderInfo)
  {
    this.folderInfo = folderInfo.asImmutable();
  }
  
  public void run(ICVSRunnable job, IProgressMonitor monitor)
    throws CVSException
  {
    job.run(monitor);
  }
  
  public IStatus tag(CVSTag tag, Command.LocalOption[] localOptions, IProgressMonitor monitor)
    throws CVSException
  {
    monitor = Policy.monitorFor(monitor);
    monitor.beginTask(null, 100);
    Session session = new Session(getRepository(), this, true);
    session.open(Policy.subMonitorFor(monitor, 10), true);
    try
    {
      return Command.RTAG.execute(
        session, 
        Command.NO_GLOBAL_OPTIONS, 
        localOptions, 
        folderInfo.getTag(), 
        tag, 
        new ICVSRemoteResource[] { this }, 
        Policy.subMonitorFor(monitor, 90));
    }
    finally
    {
      session.close();
    }
  }
  
  public ICVSResource[] fetchChildren(IProgressMonitor monitor)
    throws CVSException
  {
    try
    {
      return getMembers(monitor);
    }
    catch (TeamException e)
    {
      throw new CVSException(e.getStatus());
    }
  }
  
  public boolean equals(Object target)
  {
    if (!super.equals(target)) {
      return false;
    }
    RemoteFolder folder = (RemoteFolder)target;
    if (folder.isDefinedModule() != isDefinedModule()) {
      return false;
    }
    CVSTag tag1 = getTag();
    CVSTag tag2 = folder.getTag();
    if (tag1 == null) {
      tag1 = CVSTag.DEFAULT;
    }
    if (tag2 == null) {
      tag2 = CVSTag.DEFAULT;
    }
    return tag1.equals(tag2);
  }
  
  public int hashCode()
  {
    CVSTag tag = getTag();
    if (tag == null) {
      tag = CVSTag.DEFAULT;
    }
    return super.hashCode() | tag.getName().hashCode();
  }
  
  protected IPath getRelativePathFromRootRelativePath(ICVSFolder root, IPath path)
    throws CVSException
  {
    if (root == this) {
      return path;
    }
    Assert.isTrue(!path.isEmpty());
    return getRelativePathFromRootRelativePath((ICVSFolder)root.getChild(path.segment(0)), path.removeFirstSegments(1));
  }
  
  public ICVSRemoteResource forTag(ICVSRemoteFolder parent, CVSTag tagName)
  {
    return new RemoteFolder((RemoteFolder)parent, getName(), repository, folderInfo.getRepository(), tagName, folderInfo.getIsStatic());
  }
  
  public ICVSRemoteResource forTag(CVSTag tagName)
  {
    return (ICVSRemoteFolder)forTag(null, tagName);
  }
  
  public boolean isDefinedModule()
  {
    return false;
  }
  
  public ResourceSyncInfo getSyncInfo()
  {
    return new ResourceSyncInfo(getName());
  }
  
  public byte[] getSyncBytes()
  {
    try
    {
      return folderInfo.getBytes();
    }
    catch (CVSException localCVSException) {}
    return null;
  }
  
  public String getContentIdentifier()
  {
    return getTag().getName();
  }
  
  public boolean isManaged()
  {
    return (super.isManaged()) && (isCVSFolder());
  }
  
  protected void fetchContents(IProgressMonitor monitor)
    throws TeamException
  {}
}

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

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.CVSMessages;
import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.internal.ccvs.core.CVSStatus;
import org.eclipse.team.internal.ccvs.core.CVSTag;
import org.eclipse.team.internal.ccvs.core.ICVSFile;
import org.eclipse.team.internal.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.ICVSRemoteResource;
import org.eclipse.team.internal.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.Policy;
import org.eclipse.team.internal.ccvs.core.client.Command;
import org.eclipse.team.internal.ccvs.core.client.Command.GlobalOption;
import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
import org.eclipse.team.internal.ccvs.core.client.Session;
import org.eclipse.team.internal.ccvs.core.client.Update;
import org.eclipse.team.internal.ccvs.core.client.listeners.IStatusListener;
import org.eclipse.team.internal.ccvs.core.client.listeners.IUpdateMessageListener;
import org.eclipse.team.internal.ccvs.core.client.listeners.UpdateListener;
import org.eclipse.team.internal.ccvs.core.connection.CVSServerException;
import org.eclipse.team.internal.ccvs.core.util.Util;

public class RemoteFolderMemberFetcher
  implements IUpdateMessageListener, IStatusListener
{
  private final RemoteFolder parentFolder;
  private CVSTag tag;
  List folders = new ArrayList();
  List files = new ArrayList();
  boolean exists = true;
  List exceptions = new ArrayList();
  
  protected RemoteFolderMemberFetcher(RemoteFolder parentFolder, CVSTag tag)
  {
    this.tag = tag;
    this.parentFolder = parentFolder;
  }
  
  public void fetchMembers(IProgressMonitor monitor)
    throws CVSException
  {
    fetchMembers(monitor, tag);
  }
  
  /* Error */
  public void fetchMembers(IProgressMonitor monitor, CVSTag tag)
    throws CVSException
  {
    // Byte code:
    //   0: aload_1
    //   1: invokestatic 371	org/eclipse/team/internal/ccvs/core/Policy:monitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   4: astore_3
    //   5: aload_3
    //   6: getstatic 342	org/eclipse/team/internal/ccvs/core/CVSMessages:RemoteFolder_getMembers	Ljava/lang/String;
    //   9: bipush 100
    //   11: invokeinterface 417 3 0
    //   16: aload_0
    //   17: invokevirtual 393	org/eclipse/team/internal/ccvs/core/resources/RemoteFolderMemberFetcher:updateParentFolderChildren	()V
    //   20: aload_0
    //   21: aload_3
    //   22: bipush 50
    //   24: invokestatic 372	org/eclipse/team/internal/ccvs/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   27: aload_2
    //   28: invokevirtual 401	org/eclipse/team/internal/ccvs/core/resources/RemoteFolderMemberFetcher:performUpdate	(Lorg/eclipse/core/runtime/IProgressMonitor;Lorg/eclipse/team/internal/ccvs/core/CVSTag;)Lorg/eclipse/core/runtime/IStatus;
    //   31: astore 4
    //   33: aload_0
    //   34: invokevirtual 393	org/eclipse/team/internal/ccvs/core/resources/RemoteFolderMemberFetcher:updateParentFolderChildren	()V
    //   37: aload_1
    //   38: invokestatic 370	org/eclipse/team/internal/ccvs/core/Policy:checkCanceled	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   41: aload_0
    //   42: aload 4
    //   44: getstatic 340	org/eclipse/team/internal/ccvs/core/CVSMessages:RemoteFolder_errorFetchingMembers	Ljava/lang/String;
    //   47: invokespecial 396	org/eclipse/team/internal/ccvs/core/resources/RemoteFolderMemberFetcher:performErrorCheck	(Lorg/eclipse/core/runtime/IStatus;Ljava/lang/String;)V
    //   50: aload_0
    //   51: invokevirtual 394	org/eclipse/team/internal/ccvs/core/resources/RemoteFolderMemberFetcher:getFiles	()[Lorg/eclipse/team/internal/ccvs/core/ICVSFile;
    //   54: astore 5
    //   56: aload 5
    //   58: arraylength
    //   59: ifle +18 -> 77
    //   62: aload_0
    //   63: aload 5
    //   65: aload_3
    //   66: bipush 50
    //   68: invokestatic 372	org/eclipse/team/internal/ccvs/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   71: invokevirtual 397	org/eclipse/team/internal/ccvs/core/resources/RemoteFolderMemberFetcher:updateFileRevisions	([Lorg/eclipse/team/internal/ccvs/core/ICVSFile;Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   74: goto +77 -> 151
    //   77: aload_3
    //   78: bipush 50
    //   80: invokeinterface 416 2 0
    //   85: goto +66 -> 151
    //   88: astore 4
    //   90: aload 4
    //   92: invokevirtual 382	org/eclipse/team/internal/ccvs/core/connection/CVSServerException:isNoTagException	()Z
    //   95: ifne +14 -> 109
    //   98: aload 4
    //   100: invokevirtual 381	org/eclipse/team/internal/ccvs/core/connection/CVSServerException:containsErrors	()Z
    //   103: ifeq +6 -> 109
    //   106: aload 4
    //   108: athrow
    //   109: aload_2
    //   110: ifnonnull +6 -> 116
    //   113: aload 4
    //   115: athrow
    //   116: aload_3
    //   117: invokestatic 370	org/eclipse/team/internal/ccvs/core/Policy:checkCanceled	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   120: aload_0
    //   121: aload_3
    //   122: bipush 50
    //   124: invokestatic 372	org/eclipse/team/internal/ccvs/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   127: aconst_null
    //   128: invokevirtual 398	org/eclipse/team/internal/ccvs/core/resources/RemoteFolderMemberFetcher:fetchMembers	(Lorg/eclipse/core/runtime/IProgressMonitor;Lorg/eclipse/team/internal/ccvs/core/CVSTag;)V
    //   131: aload_3
    //   132: invokeinterface 415 1 0
    //   137: goto +20 -> 157
    //   140: astore 6
    //   142: aload_3
    //   143: invokeinterface 415 1 0
    //   148: aload 6
    //   150: athrow
    //   151: aload_3
    //   152: invokeinterface 415 1 0
    //   157: return
    // Line number table:
    //   Java source line #56	-> byte code offset #0
    //   Java source line #57	-> byte code offset #5
    //   Java source line #60	-> byte code offset #16
    //   Java source line #62	-> byte code offset #20
    //   Java source line #64	-> byte code offset #33
    //   Java source line #65	-> byte code offset #37
    //   Java source line #68	-> byte code offset #41
    //   Java source line #71	-> byte code offset #50
    //   Java source line #72	-> byte code offset #56
    //   Java source line #73	-> byte code offset #62
    //   Java source line #75	-> byte code offset #77
    //   Java source line #77	-> byte code offset #88
    //   Java source line #78	-> byte code offset #90
    //   Java source line #79	-> byte code offset #106
    //   Java source line #80	-> byte code offset #109
    //   Java source line #81	-> byte code offset #113
    //   Java source line #85	-> byte code offset #116
    //   Java source line #86	-> byte code offset #120
    //   Java source line #88	-> byte code offset #131
    //   Java source line #87	-> byte code offset #140
    //   Java source line #88	-> byte code offset #142
    //   Java source line #89	-> byte code offset #148
    //   Java source line #88	-> byte code offset #151
    //   Java source line #90	-> byte code offset #157
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	158	0	this	RemoteFolderMemberFetcher
    //   0	158	1	monitor	IProgressMonitor
    //   0	158	2	tag	CVSTag
    //   4	148	3	progress	IProgressMonitor
    //   31	12	4	status	IStatus
    //   88	26	4	e	CVSServerException
    //   54	10	5	remoteFiles	ICVSFile[]
    //   140	9	6	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   16	85	88	org/eclipse/team/internal/ccvs/core/connection/CVSServerException
    //   16	131	140	finally
  }
  
  protected IStatus performUpdate(IProgressMonitor progress, CVSTag tag)
    throws CVSException
  {
    progress.beginTask(null, 100);
    Session session = new Session(parentFolder.getRepository(), parentFolder, false);
    session.open(Policy.subMonitorFor(progress, 10), false);
    try
    {
      List localOptions = new ArrayList();
      localOptions.add(Update.RETRIEVE_ABSENT_DIRECTORIES);
      if (tag != null) {
        localOptions.add(Update.makeTagOption(tag));
      }
      return Command.UPDATE.execute(
        session, 
        new Command.GlobalOption[] { Command.DO_NOT_CHANGE }, 
        (Command.LocalOption[])localOptions.toArray(new Command.LocalOption[localOptions.size()]), 
        new ICVSResource[] { parentFolder }, 
        new UpdateListener(this), 
        Policy.subMonitorFor(progress, 90));
    }
    finally
    {
      session.close();
    }
  }
  
  /* Error */
  protected void updateFileRevisions(ICVSFile[] files, IProgressMonitor monitor)
    throws CVSException
  {
    // Byte code:
    //   0: aload_2
    //   1: invokestatic 371	org/eclipse/team/internal/ccvs/core/Policy:monitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   4: astore_2
    //   5: aload_2
    //   6: aconst_null
    //   7: bipush 100
    //   9: invokeinterface 417 3 0
    //   14: invokestatic 366	org/eclipse/team/internal/ccvs/core/CVSProviderPlugin:getPlugin	()Lorg/eclipse/team/internal/ccvs/core/CVSProviderPlugin;
    //   17: invokevirtual 367	org/eclipse/team/internal/ccvs/core/CVSProviderPlugin:getQuietness	()Lorg/eclipse/team/internal/ccvs/core/client/Command$QuietOption;
    //   20: astore_3
    //   21: invokestatic 366	org/eclipse/team/internal/ccvs/core/CVSProviderPlugin:getPlugin	()Lorg/eclipse/team/internal/ccvs/core/CVSProviderPlugin;
    //   24: getstatic 346	org/eclipse/team/internal/ccvs/core/client/Command:VERBOSE	Lorg/eclipse/team/internal/ccvs/core/client/Command$QuietOption;
    //   27: invokevirtual 368	org/eclipse/team/internal/ccvs/core/CVSProviderPlugin:setQuietness	(Lorg/eclipse/team/internal/ccvs/core/client/Command$QuietOption;)V
    //   30: new 181	org/eclipse/team/internal/ccvs/core/client/Session
    //   33: dup
    //   34: aload_0
    //   35: getfield 355	org/eclipse/team/internal/ccvs/core/resources/RemoteFolderMemberFetcher:parentFolder	Lorg/eclipse/team/internal/ccvs/core/resources/RemoteFolder;
    //   38: invokevirtual 388	org/eclipse/team/internal/ccvs/core/resources/RemoteFolder:getRepository	()Lorg/eclipse/team/internal/ccvs/core/ICVSRepositoryLocation;
    //   41: aload_0
    //   42: getfield 355	org/eclipse/team/internal/ccvs/core/resources/RemoteFolderMemberFetcher:parentFolder	Lorg/eclipse/team/internal/ccvs/core/resources/RemoteFolder;
    //   45: iconst_0
    //   46: invokespecial 375	org/eclipse/team/internal/ccvs/core/client/Session:<init>	(Lorg/eclipse/team/internal/ccvs/core/ICVSRepositoryLocation;Lorg/eclipse/team/internal/ccvs/core/ICVSFolder;Z)V
    //   49: astore 4
    //   51: aload 4
    //   53: aload_2
    //   54: bipush 10
    //   56: invokestatic 372	org/eclipse/team/internal/ccvs/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   59: iconst_0
    //   60: invokevirtual 374	org/eclipse/team/internal/ccvs/core/client/Session:open	(Lorg/eclipse/core/runtime/IProgressMonitor;Z)V
    //   63: getstatic 347	org/eclipse/team/internal/ccvs/core/client/Command:STATUS	Lorg/eclipse/team/internal/ccvs/core/client/Status;
    //   66: aload 4
    //   68: getstatic 344	org/eclipse/team/internal/ccvs/core/client/Command:NO_GLOBAL_OPTIONS	[Lorg/eclipse/team/internal/ccvs/core/client/Command$GlobalOption;
    //   71: getstatic 345	org/eclipse/team/internal/ccvs/core/client/Command:NO_LOCAL_OPTIONS	[Lorg/eclipse/team/internal/ccvs/core/client/Command$LocalOption;
    //   74: aload_1
    //   75: new 186	org/eclipse/team/internal/ccvs/core/client/listeners/StatusListener
    //   78: dup
    //   79: aload_0
    //   80: invokespecial 379	org/eclipse/team/internal/ccvs/core/client/listeners/StatusListener:<init>	(Lorg/eclipse/team/internal/ccvs/core/client/listeners/IStatusListener;)V
    //   83: aload_2
    //   84: bipush 90
    //   86: invokestatic 372	org/eclipse/team/internal/ccvs/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   89: invokevirtual 376	org/eclipse/team/internal/ccvs/core/client/Status:execute	(Lorg/eclipse/team/internal/ccvs/core/client/Session;[Lorg/eclipse/team/internal/ccvs/core/client/Command$GlobalOption;[Lorg/eclipse/team/internal/ccvs/core/client/Command$LocalOption;[Lorg/eclipse/team/internal/ccvs/core/ICVSResource;Lorg/eclipse/team/internal/ccvs/core/client/listeners/ICommandOutputListener;Lorg/eclipse/core/runtime/IProgressMonitor;)Lorg/eclipse/core/runtime/IStatus;
    //   92: astore 5
    //   94: aload_0
    //   95: aload 5
    //   97: getstatic 341	org/eclipse/team/internal/ccvs/core/CVSMessages:RemoteFolder_errorFetchingRevisions	Ljava/lang/String;
    //   100: invokespecial 396	org/eclipse/team/internal/ccvs/core/resources/RemoteFolderMemberFetcher:performErrorCheck	(Lorg/eclipse/core/runtime/IStatus;Ljava/lang/String;)V
    //   103: goto +13 -> 116
    //   106: astore 6
    //   108: aload 4
    //   110: invokevirtual 373	org/eclipse/team/internal/ccvs/core/client/Session:close	()V
    //   113: aload 6
    //   115: athrow
    //   116: aload 4
    //   118: invokevirtual 373	org/eclipse/team/internal/ccvs/core/client/Session:close	()V
    //   121: goto +15 -> 136
    //   124: astore 7
    //   126: invokestatic 366	org/eclipse/team/internal/ccvs/core/CVSProviderPlugin:getPlugin	()Lorg/eclipse/team/internal/ccvs/core/CVSProviderPlugin;
    //   129: aload_3
    //   130: invokevirtual 368	org/eclipse/team/internal/ccvs/core/CVSProviderPlugin:setQuietness	(Lorg/eclipse/team/internal/ccvs/core/client/Command$QuietOption;)V
    //   133: aload 7
    //   135: athrow
    //   136: invokestatic 366	org/eclipse/team/internal/ccvs/core/CVSProviderPlugin:getPlugin	()Lorg/eclipse/team/internal/ccvs/core/CVSProviderPlugin;
    //   139: aload_3
    //   140: invokevirtual 368	org/eclipse/team/internal/ccvs/core/CVSProviderPlugin:setQuietness	(Lorg/eclipse/team/internal/ccvs/core/client/Command$QuietOption;)V
    //   143: return
    // Line number table:
    //   Java source line #117	-> byte code offset #0
    //   Java source line #118	-> byte code offset #5
    //   Java source line #119	-> byte code offset #14
    //   Java source line #121	-> byte code offset #21
    //   Java source line #122	-> byte code offset #30
    //   Java source line #123	-> byte code offset #51
    //   Java source line #125	-> byte code offset #63
    //   Java source line #126	-> byte code offset #66
    //   Java source line #127	-> byte code offset #68
    //   Java source line #128	-> byte code offset #71
    //   Java source line #129	-> byte code offset #74
    //   Java source line #130	-> byte code offset #75
    //   Java source line #131	-> byte code offset #83
    //   Java source line #125	-> byte code offset #89
    //   Java source line #132	-> byte code offset #94
    //   Java source line #134	-> byte code offset #106
    //   Java source line #135	-> byte code offset #108
    //   Java source line #136	-> byte code offset #113
    //   Java source line #135	-> byte code offset #116
    //   Java source line #137	-> byte code offset #124
    //   Java source line #138	-> byte code offset #126
    //   Java source line #139	-> byte code offset #133
    //   Java source line #138	-> byte code offset #136
    //   Java source line #140	-> byte code offset #143
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	144	0	this	RemoteFolderMemberFetcher
    //   0	144	1	files	ICVSFile[]
    //   0	144	2	monitor	IProgressMonitor
    //   20	120	3	quietness	org.eclipse.team.internal.ccvs.core.client.Command.QuietOption
    //   49	68	4	session	Session
    //   92	4	5	status	IStatus
    //   106	8	6	localObject1	Object
    //   124	10	7	localObject2	Object
    // Exception table:
    //   from	to	target	type
    //   63	106	106	finally
    //   21	124	124	finally
  }
  
  private void performErrorCheck(IStatus status, String errorTitle)
    throws CVSException
  {
    if (status.getCode() == -10)
    {
      if (folders.size() + files.size() == 0) {
        throw new CVSServerException(status);
      }
      CVSProviderPlugin.log(new CVSServerException(status));
    }
    if (!exists)
    {
      IStatus notExistStatus = new CVSStatus(4, -17, NLS.bind(CVSMessages.RemoteFolder_doesNotExist, new String[] { parentFolder.getRepositoryRelativePath() }), parentFolder);
      throw new CVSException(notExistStatus);
    }
    if (!exceptions.isEmpty())
    {
      if (exceptions.size() == 1) {
        throw ((CVSException)exceptions.get(0));
      }
      MultiStatus multi = new MultiStatus("org.eclipse.team.cvs.core", 0, errorTitle, null);
      for (int i = 0; i < exceptions.size(); i++) {
        multi.merge(((CVSException)exceptions.get(i)).getStatus());
      }
      throw new CVSException(multi);
    }
  }
  
  public void directoryInformation(ICVSFolder commandRoot, String stringPath, boolean newDirectory)
  {
    try
    {
      IPath path = parentFolder.getRelativePathFromRootRelativePath(commandRoot, new Path(null, stringPath));
      if (path.segmentCount() == 1)
      {
        String pathName = path.lastSegment();
        if (!pathName.equals(".")) {
          recordFolder(path.lastSegment());
        }
      }
    }
    catch (CVSException e)
    {
      exceptions.add(e);
    }
  }
  
  public void directoryDoesNotExist(ICVSFolder parent, String stringPath)
  {
    try
    {
      IPath path = parentFolder.getRelativePathFromRootRelativePath(parent, new Path(null, stringPath));
      if (path.isEmpty()) {
        parentDoesNotExist();
      }
    }
    catch (CVSException e)
    {
      exceptions.add(e);
    }
  }
  
  public void fileInformation(int type, ICVSFolder parent, String filename)
  {
    try
    {
      IPath filePath = new Path(null, filename);
      filePath = parentFolder.getRelativePathFromRootRelativePath(parent, filePath);
      if (filePath.segmentCount() == 1)
      {
        String properFilename = filePath.lastSegment();
        recordFile(properFilename);
      }
    }
    catch (CVSException e)
    {
      exceptions.add(e);
    }
  }
  
  public void fileDoesNotExist(ICVSFolder parent, String filename) {}
  
  public void fileStatus(ICVSFolder commandRoot, String path, String remoteRevision)
  {
    if (remoteRevision == "") {
      return;
    }
    try
    {
      ((RemoteFile)parentFolder.getChild(Util.getLastSegment(path))).setRevision(remoteRevision);
    }
    catch (CVSException e)
    {
      exceptions.add(e);
    }
  }
  
  protected RemoteFolder recordFolder(String name)
  {
    RemoteFolder folder = new RemoteFolder(
      parentFolder, 
      parentFolder.getRepository(), 
      Util.appendPath(parentFolder.getRepositoryRelativePath(), name), 
      tag);
    folders.add(folder);
    return folder;
  }
  
  protected RemoteFile recordFile(String name)
  {
    RemoteFile file = new RemoteFile(
      parentFolder, 
      0, 
      name, 
      null, 
      null, 
      tag);
    files.add(file);
    return file;
  }
  
  protected void parentDoesNotExist()
  {
    exists = false;
  }
  
  protected void updateParentFolderChildren()
  {
    parentFolder.setChildren(getFetchedChildren());
  }
  
  protected ICVSFile[] getFiles()
  {
    return (ICVSFile[])files.toArray(new ICVSFile[files.size()]);
  }
  
  public ICVSRemoteResource[] getFetchedChildren()
  {
    ICVSRemoteResource[] resources = new ICVSRemoteResource[folders.size() + files.size()];
    int count = 0;
    for (Iterator iter = folders.iterator(); iter.hasNext();)
    {
      ICVSRemoteResource resource = (ICVSRemoteResource)iter.next();
      resources[(count++)] = resource;
    }
    for (Iterator iter = files.iterator(); iter.hasNext();)
    {
      ICVSRemoteResource resource = (ICVSRemoteResource)iter.next();
      resources[(count++)] = resource;
    }
    return resources;
  }
}

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

import java.util.ArrayList;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.CVSTag;
import org.eclipse.team.internal.ccvs.core.ICVSFile;
import org.eclipse.team.internal.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.ICVSRemoteResource;
import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
import org.eclipse.team.internal.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.ICVSResourceVisitor;
import org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation;

public class RemoteFolderSandbox
  extends RemoteFolder
{
  public RemoteFolderSandbox(RemoteFolder parent, ICVSRepositoryLocation repository, String repositoryRelativePath, CVSTag tag)
  {
    super(parent, repository, repositoryRelativePath, tag);
    setChildren(new ICVSRemoteResource[0]);
  }
  
  public RemoteFolderSandbox(RemoteFolder parent, String name, CVSRepositoryLocation repository, String repositoryRelativePath, CVSEntryLineTag tag, boolean isStatic)
  {
    super(parent, name, repository, repositoryRelativePath, tag, isStatic);
    setChildren(new ICVSRemoteResource[0]);
  }
  
  public ICVSFile getFile(String name)
    throws CVSException
  {
    try
    {
      return super.getFile(name);
    }
    catch (CVSException e)
    {
      if (e.getStatus().getCode() == 1000)
      {
        IPath path = new Path(null, name);
        String fileName = path.lastSegment();
        RemoteFolderSandbox parent = getParentFolder(path);
        RemoteFile file = new RemoteFile(parent, 0, fileName, null, null, getTag());
        parent.addChild(file);
        return file;
      }
      throw e;
    }
  }
  
  private void addChild(RemoteResource resource)
  {
    ICVSRemoteResource[] children = getChildren();
    ICVSRemoteResource[] newChildren = new ICVSRemoteResource[children.length + 1];
    System.arraycopy(children, 0, newChildren, 0, children.length);
    newChildren[children.length] = resource;
    setChildren(newChildren);
  }
  
  private RemoteFolderSandbox getParentFolder(IPath path)
    throws CVSException
  {
    IPath parentPath = path.removeLastSegments(1);
    String parentString;
    String parentString;
    if (parentPath.isEmpty()) {
      parentString = ".";
    } else {
      parentString = path.removeLastSegments(1).toString();
    }
    RemoteFolderSandbox parent = (RemoteFolderSandbox)getFolder(parentString);
    return parent;
  }
  
  public ICVSFolder getFolder(String name)
    throws CVSException
  {
    try
    {
      return super.getFolder(name);
    }
    catch (CVSException e)
    {
      if (e.getStatus().getCode() == 1000)
      {
        IPath path = new Path(null, name);
        RemoteFolderSandbox parent = getParentFolder(path);
        String repoPath = new Path(null, parent.getRepositoryRelativePath()).append(path.lastSegment()).removeTrailingSeparator().toString();
        RemoteFolderSandbox folder = new RemoteFolderSandbox(parent, getRepository(), repoPath, getTag());
        parent.addChild(folder);
        return folder;
      }
      throw e;
    }
  }
  
  public ICVSRemoteResource[] getMembers(IProgressMonitor monitor)
    throws TeamException
  {
    return getChildren();
  }
  
  public void acceptChildren(ICVSResourceVisitor visitor)
    throws CVSException
  {
    ICVSRemoteResource[] children = getChildren();
    if (children == null) {
      return;
    }
    for (int i = 0; i < children.length; i++) {
      children[i].accept(visitor);
    }
  }
  
  public void remove(RemoteFile file)
  {
    ICVSRemoteResource[] children = getChildren();
    ArrayList results = new ArrayList();
    for (int i = 0; i < children.length; i++) {
      if (children[i] != file) {
        results.add(children[i]);
      }
    }
    setChildren((ICVSRemoteResource[])results.toArray(new ICVSRemoteResource[results.size()]));
  }
}

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

import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.CVSTag;
import org.eclipse.team.internal.ccvs.core.ICVSRemoteResource;
import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
import org.eclipse.team.internal.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.ICVSResourceVisitor;
import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
import org.eclipse.team.internal.ccvs.core.util.KnownRepositories;

public class RemoteFolderTree
  extends RemoteFolder
{
  public static RemoteFolderTree fromBytes(RemoteFolderTree parent, IResource local, byte[] bytes)
    throws CVSException
  {
    Assert.isNotNull(bytes);
    Assert.isTrue(local.getType() != 1);
    FolderSyncInfo syncInfo = FolderSyncInfo.getFolderSyncInfo(bytes);
    return new RemoteFolderTree(parent, local.getName(), KnownRepositories.getInstance().getRepository(syncInfo.getRoot()), syncInfo.getRepository(), syncInfo.getTag(), syncInfo.getIsStatic());
  }
  
  public RemoteFolderTree(RemoteFolder parent, ICVSRepositoryLocation repository, String repositoryRelativePath, CVSTag tag)
  {
    super(parent, repository, repositoryRelativePath, tag);
  }
  
  public RemoteFolderTree(RemoteFolder parent, String name, ICVSRepositoryLocation repository, String repositoryRelativePath, CVSTag tag)
  {
    this(parent, name, repository, repositoryRelativePath, tag, false);
  }
  
  public RemoteFolderTree(RemoteFolder parent, String name, ICVSRepositoryLocation repository, String repositoryRelativePath, CVSTag tag, boolean isStatic)
  {
    super(parent, name, repository, repositoryRelativePath, tag, isStatic);
  }
  
  public ICVSRemoteResource[] getMembers(CVSTag tagName, IProgressMonitor monitor)
    throws CVSException
  {
    if (getChildren() == null) {
      setChildren(super.getMembers(tagName, monitor));
    }
    return getChildren();
  }
  
  public void setChildren(ICVSRemoteResource[] children)
  {
    super.setChildren(children);
  }
  
  public void acceptChildren(ICVSResourceVisitor visitor)
    throws CVSException
  {
    ICVSRemoteResource[] children = getChildren();
    if (children == null) {
      return;
    }
    for (int i = 0; i < children.length; i++) {
      children[i].accept(visitor);
    }
  }
}

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

import java.util.List;
import java.util.Map;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.internal.ccvs.core.CVSMessages;
import org.eclipse.team.internal.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.client.listeners.IUpdateMessageListener;
import org.eclipse.team.internal.ccvs.core.util.Util;

class RemoteFolderTreeBuilder$1
  implements IUpdateMessageListener
{
  final RemoteFolderTreeBuilder this$0;
  private final IProgressMonitor val$monitor;
  
  RemoteFolderTreeBuilder$1(RemoteFolderTreeBuilder paramRemoteFolderTreeBuilder, IProgressMonitor paramIProgressMonitor)
  {
    this$0 = paramRemoteFolderTreeBuilder;val$monitor = paramIProgressMonitor;
  }
  
  public void directoryInformation(ICVSFolder root, String path, boolean newDirectory)
  {
    if (newDirectory)
    {
      RemoteFolderTreeBuilder.access$1(this$0, path, RemoteFolderTreeBuilder.access$0(), 0);
      val$monitor.subTask(NLS.bind(CVSMessages.RemoteFolderTreeBuilder_receivingDelta, new String[] { Util.toTruncatedPath(path, 3) }));
    }
  }
  
  public void directoryDoesNotExist(ICVSFolder root, String path)
  {
    if (path.length() == 0)
    {
      RemoteFolderTreeBuilder.access$2(this$0, true);
    }
    else
    {
      RemoteFolderTreeBuilder.access$1(this$0, path, RemoteFolderTreeBuilder.access$3(), 0);
      val$monitor.subTask(NLS.bind(CVSMessages.RemoteFolderTreeBuilder_receivingDelta, new String[] { Util.toTruncatedPath(path, 3) }));
    }
  }
  
  public void fileInformation(int type, ICVSFolder root, String filename)
  {
    switch (type)
    {
    case 6: 
    case 7: 
      Map deltas = (Map)RemoteFolderTreeBuilder.access$4(this$0).get(Util.removeLastSegment(filename));
      RemoteFolderTreeBuilder.DeltaNode d = deltas != null ? (RemoteFolderTreeBuilder.DeltaNode)deltas.get(Util.getLastSegment(filename)) : null;
      if ((d != null) && (d.getRevision() == RemoteFolderTreeBuilder.access$3())) {
        break;
      }
    case 3: 
    case 4: 
      RemoteFolderTreeBuilder.access$5(this$0).add(filename);
      RemoteFolderTreeBuilder.access$1(this$0, filename, RemoteFolderTreeBuilder.access$6(), type);
      val$monitor.subTask(NLS.bind(CVSMessages.RemoteFolderTreeBuilder_receivingDelta, new String[] { Util.toTruncatedPath(filename, 3) }));
    }
  }
  
  public void fileDoesNotExist(ICVSFolder root, String filename)
  {
    RemoteFolderTreeBuilder.access$1(this$0, filename, RemoteFolderTreeBuilder.access$3(), 0);
    val$monitor.subTask(NLS.bind(CVSMessages.RemoteFolderTreeBuilder_receivingDelta, new String[] { Util.toTruncatedPath(filename, 3) }));
  }
}

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

import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.internal.ccvs.core.CVSMessages;
import org.eclipse.team.internal.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.client.listeners.IUpdateMessageListener;
import org.eclipse.team.internal.ccvs.core.util.Util;

class RemoteFolderTreeBuilder$2
  implements IUpdateMessageListener
{
  final RemoteFolderTreeBuilder this$0;
  private final IProgressMonitor val$monitor;
  
  RemoteFolderTreeBuilder$2(RemoteFolderTreeBuilder paramRemoteFolderTreeBuilder, IProgressMonitor paramIProgressMonitor)
  {
    this$0 = paramRemoteFolderTreeBuilder;val$monitor = paramIProgressMonitor;
  }
  
  public void directoryInformation(ICVSFolder root, String path, boolean newDirectory)
  {
    if (newDirectory)
    {
      RemoteFolderTreeBuilder.access$1(this$0, path, RemoteFolderTreeBuilder.access$0(), 0);
      val$monitor.subTask(NLS.bind(CVSMessages.RemoteFolderTreeBuilder_receivingDelta, new String[] { Util.toTruncatedPath(path, 3) }));
    }
  }
  
  public void directoryDoesNotExist(ICVSFolder root, String path) {}
  
  public void fileInformation(int type, ICVSFolder root, String filename)
  {
    RemoteFolderTreeBuilder.access$5(this$0).add(filename);
    RemoteFolderTreeBuilder.access$1(this$0, filename, RemoteFolderTreeBuilder.access$7(), type);
    val$monitor.subTask(NLS.bind(CVSMessages.RemoteFolderTreeBuilder_receivingDelta, new String[] { Util.toTruncatedPath(filename, 3) }));
  }
  
  public void fileDoesNotExist(ICVSFolder root, String filename) {}
}

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

import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.CVSMessages;
import org.eclipse.team.internal.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.client.listeners.IStatusListener;
import org.eclipse.team.internal.ccvs.core.util.Util;

class RemoteFolderTreeBuilder$3
  implements IStatusListener
{
  final RemoteFolderTreeBuilder this$0;
  private final IProgressMonitor val$monitor;
  private final List val$exceptions;
  
  RemoteFolderTreeBuilder$3(RemoteFolderTreeBuilder paramRemoteFolderTreeBuilder, IProgressMonitor paramIProgressMonitor, List paramList)
  {
    this$0 = paramRemoteFolderTreeBuilder;val$monitor = paramIProgressMonitor;val$exceptions = paramList;
  }
  
  public void fileStatus(ICVSFolder root, String path, String remoteRevision)
  {
    try
    {
      RemoteFolderTreeBuilder.access$8(this$0, path, remoteRevision);
      val$monitor.subTask(NLS.bind(CVSMessages.RemoteFolderTreeBuilder_receivingRevision, new String[] { Util.toTruncatedPath(path, 3) }));
    }
    catch (CVSException e)
    {
      val$exceptions.add(e);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.ccvs.core.resources.RemoteFolderTreeBuilder.3
 * Java Class Version: 1.2 (4
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