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

, "1", 0);
        thisRevisionBranches.add(tag);
      }
      else if (thisRevisionBranches.size() == 0)
      {
        CVSTag cvsTag = new CVSTag(CVSTag.UNKNOWN_BRANCH, branchRevision, 1);
        thisRevisionBranches.add(cvsTag);
      }
      if (currentFile != null)
      {
        LogEntry entry = new LogEntry(currentFile, revision, author, creationDate, 
          internString(comment.toString()), fileState, 
          !thisRevisionTags.isEmpty() ? (CVSTag[])thisRevisionTags.toArray(new CVSTag[thisRevisionTags.size()]) : NO_TAGS, 
          !thisRevisionBranches.isEmpty() ? (CVSTag[])thisRevisionBranches.toArray(new CVSTag[thisRevisionBranches.size()]) : NO_TAGS, 
          !revisionVersions.isEmpty() ? (String[])revisionVersions.toArray(new String[revisionVersions.size()]) : NO_VERSIONS);
        addEntry(entry);
      }
      state = 0;
    }
    return OK;
  }
  
  private String getBranchRevision(String revision)
  {
    if ((revision.length() == 0) || (revision.lastIndexOf(".") == -1)) {
      throw new IllegalArgumentException(
        "Revision malformed: " + revision);
    }
    String branchNumber = revision.substring(0, revision.lastIndexOf("."));
    if ((branchNumber.lastIndexOf(".") == -1) || (branchNumber.equals("1.1.1"))) {
      return branchNumber;
    }
    String branchPrefix = branchNumber.substring(0, 
      branchNumber.lastIndexOf("."));
    branchPrefix = branchPrefix + ".0";
    branchPrefix = branchPrefix + branchNumber.substring(branchNumber.lastIndexOf("."));
    return branchPrefix;
  }
  
  protected void beginFile(ICVSRepositoryLocation location, String fileName)
  {
    currentFile = RemoteFile.create(fileName, location);
    versions.clear();
  }
  
  protected void addEntry(LogEntry entry)
  {
    listener.handleLogEntryReceived(entry);
  }
  
  protected void handleInvalidFileName(ICVSRepositoryLocation location, String badFilePath)
  {
    CVSProviderPlugin.log(2, "Invalid file path '" + badFilePath + "' received from " + location.toString(), null);
  }
  
  private Date convertFromLogTime(String modTime)
  {
    DateFormat format = LOG_DATE_FORMATTER;
    if ((modTime.length() > 4) && (modTime.charAt(4) == '/')) {
      format = LOG_DATE_FORMATTER_OLD;
    }
    try
    {
      return format.parse(modTime);
    }
    catch (ParseException localParseException) {}
    return null;
  }
  
  private String internAndCopyString(String string)
  {
    String internedString = (String)internedStrings.get(string);
    if (internedString == null)
    {
      internedString = new String(string);
      internedStrings.put(internedString, internedString);
    }
    return internedString;
  }
  
  private String internString(String string)
  {
    String internedString = (String)internedStrings.get(string);
    if (internedString == null)
    {
      internedString = string;
      internedStrings.put(internedString, internedString);
    }
    return internedString;
  }
  
  private static class VersionInfo
  {
    private final boolean isBranch;
    private String tagRevision;
    private String branchRevision;
    private final String tagName;
    
    public VersionInfo(String version, String tagName)
    {
      this.tagName = tagName;
      isBranch = isBranchTag(version);
      tagRevision = version;
      if (isBranch)
      {
        int lastDot = version.lastIndexOf('.');
        if (lastDot == -1)
        {
          CVSProviderPlugin.log(4, 
            NLS.bind(CVSMessages.LogListener_invalidRevisionFormat, new String[] { tagName, version }), null);
        }
        else
        {
          if ((version.charAt(lastDot - 1) == '0') && (version.charAt(lastDot - 2) == '.')) {
            lastDot -= 2;
          }
          branchRevision = version;
          tagRevision = version.substring(0, lastDot);
        }
      }
    }
    
    public String getTagName()
    {
      return tagName;
    }
    
    public String getTagRevision()
    {
      return tagRevision;
    }
    
    public boolean isBranch()
    {
      return isBranch;
    }
    
    private boolean isBranchTag(String tagName)
    {
      int numberOfDots = 0;
      int lastDot = 0;
      for (int i = 0; i < tagName.length(); i++) {
        if (tagName.charAt(i) == '.')
        {
          numberOfDots++;
          lastDot = i;
        }
      }
      if (numberOfDots % 2 == 0) {
        return true;
      }
      if (numberOfDots == 1) {
        return false;
      }
      if ((tagName.charAt(lastDot - 1) == '0') && (tagName.charAt(lastDot - 2) == '.')) {
        return true;
      }
      return false;
    }
    
    public String getBranchRevision()
    {
      return branchRevision;
    }
  }
}

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

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.team.internal.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
import org.eclipse.team.internal.ccvs.core.client.CommandOutputListener;

public class ModuleDefinitionsListener
  extends CommandOutputListener
{
  private String lastLine = "";
  private Map moduleMap;
  
  public ModuleDefinitionsListener()
  {
    reset();
  }
  
  public IStatus messageLine(String line, ICVSRepositoryLocation location, ICVSFolder commandRoot, IProgressMonitor monitor)
  {
    if (line.charAt(0) == ' ')
    {
      lastLine += line;
      line = lastLine;
    }
    else
    {
      lastLine = line;
    }
    int firstSpace = line.indexOf(" ");
    if (firstSpace > -1)
    {
      String module = line.substring(0, firstSpace);
      moduleMap.put(module, line);
    }
    return OK;
  }
  
  public String[] getModuleExpansions()
  {
    return (String[])moduleMap.values().toArray(new String[moduleMap.size()]);
  }
  
  public void reset()
  {
    moduleMap = new HashMap();
  }
}

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

public abstract interface RDiffSummaryListener$IFileDiffListener
{
  public abstract void fileDiff(String paramString1, String paramString2, String paramString3);
  
  public abstract void newFile(String paramString1, String paramString2);
  
  public abstract void deletedFile(String paramString1, String paramString2);
  
  public abstract void directory(String paramString);
}

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

import java.util.Map;
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.client.CommandOutputListener;

public class RDiffSummaryListener
  extends CommandOutputListener
{
  private static final String RIGHT_REVISION_VARIABLE_NAME = "rightRevision";
  private static final String LEFT_REVISION_VARIABLE_NAME = "leftRevision";
  private static final String REMOTE_FILE_PATH_VARIABLE_NAME = "remoteFilePath";
  private static final String REMOTE_FOLDER_PATH_VARIABLE_NAME = "remoteFolderPath";
  private IFileDiffListener listener;
  private static ServerMessageLineMatcher DIRECTORY_MATCHER;
  private static ServerMessageLineMatcher FILE_DIFF_MATCHER;
  private static ServerMessageLineMatcher NEW_FILE_MATCHER;
  private static ServerMessageLineMatcher DELETED_FILE_MATCHER;
  private static ServerMessageLineMatcher DELETED_FILE_MATCHER2;
  
  static {}
  
  public static void initializePatterns()
  {
    try
    {
      DIRECTORY_MATCHER = new ServerMessageLineMatcher(
        IMessagePatterns.RDIFF_DIRECTORY, new String[] { "remoteFolderPath" });
      FILE_DIFF_MATCHER = new ServerMessageLineMatcher(
        IMessagePatterns.RDIFF_SUMMARY_FILE_DIFF, new String[] { "remoteFilePath", "leftRevision", "rightRevision" });
      NEW_FILE_MATCHER = new ServerMessageLineMatcher(
        IMessagePatterns.RDIFF_SUMMARY_NEW_FILE, new String[] { "remoteFilePath", "rightRevision" });
      DELETED_FILE_MATCHER = new ServerMessageLineMatcher(
        IMessagePatterns.RDIFF_SUMMARY_DELETED_FILE, new String[] { "remoteFilePath" });
      DELETED_FILE_MATCHER2 = new ServerMessageLineMatcher(
        IMessagePatterns.RDIFF_SUMMARY_DELETED_FILE2, new String[] { "remoteFilePath", "leftRevision" });
    }
    catch (CVSException e)
    {
      CVSProviderPlugin.log(e);
    }
  }
  
  public RDiffSummaryListener(IFileDiffListener listener)
  {
    this.listener = listener;
  }
  
  public IStatus messageLine(String line, ICVSRepositoryLocation location, ICVSFolder commandRoot, IProgressMonitor monitor)
  {
    Map variables = FILE_DIFF_MATCHER.processServerMessage(line);
    if (variables != null)
    {
      listener.fileDiff(
        (String)variables.get("remoteFilePath"), 
        (String)variables.get("leftRevision"), 
        (String)variables.get("rightRevision"));
      return OK;
    }
    variables = NEW_FILE_MATCHER.processServerMessage(line);
    if (variables != null)
    {
      listener.newFile(
        (String)variables.get("remoteFilePath"), 
        (String)variables.get("rightRevision"));
      return OK;
    }
    variables = DELETED_FILE_MATCHER.processServerMessage(line);
    if (variables != null)
    {
      listener.deletedFile(
        (String)variables.get("remoteFilePath"), 
        null);
      return OK;
    }
    variables = DELETED_FILE_MATCHER2.processServerMessage(line);
    if (variables != null)
    {
      listener.deletedFile(
        (String)variables.get("remoteFilePath"), 
        (String)variables.get("leftRevision"));
      return OK;
    }
    return super.messageLine(line, location, commandRoot, monitor);
  }
  
  public IStatus errorLine(String line, ICVSRepositoryLocation location, ICVSFolder commandRoot, IProgressMonitor monitor)
  {
    Map variables = DIRECTORY_MATCHER.processServerMessage(line);
    if (variables != null)
    {
      listener.directory(
        (String)variables.get("remoteFolderPath"));
      return OK;
    }
    return super.errorLine(line, location, commandRoot, monitor);
  }
  
  public static abstract interface IFileDiffListener
  {
    public abstract void fileDiff(String paramString1, String paramString2, String paramString3);
    
    public abstract void newFile(String paramString1, String paramString2);
    
    public abstract void deletedFile(String paramString1, String paramString2);
    
    public abstract void directory(String paramString);
  }
}

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

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IStatus;
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.CVSStatus;

public class ServerMessageLineMatcher
{
  protected static final Pattern VARIABLE_MATCHING_PATTERN = Pattern.compile("(\\((\\w*):.*:\\2\\))");
  Pattern pattern;
  String[] variables;
  
  public ServerMessageLineMatcher(String template, String[] expectedVariables)
    throws CVSException
  {
    Matcher matcher = VARIABLE_MATCHING_PATTERN.matcher(template);
    List variables = new ArrayList();
    while (matcher.find())
    {
      if (matcher.groupCount() != 2)
      {
        IStatus status = new CVSStatus(4, NLS.bind(CVSMessages.ServerMessageLineMatcher_5, new String[] { template }));
        throw new CVSException(status);
      }
      variables.add(matcher.group(2));
    }
    ensureMatches(template, variables, expectedVariables);
    this.variables = ((String[])variables.toArray(new String[variables.size()]));
    for (Iterator iter = variables.iterator(); iter.hasNext();)
    {
      String element = (String)iter.next();
      template = template.replaceAll(element + ":", "");
      template = template.replaceAll(":" + element, "");
    }
    int count = 0;
    int start = -1;
    while ((start = template.indexOf('(', start + 1)) != -1) {
      count++;
    }
    if (count != variables.size())
    {
      IStatus status = new CVSStatus(4, NLS.bind(CVSMessages.ServerMessageLineMatcher_6, new String[] { template }));
      throw new CVSException(status);
    }
    pattern = Pattern.compile(template);
  }
  
  private void ensureMatches(String template, List variables, String[] expectedVariables)
    throws CVSException
  {
    for (int i = 0; i < expectedVariables.length; i++)
    {
      String expected = expectedVariables[i];
      if (!variables.contains(expected))
      {
        IStatus status = new CVSStatus(4, NLS.bind(CVSMessages.ServerMessageLineMatcher_7, new String[] { expected, template }));
        throw new CVSException(status);
      }
    }
  }
  
  public Map processServerMessage(String line)
  {
    Matcher matcher = pattern.matcher(line);
    if (!matcher.find()) {
      return null;
    }
    Assert.isTrue(matcher.groupCount() == variables.length);
    Map result = new HashMap();
    for (int i = 1; i <= matcher.groupCount(); i++) {
      result.put(variables[(i - 1)], matcher.group(i));
    }
    return result;
  }
}

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

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.team.internal.ccvs.core.CVSStatus;
import org.eclipse.team.internal.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
import org.eclipse.team.internal.ccvs.core.client.CommandOutputListener;
import org.eclipse.team.internal.ccvs.core.util.Util;

public class StatusListener
  extends CommandOutputListener
{
  private static boolean isFolder = false;
  private IStatusListener statusListener;
  
  public StatusListener(IStatusListener statusListener)
  {
    this.statusListener = statusListener;
  }
  
  public IStatus messageLine(String line, ICVSRepositoryLocation location, ICVSFolder commandRoot, IProgressMonitor monitor)
  {
    if ((line.startsWith("   Repository revision:")) && 
      (!line.startsWith("   Repository revision:\tNo revision control file")))
    {
      int separatingTabIndex = line.indexOf('\t', 24);
      String remoteRevision = line.substring(24, separatingTabIndex);
      
      String fileLocation = line.substring(separatingTabIndex + 1, line.length() - 2);
      
      statusListener.fileStatus(commandRoot, removeAtticSegment(fileLocation), remoteRevision);
    }
    return OK;
  }
  
  public IStatus errorLine(String line, ICVSRepositoryLocation location, ICVSFolder commandRoot, IProgressMonitor monitor)
  {
    String serverMessage = getServerMessage(line, location);
    if (serverMessage != null)
    {
      if (serverMessage.startsWith("conflict:")) {
        return new CVSStatus(2, -12, line, commandRoot);
      }
      if (serverMessage.startsWith("Examining"))
      {
        isFolder = true;
        return OK;
      }
    }
    if (isFolder) {
      isFolder = false;
    }
    return super.errorLine(line, location, commandRoot, monitor);
  }
  
  private String removeAtticSegment(String path)
  {
    return Util.removeAtticSegment(path);
  }
}

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

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.team.internal.ccvs.core.CVSStatus;
import org.eclipse.team.internal.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
import org.eclipse.team.internal.ccvs.core.client.CommandOutputListener;

public class TagListener
  extends CommandOutputListener
{
  public IStatus messageLine(String line, ICVSRepositoryLocation location, ICVSFolder commandRoot, IProgressMonitor monitor)
  {
    if ((line.length() >= 2) && (line.charAt(0) == 'W') && (line.charAt(1) == ' ')) {
      return new CVSStatus(4, -15, line.substring(2), commandRoot);
    }
    return OK;
  }
  
  public IStatus errorLine(String line, ICVSRepositoryLocation location, ICVSFolder commandRoot, IProgressMonitor monitor)
  {
    String serverMessage = getServerMessage(line, location);
    if ((serverMessage != null) && (serverMessage.startsWith("Tagging"))) {
      return OK;
    }
    String rtagMessage = getServerRTagMessage(line, location);
    if ((rtagMessage != null) && (rtagMessage.startsWith("Tagging"))) {
      return OK;
    }
    return super.errorLine(line, location, commandRoot, monitor);
  }
}

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

import java.io.PrintStream;
import java.util.Map;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
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.ICVSFile;
import org.eclipse.team.internal.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
import org.eclipse.team.internal.ccvs.core.client.CommandOutputListener;
import org.eclipse.team.internal.ccvs.core.util.Util;

public class UpdateListener
  extends CommandOutputListener
{
  private static ServerMessageLineMatcher MERGED_BINARY_FILE_LINE_1;
  private static ServerMessageLineMatcher MERGED_BINARY_FILE_LINE_2;
  private static final String REVISION_VARIABLE_NAME = "revision";
  private static final String LOCAL_FILE_PATH_VARIABLE_NAME = "localFilePath";
  private static final String BACKUP_FILE_VARIABLE_NAME = "backupFile";
  IUpdateMessageListener updateMessageListener;
  
  static
  {
    try
    {
      String line1 = "revision " + 
        Util.getVariablePattern(".*", "revision") + 
        " from repository is now in " + 
        Util.getVariablePattern(".*", "localFilePath");
      MERGED_BINARY_FILE_LINE_1 = new ServerMessageLineMatcher(
        line1, 
        new String[] { "revision", "localFilePath" });
      String line2 = "file from working directory is now in " + 
        Util.getVariablePattern(".*", "backupFile");
      MERGED_BINARY_FILE_LINE_2 = new ServerMessageLineMatcher(
        line2, 
        new String[] { "backupFile" });
    }
    catch (CVSException e)
    {
      CVSProviderPlugin.log(e);
    }
  }
  
  boolean merging = false;
  boolean mergingBinary = false;
  String mergedBinaryFileRevision;
  String mergedBinaryFilePath;
  
  public UpdateListener(IUpdateMessageListener updateMessageListener)
  {
    this.updateMessageListener = updateMessageListener;
  }
  
  public IStatus messageLine(String line, ICVSRepositoryLocation location, ICVSFolder commandRoot, IProgressMonitor monitor)
  {
    mergingBinary = false;
    if (updateMessageListener == null) {
      return OK;
    }
    if (line.startsWith("Merging differences"))
    {
      merging = true;
    }
    else if (line.indexOf(' ') == 1)
    {
      String path = line.substring(2);
      char changeType = line.charAt(0);
      
      int type = 0;
      switch (changeType)
      {
      case 'A': 
        type = 1; break;
      case '?': 
        type = 2; break;
      case 'U': 
        type = 3; break;
      case 'R': 
        type = 4; break;
      case 'M': 
        type = 5; break;
      case 'C': 
        type = 6; break;
      case 'D': 
        type = 4; break;
      default: 
        type = 0;
      }
      if (merging)
      {
        if (type == 5) {
          type = 7;
        }
        merging = false;
      }
      updateMessageListener.fileInformation(type, commandRoot, path);
    }
    return OK;
  }
  
  public IStatus errorLine(String line, ICVSRepositoryLocation location, ICVSFolder commandRoot, IProgressMonitor monitor)
  {
    try
    {
      boolean wasMergingBinary = mergingBinary;
      mergingBinary = false;
      String serverMessage = getServerMessage(line, location);
      if (serverMessage != null)
      {
        String message = serverMessage;
        if (message.startsWith("Updating"))
        {
          if (updateMessageListener != null)
          {
            String path = message.substring(9);
            updateMessageListener.directoryInformation(commandRoot, path, false);
          }
          return OK;
        }
        if (message.startsWith("skipping directory"))
        {
          if (updateMessageListener != null)
          {
            String path = message.substring(18).trim();
            updateMessageListener.directoryDoesNotExist(commandRoot, path);
          }
          return OK;
        }
        if (message.startsWith("New directory"))
        {
          if (updateMessageListener != null)
          {
            String path = message.substring(15, message.lastIndexOf('\''));
            updateMessageListener.directoryInformation(commandRoot, path, true);
          }
          return OK;
        }
        if (message.endsWith("is no longer in the repository"))
        {
          if (updateMessageListener != null)
          {
            String filename = message.substring(0, message.length() - 31);
            filename = stripQuotes(filename);
            updateMessageListener.fileDoesNotExist(commandRoot, filename);
          }
          return OK;
        }
        if (message.startsWith("conflict:"))
        {
          if ((updateMessageListener != null) && 
            (message.endsWith("is modified but no longer in the repository")))
          {
            String filename = message.substring(10, message.length() - 44);
            filename = stripQuotes(filename);
            updateMessageListener.fileDoesNotExist(commandRoot, filename);
          }
          return new CVSStatus(2, -12, line, commandRoot);
        }
        if (message.startsWith("warning:"))
        {
          if ((updateMessageListener != null) && 
            (message.endsWith("is not (any longer) pertinent")))
          {
            String filename = message.substring(9, message.length() - 30);
            updateMessageListener.fileDoesNotExist(commandRoot, filename);
          }
          return new CVSStatus(2, -12, line, commandRoot);
        }
        if (message.startsWith("conflicts")) {
          return new CVSStatus(1, -12, line, commandRoot);
        }
        if (message.startsWith("nonmergeable file needs merge"))
        {
          mergingBinary = true;
          mergedBinaryFileRevision = null;
          mergedBinaryFilePath = null;
          return OK;
        }
        if (wasMergingBinary)
        {
          Map variables = MERGED_BINARY_FILE_LINE_1.processServerMessage(message);
          if (variables != null)
          {
            mergedBinaryFileRevision = ((String)variables.get("revision"));
            mergedBinaryFilePath = ((String)variables.get("localFilePath"));
            mergingBinary = true;
            return OK;
          }
          variables = MERGED_BINARY_FILE_LINE_2.processServerMessage(message);
          if (variables != null)
          {
            String backupFile = (String)variables.get("backupFile");
            try
            {
              if ((mergedBinaryFileRevision != null) && (mergedBinaryFilePath != null))
              {
                ICVSFile file = commandRoot.getFile(mergedBinaryFilePath);
                IResource resource = file.getIResource();
                if (resource != null) {
                  return new CVSStatus(4, -26, 
                    NLS.bind(CVSMessages.UpdateListener_0, new Object[] {
                    resource.getFullPath().toString(), 
                    mergedBinaryFileRevision, 
                    resource.getFullPath().removeLastSegments(1).append(backupFile).toString() }), commandRoot);
                }
              }
            }
            catch (CVSException e1)
            {
              CVSProviderPlugin.log(e1);
            }
            return OK;
          }
        }
        if ((!message.startsWith("cannot open directory")) && 
          (!message.startsWith("nothing known about"))) {
          return super.errorLine(line, location, commandRoot, monitor);
        }
      }
      else
      {
        String serverAbortedMessage = getServerAbortedMessage(line, location);
        if (serverAbortedMessage != null)
        {
          String message = serverAbortedMessage;
          if (message.startsWith("no such tag")) {
            return new CVSStatus(2, -11, line, commandRoot);
          }
          if ((message.startsWith("Numeric join")) && (message.endsWith("may not contain a date specifier"))) {
            return super.errorLine(line, location, commandRoot, monitor);
          }
          return super.errorLine(line, location, commandRoot, monitor);
        }
        if (line.equals("rcsmerge: warning: conflicts during merge")) {
          return new CVSStatus(2, -12, line, commandRoot);
        }
      }
    }
    catch (StringIndexOutOfBoundsException localStringIndexOutOfBoundsException)
    {
      if (CVSProviderPlugin.getPlugin().isDebugging()) {
        System.out.println("Error parsing E line: " + line);
      }
      return new CVSStatus(4, -24, line, commandRoot);
    }
    return super.errorLine(line, location, commandRoot, monitor);
  }
  
  private String stripQuotes(String filename)
  {
    if ((filename.startsWith("`")) && (filename.endsWith("'"))) {
      filename = filename.substring(1, filename.length() - 1);
    }
    return filename;
  }
}

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

import org.eclipse.core.runtime.IStatus;
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.CVSStatus;
import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;

public class CVSAuthenticationException
  extends CVSException
{
  private static final long serialVersionUID = 1L;
  private int retryStatus = 0;
  public static final int RETRY = 1;
  public static final int NO_RETRY = 2;
  
  private CVSAuthenticationException(IStatus status)
  {
    super(status);
  }
  
  public CVSAuthenticationException(String detail, int retryStatus)
  {
    this(new CVSStatus(4, -30, NLS.bind(CVSMessages.CVSAuthenticationException_detail, new Object[] { detail }), null));
  }
  
  public CVSAuthenticationException(String detail, int retryStatus, ICVSRepositoryLocation cvsLocation)
  {
    this(new CVSStatus(4, -30, NLS.bind(CVSMessages.CVSAuthenticationException_detail, new Object[] { detail }), cvsLocation));
  }
  
  public CVSAuthenticationException(String detail, int retryStatus, ICVSRepositoryLocation cvsLocation, Exception e)
  {
    this(new CVSStatus(4, -30, NLS.bind(CVSMessages.CVSAuthenticationException_detail, new Object[] { detail }), e, cvsLocation));
  }
  
  public int getRetryStatus()
  {
    return retryStatus;
  }
}

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

import java.io.InterruptedIOException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
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.CVSStatus;
import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
import org.eclipse.team.internal.ccvs.core.Policy;

public class CVSCommunicationException
  extends CVSException
{
  private static final long serialVersionUID = 1L;
  
  private CVSCommunicationException(IStatus status)
  {
    super(status);
  }
  
  public CVSCommunicationException(String message)
  {
    super(message);
  }
  
  public CVSCommunicationException(String message, ICVSRepositoryLocation cvsLocation, Exception e)
  {
    this(new CVSStatus(4, -29, message, e, cvsLocation));
  }
  
  public CVSCommunicationException(ICVSRepositoryLocation cvsLocation, Exception e)
  {
    this(getStatusFor(e, cvsLocation));
  }
  
  private static IStatus getStatusFor(Exception e, ICVSRepositoryLocation cvsLocation)
  {
    if ((e instanceof InterruptedIOException))
    {
      MultiStatus status = new MultiStatus("org.eclipse.team.cvs.core", 0, getMessageFor(e), e);
      status.add(new CVSStatus(4, -29, CVSMessages.CVSCommunicationException_interruptCause, cvsLocation));
      status.add(new CVSStatus(4, -29, CVSMessages.CVSCommunicationException_interruptSolution, cvsLocation));
      status.add(new CVSStatus(4, -29, CVSMessages.CVSCommunicationException_alternateInterruptCause, cvsLocation));
      status.add(new CVSStatus(4, -29, CVSMessages.CVSCommunicationException_alternateInterruptSolution, cvsLocation));
      return status;
    }
    return new CVSStatus(4, -29, getMessageFor(e), e, cvsLocation);
  }
  
  public static String getMessageFor(Throwable throwable)
  {
    String message = Policy.getMessage(getMessageKey(throwable));
    if (message == null) {
      message = NLS.bind(CVSMessages.CVSCommunicationException_io, new Object[] { throwable.toString() });
    } else {
      message = NLS.bind(message, new Object[] { throwable.getMessage() });
    }
    return message;
  }
  
  private static String getMessageKey(Throwable t)
  {
    String name = t.getClass().getName();
    name = name.replace('.', '_');
    return name;
  }
}

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

import java.util.Comparator;
import org.eclipse.team.internal.ccvs.core.IConnectionMethod;

class CVSRepositoryLocation$1
  implements Comparator
{
  public int compare(Object o1, Object o2)
  {
    if (((o1 instanceof IConnectionMethod)) && ((o2 instanceof IConnectionMethod)))
    {
      IConnectionMethod cm1 = (IConnectionMethod)o1;
      IConnectionMethod cm2 = (IConnectionMethod)o2;
      return cm1.getName().compareTo(cm2.getName());
    }
    return 0;
  }
}

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

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.StringTokenizer;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.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.core.runtime.Platform;
import org.eclipse.core.runtime.PlatformObject;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.preferences.DefaultScope;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.equinox.security.storage.EncodingUtils;
import org.eclipse.equinox.security.storage.ISecurePreferences;
import org.eclipse.equinox.security.storage.SecurePreferencesFactory;
import org.eclipse.equinox.security.storage.StorageException;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.core.TeamException;
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.ICVSRemoteFile;
import org.eclipse.team.internal.ccvs.core.ICVSRemoteFolder;
import org.eclipse.team.internal.ccvs.core.ICVSRemoteResource;
import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation;
import org.eclipse.team.internal.ccvs.core.IConnectionMethod;
import org.eclipse.team.internal.ccvs.core.IUserAuthenticator;
import org.eclipse.team.internal.ccvs.core.IUserInfo;
import org.eclipse.team.internal.ccvs.core.resources.RemoteFile;
import org.eclipse.team.internal.ccvs.core.resources.RemoteFolder;
import org.eclipse.team.internal.ccvs.core.resources.RemoteFolderTree;
import org.eclipse.team.internal.ccvs.core.resources.RemoteModule;
import org.eclipse.team.internal.ccvs.core.util.KnownRepositories;
import org.osgi.service.prefs.BackingStoreException;
import org.osgi.service.prefs.Preferences;

public class CVSRepositoryLocation
  extends PlatformObject
  implements ICVSRepositoryLocation, IUserInfo
{
  private static final String cvsNameSegment = "/CVS/";
  private static final String PASSWORD_KEY = "password";
  private static final String USERNAME_KEY = "login";
  public static final String PREF_REPOSITORIES_NODE = "repositories";
  private static final String DEFAULT_REPOSITORY_SETTINGS_NODE = "default_repository_settings";
  public static final String PREF_LOCATION = "location";
  public static final String PREF_SERVER_ENCODING = "encoding";
  public static final int UNDETERMINED_PLATFORM = 0;
  public static final int CVS_SERVER = 1;
  public static final int CVSNT_SERVER = 2;
  public static final int UNSUPPORTED_SERVER = 3;
  public static final int UNKNOWN_SERVER = 4;
  private static IUserAuthenticator authenticator;
  private static IConnectionMethod[] pluggedInConnectionMethods = null;
  private static Map hostLocks = new HashMap();
  private IConnectionMethod method;
  private String user;
  private String password;
  private String host;
  private int port;
  private String root;
  private boolean userFixed;
  private boolean passwordFixed;
  private boolean allowCaching;
  private int serverPlatform = 0;
  public static final char COLON = ':';
  public static final char SEMICOLON = ';';
  public static final char HOST_SEPARATOR = '@';
  public static final char PORT_SEPARATOR = '#';
  public static final boolean STANDALONE_MODE = System.getProperty("eclipse.cvs.standalone") == null ? 
    false : Boolean.valueOf(System.getProperty("eclipse.cvs.standalone")).booleanValue();
  private static final String INVOKE_SVR_CMD = "server";
  public static final String INFO_PASSWORD = "org.eclipse.team.cvs.core.password";
  public static final String INFO_USERNAME = "org.eclipse.team.cvs.core.username";
  public static final String AUTH_SCHEME = "";
  public static final String USER_VARIABLE = "{user}";
  public static final String PASSWORD_VARIABLE = "{password}";
  public static final String HOST_VARIABLE = "{host}";
  public static final String PORT_VARIABLE = "{port}";
  private static String extProxy;
  private boolean previousAuthenticationFailed = false;
  
  public static Preferences getParentPreferences()
  {
    return CVSProviderPlugin.getPlugin().getInstancePreferences().node("repositories");
  }
  
  public static Preferences getDefaultPreferences()
  {
    Preferences defaults = new DefaultScope().getNode("org.eclipse.team.cvs.core").node("default_repository_settings");
    defaults.put("encoding", getDefaultEncoding());
    return defaults;
  }
  
  private static String getDefaultEncoding()
  {
    return System.getProperty("file.encoding", "UTF-8");
  }
  
  public static void setExtConnectionMethodProxy(String string)
  {
    extProxy = string;
  }
  
  public static CVSRepositoryLocation fromProperties(Properties configuration)
    throws CVSException
  {
    String connection = configuration.getProperty("connection");
    if (connection == null) {
      connection = "pserver";
    }
    IConnectionMethod method = getPluggedInConnectionMethod(connection);
    if (method == null) {
      throw new CVSException(new Status(4, "org.eclipse.team.cvs.core", -6, NLS.bind(CVSMessages.CVSRepositoryLocation_methods, new Object[] { getPluggedInConnectionMethodNames() }), null));
    }
    String user = configuration.getProperty("user");
    if (user.length() == 0) {
      user = null;
    }
    String password = configuration.getProperty("password");
    if (user == null) {
      password = null;
    }
    String host = configuration.getProperty("host");
    if (host == null) {
      throw new CVSException(new Status(4, "org.eclipse.team.cvs.core", -6, CVSMessages.CVSRepositoryLocation_hostRequired, null));
    }
    String portString = configuration.getProperty("port");
    int port;
    int port;
    if (portString == null) {
      port = 0;
    } else {
      port = Integer.parseInt(portString);
    }
    String root = configuration.getProperty("root");
    if (root == null) {
      throw new CVSException(new Status(4, "org.eclipse.team.cvs.core", -6, CVSMessages.CVSRepositoryLocation_rootRequired, null));
    }
    String encoding = configuration.getProperty("encoding");
    
    return new CVSRepositoryLocation(method, user, password, host, port, root, encoding, user != null, false);
  }
  
  public static CVSRepositoryLocation fromString(String location)
    throws CVSException
  {
    try
    {
      return fromString(location, false);
    }
    catch (CVSException e)
    {
      MultiStatus error = new MultiStatus("org.eclipse.team.cvs.core", 4, NLS.bind(CVSMessages.CVSRepositoryLocation_invalidFormat, new Object[] { location }), null);
      error.merge(new CVSStatus(4, CVSMessages.CVSRepositoryLocation_locationForm));
      error.merge(e.getStatus());
      throw new CVSException(error);
    }
  }
  
  public static CVSRepositoryLocation fromString(String location, boolean validateOnly)
    throws CVSException
  {
    String errorMessage = null;
    try
    {
      errorMessage = CVSMessages.CVSRepositoryLocation_parsingMethod;
      int start = location.indexOf(':');
      
      int optionStart = l
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