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

 this.setStaticDirectory = setStaticDirectory;
  }
  
  public String getResponseID()
  {
    if (setStaticDirectory) {
      return "Set-static-directory";
    }
    return "Clear-static-directory";
  }
  
  public void handle(Session session, String localDir, IProgressMonitor monitor)
    throws CVSException
  {
    String repositoryDir = session.readLine();
    
    Assert.isTrue(repositoryDir.endsWith("/"));
    repositoryDir = repositoryDir.substring(0, repositoryDir.length() - 1);
    try
    {
      ICVSFolder folder = createFolder(session, localDir, repositoryDir);
      FolderSyncInfo syncInfo = folder.getFolderSyncInfo();
      if (syncInfo == null) {
        return;
      }
      MutableFolderSyncInfo newInfo = syncInfo.cloneMutable();
      newInfo.setStatic(setStaticDirectory);
      if (!syncInfo.equals(newInfo)) {
        folder.setFolderSyncInfo(newInfo);
      }
    }
    catch (CVSException e)
    {
      if (!handleInvalidResourceName(session, session.getLocalRoot().getFolder(localDir), e)) {
        throw e;
      }
    }
  }
}

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

public class Status
  extends AbstractMessageCommand
{
  protected String getRequestId()
  {
    return "status";
  }
}

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

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.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.resources.CVSEntryLineTag;
import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo;
import org.eclipse.team.internal.ccvs.core.syncinfo.MutableFolderSyncInfo;

class StickyHandler
  extends ResponseHandler
{
  private final boolean setSticky;
  
  public StickyHandler(boolean setSticky)
  {
    this.setSticky = setSticky;
  }
  
  public String getResponseID()
  {
    if (setSticky) {
      return "Set-sticky";
    }
    return "Clear-sticky";
  }
  
  public void handle(Session session, String localDir, IProgressMonitor monitor)
    throws CVSException
  {
    String repositoryDir = session.readLine();
    String tag = null;
    if (setSticky)
    {
      tag = session.readLine();
      if ((tag != null) && (tag.length() == 0)) {
        tag = null;
      }
    }
    Assert.isTrue(repositoryDir.endsWith("/"));
    repositoryDir = repositoryDir.substring(0, repositoryDir.length() - 1);
    try
    {
      ICVSFolder folder = createFolder(session, localDir, repositoryDir);
      FolderSyncInfo syncInfo = folder.getFolderSyncInfo();
      if (syncInfo == null) {
        return;
      }
      MutableFolderSyncInfo newInfo = syncInfo.cloneMutable();
      newInfo.setTag(tag != null ? new CVSEntryLineTag(tag) : null);
      if ((tag != null) && (tag.equals("TBASE"))) {
        newInfo.setTag(syncInfo.getTag());
      }
      if (!syncInfo.equals(newInfo)) {
        folder.setFolderSyncInfo(newInfo);
      }
    }
    catch (CVSException e)
    {
      if (!handleInvalidResourceName(session, session.getLocalRoot().getFolder(localDir), e)) {
        throw e;
      }
    }
  }
}

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

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.ICVSResource;

public class SyncUpdate
  extends Update
{
  protected void sendFileStructure(Session session, ICVSResource[] resources, Command.LocalOption[] localOptions, boolean emptyFolders, IProgressMonitor monitor)
    throws CVSException
  {
    checkResourcesManaged(session, resources);
    new FileStructureVisitor(session, localOptions, emptyFolders, true, false).visit(session, resources, monitor);
  }
  
  protected boolean isWorkspaceModification()
  {
    return false;
  }
  
  protected Command.GlobalOption[] filterGlobalOptions(Session session, Command.GlobalOption[] globalOptions)
  {
    if (!Command.DO_NOT_CHANGE.isElementOf(globalOptions)) {
      globalOptions = Command.DO_NOT_CHANGE.addToEnd(globalOptions);
    }
    return super.filterGlobalOptions(session, globalOptions);
  }
}

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

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.CVSMessages;
import org.eclipse.team.internal.ccvs.core.CVSStatus;
import org.eclipse.team.internal.ccvs.core.CVSTag;
import org.eclipse.team.internal.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.client.listeners.ICommandOutputListener;
import org.eclipse.team.internal.ccvs.core.client.listeners.TagListener;

public class Tag
  extends Command
{
  public static final Command.LocalOption CREATE_BRANCH = new Command.LocalOption("-b", null);
  public static final Command.LocalOption FORCE_REASSIGNMENT = new Command.LocalOption("-F", null);
  private static final ICommandOutputListener DEFAULT_OUTPUT_LISTENER = new TagListener();
  private boolean customBehaviorEnabled;
  
  protected Tag(boolean customBehaviorEnabled)
  {
    this.customBehaviorEnabled = customBehaviorEnabled;
  }
  
  protected Tag()
  {
    this(false);
  }
  
  protected String getRequestId()
  {
    return "tag";
  }
  
  protected ICVSResource[] computeWorkResources(Session session, Command.LocalOption[] localOptions, String[] arguments)
    throws CVSException
  {
    if (arguments.length < 1) {
      throw new IllegalArgumentException();
    }
    String[] allButFirst = new String[arguments.length - 1];
    System.arraycopy(arguments, 1, allButFirst, 0, arguments.length - 1);
    return super.computeWorkResources(session, localOptions, allButFirst);
  }
  
  public IStatus execute(Session session, Command.GlobalOption[] globalOptions, Command.LocalOption[] localOptions, CVSTag tag, String[] arguments, ICommandOutputListener listener, IProgressMonitor monitor)
    throws CVSException
  {
    if ((tag.getType() != 2) && (tag.getType() != 1)) {
      throw new CVSException(new CVSStatus(4, CVSMessages.Tag_notVersionOrBranchError));
    }
    if ((tag.getType() == 1) && 
      (!CREATE_BRANCH.isElementOf(localOptions)))
    {
      Command.LocalOption[] newLocalOptions = new Command.LocalOption[localOptions.length + 1];
      System.arraycopy(localOptions, 0, newLocalOptions, 0, localOptions.length);
      newLocalOptions[(newLocalOptions.length - 1)] = CREATE_BRANCH;
      localOptions = newLocalOptions;
    }
    String[] newArguments = new String[arguments.length + 1];
    newArguments[0] = tag.getName();
    System.arraycopy(arguments, 0, newArguments, 1, arguments.length);
    
    return execute(session, globalOptions, localOptions, newArguments, listener, monitor);
  }
  
  public IStatus execute(Session session, Command.GlobalOption[] globalOptions, Command.LocalOption[] localOptions, CVSTag tag, ICVSResource[] arguments, ICommandOutputListener listener, IProgressMonitor monitor)
    throws CVSException
  {
    String[] stringArguments = convertArgumentsForOpenSession(arguments, session);
    
    return execute(session, globalOptions, localOptions, tag, stringArguments, listener, monitor);
  }
  
  protected ICommandOutputListener getDefaultCommandOutputListener()
  {
    return DEFAULT_OUTPUT_LISTENER;
  }
  
  protected ICVSResource[] sendLocalResourceState(Session session, Command.GlobalOption[] globalOptions, Command.LocalOption[] localOptions, ICVSResource[] resources, IProgressMonitor monitor)
    throws CVSException
  {
    if (customBehaviorEnabled) {
      new TagFileSender(session, localOptions).visit(session, resources, monitor);
    } else {
      new FileStructureVisitor(session, localOptions, false, false).visit(session, resources, monitor);
    }
    return resources;
  }
}

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

import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.ICVSFile;
import org.eclipse.team.internal.ccvs.core.Policy;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;

class TagFileSender
  extends FileStructureVisitor
{
  public TagFileSender(Session session, Command.LocalOption[] localOptions)
  {
    super(session, localOptions, false, false);
  }
  
  protected void sendFile(ICVSFile mFile)
    throws CVSException
  {
    Policy.checkCanceled(monitor);
    byte[] syncBytes = mFile.getSyncBytes();
    if (syncBytes != null)
    {
      sendFolder(mFile.getParent());
      if (ResourceSyncInfo.isDeletion(syncBytes)) {
        syncBytes = ResourceSyncInfo.convertFromDeletion(syncBytes);
      }
      if (!ResourceSyncInfo.isAddition(syncBytes))
      {
        session.sendEntry(syncBytes, ResourceSyncInfo.getTimestampToServer(syncBytes, mFile.getTimeStamp()));
        session.sendIsModified(mFile, ResourceSyncInfo.isBinary(syncBytes), monitor);
      }
    }
  }
}

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

import java.io.ByteArrayInputStream;
import java.io.InputStream;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.ICVSStorage;

class TemplateHandler$1
  implements ICVSStorage
{
  final TemplateHandler this$0;
  
  TemplateHandler$1(TemplateHandler paramTemplateHandler)
  {
    this$0 = paramTemplateHandler;
  }
  
  public String getName()
  {
    return "Template";
  }
  
  /* Error */
  public void setContents(InputStream stream, int responseType, boolean keepLocalHistory, org.eclipse.core.runtime.IProgressMonitor monitor)
    throws CVSException
  {
    // Byte code:
    //   0: new 42	java/io/ByteArrayOutputStream
    //   3: dup
    //   4: invokespecial 73	java/io/ByteArrayOutputStream:<init>	()V
    //   7: astore 5
    //   9: sipush 1024
    //   12: newarray <illegal type>
    //   14: astore 6
    //   16: goto +18 -> 34
    //   19: aload 4
    //   21: invokestatic 80	org/eclipse/team/internal/ccvs/core/Policy:checkCanceled	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   24: aload 5
    //   26: aload 6
    //   28: iconst_0
    //   29: iload 7
    //   31: invokevirtual 77	java/io/OutputStream:write	([BII)V
    //   34: aload_1
    //   35: aload 6
    //   37: invokevirtual 75	java/io/InputStream:read	([B)I
    //   40: dup
    //   41: istore 7
    //   43: ifge -24 -> 19
    //   46: goto +13 -> 59
    //   49: astore 8
    //   51: aload 5
    //   53: invokevirtual 76	java/io/OutputStream:close	()V
    //   56: aload 8
    //   58: athrow
    //   59: aload 5
    //   61: invokevirtual 76	java/io/OutputStream:close	()V
    //   64: goto +24 -> 88
    //   67: astore 5
    //   69: aload 5
    //   71: invokestatic 79	org/eclipse/team/internal/ccvs/core/CVSException:wrapException	(Ljava/lang/Exception;)Lorg/eclipse/team/internal/ccvs/core/CVSException;
    //   74: athrow
    //   75: astore 9
    //   77: aload_1
    //   78: invokevirtual 74	java/io/InputStream:close	()V
    //   81: goto +4 -> 85
    //   84: pop
    //   85: aload 9
    //   87: athrow
    //   88: aload_1
    //   89: invokevirtual 74	java/io/InputStream:close	()V
    //   92: goto +4 -> 96
    //   95: pop
    //   96: return
    // Line number table:
    //   Java source line #72	-> byte code offset #0
    //   Java source line #74	-> byte code offset #9
    //   Java source line #76	-> byte code offset #16
    //   Java source line #77	-> byte code offset #19
    //   Java source line #78	-> byte code offset #24
    //   Java source line #76	-> byte code offset #34
    //   Java source line #80	-> byte code offset #49
    //   Java source line #81	-> byte code offset #51
    //   Java source line #82	-> byte code offset #56
    //   Java source line #81	-> byte code offset #59
    //   Java source line #83	-> byte code offset #67
    //   Java source line #84	-> byte code offset #69
    //   Java source line #85	-> byte code offset #75
    //   Java source line #87	-> byte code offset #77
    //   Java source line #88	-> byte code offset #84
    //   Java source line #91	-> byte code offset #85
    //   Java source line #87	-> byte code offset #88
    //   Java source line #88	-> byte code offset #95
    //   Java source line #92	-> byte code offset #96
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	97	0	this	1
    //   0	97	1	stream	InputStream
    //   0	97	2	responseType	int
    //   0	97	3	keepLocalHistory	boolean
    //   0	97	4	monitor	org.eclipse.core.runtime.IProgressMonitor
    //   7	53	5	out	java.io.OutputStream
    //   67	3	5	e	java.io.IOException
    //   14	22	6	buffer	byte[]
    //   19	11	7	read	int
    //   41	3	7	read	int
    //   49	8	8	localObject1	Object
    //   75	11	9	localObject2	Object
    //   84	1	12	localIOException1	java.io.IOException
    //   95	1	13	localIOException2	java.io.IOException
    // Exception table:
    //   from	to	target	type
    //   9	49	49	finally
    //   0	64	67	java/io/IOException
    //   0	75	75	finally
    //   77	81	84	java/io/IOException
    //   88	92	95	java/io/IOException
  }
  
  public long getSize()
  {
    return 0L;
  }
  
  public InputStream getContents()
    throws CVSException
  {
    return new ByteArrayInputStream(new byte[0]);
  }
}

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

import java.io.ByteArrayInputStream;
import java.io.InputStream;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.internal.ccvs.core.CVSStatus;
import org.eclipse.team.internal.ccvs.core.ICVSFile;
import org.eclipse.team.internal.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.ICVSStorage;
import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot;
import org.eclipse.team.internal.ccvs.core.util.SyncFileWriter;

public class TemplateHandler
  extends ResponseHandler
{
  public String getResponseID()
  {
    return "Template";
  }
  
  public void handle(Session session, String localDir, IProgressMonitor monitor)
    throws CVSException
  {
    session.readLine();
    
    ICVSFolder localFolder = session.getLocalRoot().getFolder(localDir);
    IContainer container = (IContainer)localFolder.getIResource();
    ICVSStorage templateFile = null;
    if ((container != null) && (container.exists())) {
      try
      {
        templateFile = CVSWorkspaceRoot.getCVSFileFor(SyncFileWriter.getTemplateFile(container));
      }
      catch (CVSException e)
      {
        CVSProviderPlugin.log(new CVSStatus(4, 4, "Could not write template file in " + container.getFullPath() + ": " + e.getMessage(), e, session.getLocalRoot()));
      }
    }
    if ((container == null) || (templateFile == null)) {
      templateFile = new ICVSStorage()
      {
        public String getName()
        {
          return "Template";
        }
        
        /* Error */
        public void setContents(InputStream stream, int responseType, boolean keepLocalHistory, IProgressMonitor monitor)
          throws CVSException
        {
          // Byte code:
          //   0: new 42	java/io/ByteArrayOutputStream
          //   3: dup
          //   4: invokespecial 73	java/io/ByteArrayOutputStream:<init>	()V
          //   7: astore 5
          //   9: sipush 1024
          //   12: newarray <illegal type>
          //   14: astore 6
          //   16: goto +18 -> 34
          //   19: aload 4
          //   21: invokestatic 80	org/eclipse/team/internal/ccvs/core/Policy:checkCanceled	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
          //   24: aload 5
          //   26: aload 6
          //   28: iconst_0
          //   29: iload 7
          //   31: invokevirtual 77	java/io/OutputStream:write	([BII)V
          //   34: aload_1
          //   35: aload 6
          //   37: invokevirtual 75	java/io/InputStream:read	([B)I
          //   40: dup
          //   41: istore 7
          //   43: ifge -24 -> 19
          //   46: goto +13 -> 59
          //   49: astore 8
          //   51: aload 5
          //   53: invokevirtual 76	java/io/OutputStream:close	()V
          //   56: aload 8
          //   58: athrow
          //   59: aload 5
          //   61: invokevirtual 76	java/io/OutputStream:close	()V
          //   64: goto +24 -> 88
          //   67: astore 5
          //   69: aload 5
          //   71: invokestatic 79	org/eclipse/team/internal/ccvs/core/CVSException:wrapException	(Ljava/lang/Exception;)Lorg/eclipse/team/internal/ccvs/core/CVSException;
          //   74: athrow
          //   75: astore 9
          //   77: aload_1
          //   78: invokevirtual 74	java/io/InputStream:close	()V
          //   81: goto +4 -> 85
          //   84: pop
          //   85: aload 9
          //   87: athrow
          //   88: aload_1
          //   89: invokevirtual 74	java/io/InputStream:close	()V
          //   92: goto +4 -> 96
          //   95: pop
          //   96: return
          // Line number table:
          //   Java source line #72	-> byte code offset #0
          //   Java source line #74	-> byte code offset #9
          //   Java source line #76	-> byte code offset #16
          //   Java source line #77	-> byte code offset #19
          //   Java source line #78	-> byte code offset #24
          //   Java source line #76	-> byte code offset #34
          //   Java source line #80	-> byte code offset #49
          //   Java source line #81	-> byte code offset #51
          //   Java source line #82	-> byte code offset #56
          //   Java source line #81	-> byte code offset #59
          //   Java source line #83	-> byte code offset #67
          //   Java source line #84	-> byte code offset #69
          //   Java source line #85	-> byte code offset #75
          //   Java source line #87	-> byte code offset #77
          //   Java source line #88	-> byte code offset #84
          //   Java source line #91	-> byte code offset #85
          //   Java source line #87	-> byte code offset #88
          //   Java source line #88	-> byte code offset #95
          //   Java source line #92	-> byte code offset #96
          // Local variable table:
          //   start	length	slot	name	signature
          //   0	97	0	this	1
          //   0	97	1	stream	InputStream
          //   0	97	2	responseType	int
          //   0	97	3	keepLocalHistory	boolean
          //   0	97	4	monitor	IProgressMonitor
          //   7	53	5	out	java.io.OutputStream
          //   67	3	5	e	java.io.IOException
          //   14	22	6	buffer	byte[]
          //   19	11	7	read	int
          //   41	3	7	read	int
          //   49	8	8	localObject1	Object
          //   75	11	9	localObject2	Object
          //   84	1	12	localIOException1	java.io.IOException
          //   95	1	13	localIOException2	java.io.IOException
          // Exception table:
          //   from	to	target	type
          //   9	49	49	finally
          //   0	64	67	java/io/IOException
          //   0	75	75	finally
          //   77	81	84	java/io/IOException
          //   88	92	95	java/io/IOException
        }
        
        public long getSize()
        {
          return 0L;
        }
        
        public InputStream getContents()
          throws CVSException
        {
          return new ByteArrayInputStream(new byte[0]);
        }
      };
    }
    try
    {
      session.receiveFile(templateFile, false, 1, monitor);
    }
    catch (CVSException e)
    {
      if ((!(templateFile instanceof ICVSFile)) || (!handleInvalidResourceName(session, (ICVSFile)templateFile, e))) {
        throw e;
      }
    }
  }
}

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

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.core.RepositoryProvider;
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.CVSTeamProvider;
import org.eclipse.team.internal.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.client.listeners.ICommandOutputListener;
import org.eclipse.team.internal.ccvs.core.client.listeners.UpdateListener;

public class Update
  extends Command
{
  public static final Command.LocalOption CLEAR_STICKY = new Command.LocalOption("-A");
  public static final Command.LocalOption IGNORE_LOCAL_CHANGES = new Command.LocalOption("-C");
  public static final Command.LocalOption RETRIEVE_ABSENT_DIRECTORIES = new Command.LocalOption("-d");
  public static final Command.LocalOption JOIN = new Command.LocalOption("-j");
  private static final ICommandOutputListener DEFAULT_OUTPUT_LISTENER = new UpdateListener(null);
  public static final int STATE_NONE = 0;
  public static final int STATE_ADDED_LOCAL = 1;
  public static final int STATE_UNKOWN = 2;
  public static final int STATE_REMOTE_CHANGES = 3;
  public static final int STATE_DELETED = 4;
  public static final int STATE_MODIFIED = 5;
  public static final int STATE_CONFLICT = 6;
  public static final int STATE_MERGEABLE_CONFLICT = 7;
  
  public static Command.LocalOption makeTagOption(CVSTag tag)
  {
    int type = tag.getType();
    switch (type)
    {
    case 0: 
      return CLEAR_STICKY;
    }
    return Command.makeTagOption(tag);
  }
  
  protected String getRequestId()
  {
    return "update";
  }
  
  protected ICommandOutputListener getDefaultCommandOutputListener()
  {
    return DEFAULT_OUTPUT_LISTENER;
  }
  
  protected ICVSResource[] sendLocalResourceState(Session session, Command.GlobalOption[] globalOptions, Command.LocalOption[] localOptions, ICVSResource[] resources, IProgressMonitor monitor)
    throws CVSException
  {
    sendFileStructure(session, resources, localOptions, true, monitor);
    return resources;
  }
  
  protected IStatus commandFinished(Session session, Command.GlobalOption[] globalOptions, Command.LocalOption[] localOptions, ICVSResource[] resources, IProgressMonitor monitor, IStatus status)
    throws CVSException
  {
    if (status.getCode() == -10) {
      return status;
    }
    if (PRUNE_EMPTY_DIRECTORIES.isElementOf(localOptions)) {
      new PruneFolderVisitor().visit(session, resources);
    }
    return status;
  }
  
  protected Command.LocalOption[] filterLocalOptions(Session session, Command.GlobalOption[] globalOptions, Command.LocalOption[] localOptions)
  {
    List newOptions = new ArrayList(Arrays.asList(localOptions));
    if ((shouldRetrieveAbsentDirectories(session)) && (!RETRIEVE_ABSENT_DIRECTORIES.isElementOf(localOptions))) {
      newOptions.add(RETRIEVE_ABSENT_DIRECTORIES);
    }
    if ((CVSProviderPlugin.getPlugin().getPruneEmptyDirectories()) && (!PRUNE_EMPTY_DIRECTORIES.isElementOf(localOptions)) && 
      (!DO_NOT_CHANGE.isElementOf(globalOptions))) {
      newOptions.add(Command.PRUNE_EMPTY_DIRECTORIES);
    }
    localOptions = (Command.LocalOption[])newOptions.toArray(new Command.LocalOption[newOptions.size()]);
    return super.filterLocalOptions(session, globalOptions, localOptions);
  }
  
  protected boolean shouldRetrieveAbsentDirectories(Session session)
  {
    IResource resource = null;
    RepositoryProvider provider = null;
    try
    {
      resource = session.getLocalRoot().getIResource();
      if (resource != null)
      {
        provider = RepositoryProvider.getProvider(resource.getProject(), CVSProviderPlugin.getTypeId());
        if ((provider != null) && 
          (((CVSTeamProvider)provider).getFetchAbsentDirectories())) {
          return true;
        }
      }
    }
    catch (CVSException e)
    {
      CVSProviderPlugin.log(e);
      if ((provider == null) && 
        (CVSProviderPlugin.getPlugin().getFetchAbsentDirectories())) {
        return true;
      }
    }
    return false;
  }
  
  protected void checkResourcesManaged(Session session, ICVSResource[] resources)
    throws CVSException
  {
    for (int i = 0; i < resources.length; i++)
    {
      ICVSFolder folder;
      ICVSFolder folder;
      if (resources[i].isFolder())
      {
        ICVSFolder folder;
        if (((ICVSFolder)resources[i]).isCVSFolder()) {
          folder = (ICVSFolder)resources[i];
        } else {
          folder = resources[i].getParent();
        }
      }
      else
      {
        folder = resources[i].getParent();
      }
      if ((folder == null) || ((!folder.isCVSFolder()) && (folder.exists())))
      {
        if (folder == null) {
          folder = (ICVSFolder)resources[i];
        }
        IStatus status = new CVSStatus(4, 4, NLS.bind(CVSMessages.Command_argumentNotManaged, new String[] { folder.getName() }), session.getLocalRoot());
        throw new CVSException(status);
      }
    }
  }
  
  protected IStatus doExecute(Session session, Command.GlobalOption[] globalOptions, Command.LocalOption[] localOptions, String[] arguments, ICommandOutputListener listener, IProgressMonitor monitor)
    throws CVSException
  {
    session.setIgnoringLocalChanges(IGNORE_LOCAL_CHANGES.isElementOf(localOptions));
    try
    {
      return super.doExecute(
        session, 
        globalOptions, 
        localOptions, 
        arguments, 
        listener, 
        monitor);
    }
    finally
    {
      session.setIgnoringLocalChanges(false);
    }
  }
}

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

import java.util.Date;
import java.util.List;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.ICVSFile;
import org.eclipse.team.internal.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;

public class UpdateMergableOnly$MergableOnlyUpdatedHandler
  extends UpdatedHandler
{
  final UpdateMergableOnly this$0;
  
  public UpdateMergableOnly$MergableOnlyUpdatedHandler(UpdateMergableOnly paramUpdateMergableOnly)
  {
    super(2);
    this$0 = paramUpdateMergableOnly;
  }
  
  protected ICVSFile getTargetFile(ICVSFolder mParent, String fileName, byte[] entryBytes)
    throws CVSException
  {
    String adjustedFileName = fileName;
    if (ResourceSyncInfo.isMergedWithConflicts(entryBytes))
    {
      adjustedFileName = ".##" + adjustedFileName + " " + ResourceSyncInfo.getRevision(entryBytes);
      this$0.skippedFiles.add(((IContainer)mParent.getIResource()).getFile(new Path(null, fileName)));
    }
    return super.getTargetFile(mParent, adjustedFileName, entryBytes);
  }
  
  protected void receiveTargetFile(Session session, ICVSFile mFile, String entryLine, Date modTime, boolean binary, boolean readOnly, boolean executable, IProgressMonitor monitor)
    throws CVSException
  {
    if (ResourceSyncInfo.isMergedWithConflicts(entryLine.getBytes()))
    {
      session.receiveFile(mFile, binary, 1, monitor);
      
      mFile.delete();
    }
    else
    {
      super.receiveTargetFile(session, mFile, entryLine, modTime, binary, readOnly, executable, monitor);
    }
  }
}

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

import java.util.List;
import java.util.Map;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.internal.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
import org.eclipse.team.internal.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.client.listeners.IUpdateMessageListener;
import org.eclipse.team.internal.ccvs.core.client.listeners.ServerMessageLineMatcher;
import org.eclipse.team.internal.ccvs.core.client.listeners.UpdateListener;

public class UpdateMergableOnly$MergeUpdateListener
  extends UpdateListener
{
  final UpdateMergableOnly this$0;
  
  public UpdateMergableOnly$MergeUpdateListener(UpdateMergableOnly paramUpdateMergableOnly, IUpdateMessageListener updateMessageListener)
  {
    super(updateMessageListener);
    this$0 = paramUpdateMergableOnly;
  }
  
  public IStatus errorLine(String line, ICVSRepositoryLocation location, ICVSFolder commandRoot, IProgressMonitor monitor)
  {
    Map variables = UpdateMergableOnly.access$0().processServerMessage(line);
    if (variables != null)
    {
      String filePath = (String)variables.get("localFilePath");
      try
      {
        ICVSResource cvsResource = commandRoot.getChild(filePath);
        IResource resource = cvsResource.getIResource();
        if ((resource != null) && (resource.getType() == 1))
        {
          this$0.skippedFiles.add(resource);
          return OK;
        }
      }
      catch (CVSException e)
      {
        CVSProviderPlugin.log(e);
      }
    }
    return super.errorLine(line, location, commandRoot, monitor);
  }
}

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

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
import org.eclipse.team.internal.ccvs.core.ICVSFile;
import org.eclipse.team.internal.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
import org.eclipse.team.internal.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.client.listeners.ICommandOutputListener;
import org.eclipse.team.internal.ccvs.core.client.listeners.IMessagePatterns;
import org.eclipse.team.internal.ccvs.core.client.listeners.IUpdateMessageListener;
import org.eclipse.team.internal.ccvs.core.client.listeners.ServerMessageLineMatcher;
import org.eclipse.team.internal.ccvs.core.client.listeners.UpdateListener;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;

public class UpdateMergableOnly
  extends Update
{
  private static final String LOCAL_FILE_PATH_VARIABLE_NAME = "localFilePath";
  private static ServerMessageLineMatcher MERGE_UPDATE_CONFLICTING_ADDITION_MATCHER;
  
  static {}
  
  public static void initializePatterns()
  {
    try
    {
      MERGE_UPDATE_CONFLICTING_ADDITION_MATCHER = new ServerMessageLineMatcher(
        IMessagePatterns.MERGE_UPDATE_CONFLICTING_ADDITION, new String[] { "localFilePath" });
    }
    catch (CVSException e)
    {
      CVSProviderPlugin.log(e);
    }
  }
  
  List skippedFiles = new ArrayList();
  
  public class MergableOnlyUpdatedHandler
    extends UpdatedHandler
  {
    public MergableOnlyUpdatedHandler()
    {
      super();
    }
    
    protected ICVSFile getTargetFile(ICVSFolder mParent, String fileName, byte[] entryBytes)
      throws CVSException
    {
      String adjustedFileName = fileName;
      if (ResourceSyncInfo.isMergedWithConflicts(entryBytes))
      {
        adjustedFileName = ".##" + adjustedFileName + " " + ResourceSyncInfo.getRevision(entryBytes);
        skippedFiles.add(((IContainer)mParent.getIResource()).getFile(new Path(null, fileName)));
      }
      return super.getTargetFile(mParent, adjustedFileName, entryBytes);
    }
    
    protected void receiveTargetFile(Session session, ICVSFile mFile, String entryLine, Date modTime, boolean binary, boolean readOnly, boolean executable, IProgressMonitor monitor)
      throws CVSException
    {
      if (ResourceSyncInfo.isMergedWithConflicts(entryLine.getBytes()))
      {
        session.receiveFile(mFile, binary, 1, monitor);
        
        mFile.delete();
      }
      else
      {
        super.receiveTargetFile(session, mFile, entryLine, modTime, binary, readOnly, executable, monitor);
      }
    }
  }
  
  public class MergeUpdateListener
    extends UpdateListener
  {
    public MergeUpdateListener(IUpdateMessageListener updateMessageListener)
    {
      super();
    }
    
    public IStatus errorLine(String line, ICVSRepositoryLocation location, ICVSFolder commandRoot, IProgressMonitor monitor)
    {
      Map variables = UpdateMergableOnly.MERGE_UPDATE_CONFLICTING_ADDITION_MATCHER.processServerMessage(line);
      if (variables != null)
      {
        String filePath = (String)variables.get("localFilePath");
        try
        {
          ICVSResource cvsResource = commandRoot.getChild(filePath);
          IResource resource = cvsResource.getIResource();
          if ((resource != null) && (resource.getType() == 1))
          {
            skippedFiles.add(resource);
            return OK;
          }
        }
        catch (CVSException e)
        {
          CVSProviderPlugin.log(e);
        }
      }
      return super.errorLine(line, location, commandRoot, monitor);
    }
  }
  
  protected IStatus doExecute(Session session, Command.GlobalOption[] globalOptions, Command.LocalOption[] localOptions, String[] arguments, ICommandOutputListener listener, IProgressMonitor monitor)
    throws CVSException
  {
    MergableOnlyUpdatedHandler newHandler = new MergableOnlyUpdatedHandler();
    ResponseHandler oldHandler = session.getResponseHandler(newHandler.getResponseID());
    skippedFiles.clear();
    try
    {
      session.registerResponseHandler(newHandler);
      
      session.setCreateBackups(false);
      return super.doExecute(
        session, 
        globalOptions, 
        localOptions, 
        arguments, 
        new MergeUpdateListener(null), 
        monitor);
    }
    finally
    {
      session.registerResponseHandler(oldHandler);
      session.setCreateBackups(true);
    }
  }
  
  public IFile[] getSkippedFiles()
  {
    return (IFile[])skippedFiles.toArray(new IFile[skippedFiles.size()]);
  }
}

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

import java.util.Date;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;
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.resources.FileModificationManager;
import org.eclipse.team.internal.ccvs.core.syncinfo.MutableResourceSyncInfo;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;

public class UpdatedHandler
  extends ResponseHandler
{
  private int handlerType;
  public static final int HANDLE_UPDATED = 1;
  public static final int HANDLE_MERGED = 2;
  public static final int HANDLE_UPDATE_EXISTING = 3;
  public static final int HANDLE_CREATED = 4;
  private static final String READ_ONLY_FLAG = "u=rw";
  private static final String EXECUTE_FLAG = "x";
  
  public UpdatedHandler(int handlerType)
  {
    this.handlerType = handlerType;
  }
  
  public String getResponseID()
  {
    switch (handlerType)
    {
    case 1: 
      return "Updated";
    case 2: 
      return "Merged";
    case 3: 
      return "Update-existing";
    case 4: 
      return "Created";
    }
    return null;
  }
  
  public void handle(Session session, String localDir, IProgressMonitor monitor)
    throws CVSException
  {
    String repositoryFile = session.readLine();
    String entryLine = session.readLine();
    byte[] entryBytes = entryLine.getBytes();
    String permissionsLine = session.readLine();
    
    Date modTime = session.getModTime();
    session.setModTime(null);
    
    String fileName = repositoryFile.substring(repositoryFile.lastIndexOf("/") + 1);
    ICVSFolder mParent = getExistingFolder(session, localDir);
    ICVSFile mFile = getTargetFile(mParent, fileName, entryBytes);
    
    boolean binary = ResourceSyncInfo.isBinary(entryBytes);
    boolean readOnly = permissionsLine.indexOf("u=rw") == -1;
    boolean executable = permissionsLine.indexOf("x") != -1;
    try
    {
      if (mFile.isReadOnly()) {
        mFile.setReadOnly(false);
      }
    }
    catch (CVSException e)
    {
      CVSProviderPlugin.log(e);
    }
    try
    {
      receiveTargetFile(session, mFile, entryLine, modTime, binary, readOnly, executable, monitor);
    }
    catch (CVSException e)
    {
      if (!handleInvalidResourceName(session, mFile, e)) {
        throw e;
      }
    }
  }
  
  protected ICVSFile getTargetFile(ICVSFolder mParent, String fileName, byte[] entryBytes)
    throws CVSException
  {
    return mParent.getFile(fileName);
  }
  
  protected void receiveTargetFile(Session session, ICVSFile mFile, String entryLine, Date modTime, boolean binary, boolean readOnly, boolean executable, IProgressMonitor monitor)
    throws CVSException
  {
    session.receiveFile(mFile, binary, handlerType, monitor);
    
    mFile.setTimeStamp(modTime);
    modTime = mFile.getTimeStamp();
    ResourceSyncInfo info = new ResourceSyncInfo(entryLine, null);
    MutableResourceSyncInfo newInfoWithTimestamp = info.cloneMutable();
    newInfoWithTimestamp.setTimeStamp(modTime);
    
    CVSTag tag = newInfoWithTimestamp.getTag();
    if ((tag != null) && (CVSTag.BASE.getName().equals(tag.getName()))) {
      newInfoWithTimestamp.setTag(mFile.getSyncInfo().getTag());
    }
    int modificationState = 0;
    if (handlerType == 2)
    {
      newInfoWithTimestamp.setMerged();
    }
    else if ((!session.isIgnoringLocalChanges()) && 
      (!info.isAdded()) && (
      
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