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

luginId, severity, message, null);
    Iterator it = statuses.iterator();
    while (it.hasNext())
    {
      IStatus status = (IStatus)it.next();
      multiStatus.merge(status);
    }
    return multiStatus;
  }
  
  public void handleException(CoreException exception)
  {
    if (log != null) {
      log.log(new Status(severity, pluginId, 0, message, exception));
    }
    IStatus exceptionStatus = exception.getStatus();
    
    IStatus status = new Status(exceptionStatus.getSeverity(), exceptionStatus.getPlugin(), exceptionStatus.getCode(), exceptionStatus.getMessage(), exception);
    recordStatus(status);
    IStatus[] children = status.getChildren();
    for (int i = 0; i < children.length; i++)
    {
      IStatus status2 = children[i];
      recordStatus(status2);
    }
  }
  
  private void recordStatus(IStatus status)
  {
    statuses.add(status);
  }
}

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

import org.eclipse.team.core.IStringMapping;

class FileContentManager$StringMapping
  implements IStringMapping
{
  private final String fString;
  private final int fType;
  
  public FileContentManager$StringMapping(String string, int type)
  {
    fString = string;
    fType = type;
  }
  
  public String getString()
  {
    return fString;
  }
  
  public int getType()
  {
    return fType;
  }
}

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

import java.io.DataInputStream;
import java.io.EOFException;
import java.io.IOException;
import java.util.Collections;
import java.util.Map;
import java.util.TreeMap;

class FileContentManager$UserExtensionMappings
  extends UserStringMappings
{
  public FileContentManager$UserExtensionMappings(String key)
  {
    super(key);
  }
  
  protected Map loadMappingsFromPreferences()
  {
    Map result = super.loadMappingsFromPreferences();
    if (loadMappingsFromOldWorkspace(result)) {
      TeamPlugin.getPlugin().savePluginPreferences();
    }
    return result;
  }
  
  /* Error */
  private boolean loadMappingsFromOldWorkspace(Map map)
  {
    // Byte code:
    //   0: ldc 1
    //   2: astore_2
    //   3: invokestatic 127	org/eclipse/team/internal/core/TeamPlugin:getPlugin	()Lorg/eclipse/team/internal/core/TeamPlugin;
    //   6: invokevirtual 126	org/eclipse/team/internal/core/TeamPlugin:getStateLocation	()Lorg/eclipse/core/runtime/IPath;
    //   9: aload_2
    //   10: invokeinterface 134 2 0
    //   15: astore_3
    //   16: aload_3
    //   17: invokeinterface 133 1 0
    //   22: astore 4
    //   24: aload 4
    //   26: invokevirtual 118	java/io/File:exists	()Z
    //   29: ifne +5 -> 34
    //   32: iconst_0
    //   33: ireturn
    //   34: new 54	java/io/DataInputStream
    //   37: dup
    //   38: new 57	java/io/FileInputStream
    //   41: dup
    //   42: aload 4
    //   44: invokespecial 119	java/io/FileInputStream:<init>	(Ljava/io/File;)V
    //   47: invokespecial 115	java/io/DataInputStream:<init>	(Ljava/io/InputStream;)V
    //   50: astore 5
    //   52: aload_1
    //   53: aload_0
    //   54: aload 5
    //   56: invokespecial 124	org/eclipse/team/internal/core/FileContentManager$UserExtensionMappings:readOldFormatExtensionMappings	(Ljava/io/DataInputStream;)Ljava/util/Map;
    //   59: invokeinterface 131 2 0
    //   64: goto +19 -> 83
    //   67: astore 6
    //   69: aload 5
    //   71: invokevirtual 114	java/io/DataInputStream:close	()V
    //   74: aload 4
    //   76: invokevirtual 117	java/io/File:delete	()Z
    //   79: pop
    //   80: aload 6
    //   82: athrow
    //   83: aload 5
    //   85: invokevirtual 114	java/io/DataInputStream:close	()V
    //   88: aload 4
    //   90: invokevirtual 117	java/io/File:delete	()Z
    //   93: pop
    //   94: goto +18 -> 112
    //   97: astore 5
    //   99: iconst_4
    //   100: aload 5
    //   102: invokevirtual 120	java/io/IOException:getMessage	()Ljava/lang/String;
    //   105: aload 5
    //   107: invokestatic 128	org/eclipse/team/internal/core/TeamPlugin:log	(ILjava/lang/String;Ljava/lang/Throwable;)V
    //   110: iconst_0
    //   111: ireturn
    //   112: iconst_1
    //   113: ireturn
    // Line number table:
    //   Java source line #75	-> byte code offset #0
    //   Java source line #76	-> byte code offset #3
    //   Java source line #77	-> byte code offset #16
    //   Java source line #79	-> byte code offset #24
    //   Java source line #80	-> byte code offset #32
    //   Java source line #83	-> byte code offset #34
    //   Java source line #85	-> byte code offset #52
    //   Java source line #86	-> byte code offset #67
    //   Java source line #87	-> byte code offset #69
    //   Java source line #88	-> byte code offset #74
    //   Java source line #89	-> byte code offset #80
    //   Java source line #87	-> byte code offset #83
    //   Java source line #88	-> byte code offset #88
    //   Java source line #90	-> byte code offset #97
    //   Java source line #91	-> byte code offset #99
    //   Java source line #92	-> byte code offset #110
    //   Java source line #94	-> byte code offset #112
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	114	0	this	UserExtensionMappings
    //   0	114	1	map	Map
    //   2	8	2	STATE_FILE	String
    //   15	2	3	pluginStateLocation	org.eclipse.core.runtime.IPath
    //   22	67	4	f	java.io.File
    //   50	34	5	input	DataInputStream
    //   97	9	5	ex	IOException
    //   67	14	6	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   52	67	67	finally
    //   34	94	97	java/io/IOException
  }
  
  private Map readOldFormatExtensionMappings(DataInputStream input)
    throws IOException
  {
    Map result = new TreeMap();
    int numberOfMappings = 0;
    try
    {
      numberOfMappings = input.readInt();
    }
    catch (EOFException localEOFException)
    {
      return Collections.EMPTY_MAP;
    }
    for (int i = 0; i < numberOfMappings; i++)
    {
      String extension = input.readUTF();
      int type = input.readInt();
      result.put(extension, new Integer(type));
    }
    return result;
  }
}

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

import java.io.DataInputStream;
import java.io.EOFException;
import java.io.IOException;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.TreeMap;
import org.eclipse.core.resources.IStorage;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.core.runtime.content.IContentTypeManager;
import org.eclipse.team.core.IFileContentManager;
import org.eclipse.team.core.IStringMapping;

public class FileContentManager
  implements IFileContentManager
{
  private static final String PREF_TEAM_EXTENSION_TYPES = "file_types";
  private static final String PREF_TEAM_FILENAME_TYPES = "cvs_mode_for_file_without_extensions";
  private final UserStringMappings fUserExtensionMappings;
  private final UserStringMappings fUserNameMappings;
  private PluginStringMappings fPluginExtensionMappings;
  private IContentType textContentType;
  
  private static class StringMapping
    implements IStringMapping
  {
    private final String fString;
    private final int fType;
    
    public StringMapping(String string, int type)
    {
      fString = string;
      fType = type;
    }
    
    public String getString()
    {
      return fString;
    }
    
    public int getType()
    {
      return fType;
    }
  }
  
  private static class UserExtensionMappings
    extends UserStringMappings
  {
    public UserExtensionMappings(String key)
    {
      super();
    }
    
    protected Map loadMappingsFromPreferences()
    {
      Map result = super.loadMappingsFromPreferences();
      if (loadMappingsFromOldWorkspace(result)) {
        TeamPlugin.getPlugin().savePluginPreferences();
      }
      return result;
    }
    
    /* Error */
    private boolean loadMappingsFromOldWorkspace(Map map)
    {
      // Byte code:
      //   0: ldc 1
      //   2: astore_2
      //   3: invokestatic 127	org/eclipse/team/internal/core/TeamPlugin:getPlugin	()Lorg/eclipse/team/internal/core/TeamPlugin;
      //   6: invokevirtual 126	org/eclipse/team/internal/core/TeamPlugin:getStateLocation	()Lorg/eclipse/core/runtime/IPath;
      //   9: aload_2
      //   10: invokeinterface 134 2 0
      //   15: astore_3
      //   16: aload_3
      //   17: invokeinterface 133 1 0
      //   22: astore 4
      //   24: aload 4
      //   26: invokevirtual 118	java/io/File:exists	()Z
      //   29: ifne +5 -> 34
      //   32: iconst_0
      //   33: ireturn
      //   34: new 54	java/io/DataInputStream
      //   37: dup
      //   38: new 57	java/io/FileInputStream
      //   41: dup
      //   42: aload 4
      //   44: invokespecial 119	java/io/FileInputStream:<init>	(Ljava/io/File;)V
      //   47: invokespecial 115	java/io/DataInputStream:<init>	(Ljava/io/InputStream;)V
      //   50: astore 5
      //   52: aload_1
      //   53: aload_0
      //   54: aload 5
      //   56: invokespecial 124	org/eclipse/team/internal/core/FileContentManager$UserExtensionMappings:readOldFormatExtensionMappings	(Ljava/io/DataInputStream;)Ljava/util/Map;
      //   59: invokeinterface 131 2 0
      //   64: goto +19 -> 83
      //   67: astore 6
      //   69: aload 5
      //   71: invokevirtual 114	java/io/DataInputStream:close	()V
      //   74: aload 4
      //   76: invokevirtual 117	java/io/File:delete	()Z
      //   79: pop
      //   80: aload 6
      //   82: athrow
      //   83: aload 5
      //   85: invokevirtual 114	java/io/DataInputStream:close	()V
      //   88: aload 4
      //   90: invokevirtual 117	java/io/File:delete	()Z
      //   93: pop
      //   94: goto +18 -> 112
      //   97: astore 5
      //   99: iconst_4
      //   100: aload 5
      //   102: invokevirtual 120	java/io/IOException:getMessage	()Ljava/lang/String;
      //   105: aload 5
      //   107: invokestatic 128	org/eclipse/team/internal/core/TeamPlugin:log	(ILjava/lang/String;Ljava/lang/Throwable;)V
      //   110: iconst_0
      //   111: ireturn
      //   112: iconst_1
      //   113: ireturn
      // Line number table:
      //   Java source line #75	-> byte code offset #0
      //   Java source line #76	-> byte code offset #3
      //   Java source line #77	-> byte code offset #16
      //   Java source line #79	-> byte code offset #24
      //   Java source line #80	-> byte code offset #32
      //   Java source line #83	-> byte code offset #34
      //   Java source line #85	-> byte code offset #52
      //   Java source line #86	-> byte code offset #67
      //   Java source line #87	-> byte code offset #69
      //   Java source line #88	-> byte code offset #74
      //   Java source line #89	-> byte code offset #80
      //   Java source line #87	-> byte code offset #83
      //   Java source line #88	-> byte code offset #88
      //   Java source line #90	-> byte code offset #97
      //   Java source line #91	-> byte code offset #99
      //   Java source line #92	-> byte code offset #110
      //   Java source line #94	-> byte code offset #112
      // Local variable table:
      //   start	length	slot	name	signature
      //   0	114	0	this	UserExtensionMappings
      //   0	114	1	map	Map
      //   2	8	2	STATE_FILE	String
      //   15	2	3	pluginStateLocation	org.eclipse.core.runtime.IPath
      //   22	67	4	f	java.io.File
      //   50	34	5	input	DataInputStream
      //   97	9	5	ex	IOException
      //   67	14	6	localObject	Object
      // Exception table:
      //   from	to	target	type
      //   52	67	67	finally
      //   34	94	97	java/io/IOException
    }
    
    private Map readOldFormatExtensionMappings(DataInputStream input)
      throws IOException
    {
      Map result = new TreeMap();
      int numberOfMappings = 0;
      try
      {
        numberOfMappings = input.readInt();
      }
      catch (EOFException localEOFException)
      {
        return Collections.EMPTY_MAP;
      }
      for (int i = 0; i < numberOfMappings; i++)
      {
        String extension = input.readUTF();
        int type = input.readInt();
        result.put(extension, new Integer(type));
      }
      return result;
    }
  }
  
  public FileContentManager()
  {
    fUserExtensionMappings = new UserExtensionMappings("file_types");
    fUserNameMappings = new UserStringMappings("cvs_mode_for_file_without_extensions");
    fPluginExtensionMappings = new PluginStringMappings("fileTypes", "extension");
  }
  
  public int getTypeForName(String filename)
  {
    int userType = fUserNameMappings.getType(filename);
    
    return userType;
  }
  
  public int getTypeForExtension(String extension)
  {
    int userType = fUserExtensionMappings.getType(extension);
    int pluginType = fPluginExtensionMappings.getType(extension);
    return userType != 0 ? userType : pluginType;
  }
  
  public void addNameMappings(String[] names, int[] types)
  {
    fUserNameMappings.addStringMappings(names, types);
  }
  
  public void addExtensionMappings(String[] extensions, int[] types)
  {
    fUserExtensionMappings.addStringMappings(extensions, types);
  }
  
  public void setNameMappings(String[] names, int[] types)
  {
    fUserNameMappings.setStringMappings(names, types);
  }
  
  public void setExtensionMappings(String[] extensions, int[] types)
  {
    fUserExtensionMappings.setStringMappings(extensions, types);
  }
  
  public IStringMapping[] getNameMappings()
  {
    return getMappings(fUserNameMappings, null);
  }
  
  public IStringMapping[] getExtensionMappings()
  {
    return getMappings(fUserExtensionMappings, fPluginExtensionMappings);
  }
  
  public int getType(IStorage storage)
  {
    String name = storage.getName();
    int type;
    if ((name != null) && ((type = getTypeForName(name)) != 0)) {
      return type;
    }
    String extension = getFileExtension(name);
    int type;
    if ((extension != null) && ((type = getTypeForExtension(extension)) != 0)) {
      return type;
    }
    IContentType contentType = Platform.getContentTypeManager().findContentTypeFor(name);
    if (contentType != null)
    {
      IContentType textType = getTextContentType();
      if (contentType.isKindOf(textType)) {
        return 1;
      }
    }
    return 0;
  }
  
  private IContentType getTextContentType()
  {
    if (textContentType == null) {
      textContentType = Platform.getContentTypeManager().getContentType("org.eclipse.core.runtime.text");
    }
    return textContentType;
  }
  
  public IStringMapping[] getDefaultNameMappings()
  {
    return new IStringMapping[0];
  }
  
  public IStringMapping[] getDefaultExtensionMappings()
  {
    return getStringMappings(fPluginExtensionMappings.referenceMap());
  }
  
  public boolean isKnownExtension(String extension)
  {
    return (fUserExtensionMappings.referenceMap().containsKey(extension)) || (fPluginExtensionMappings.referenceMap().containsKey(extension));
  }
  
  public boolean isKnownFilename(String filename)
  {
    return fUserNameMappings.referenceMap().containsKey(filename);
  }
  
  private static String getFileExtension(String name)
  {
    if (name == null) {
      return null;
    }
    int index = name.lastIndexOf('.');
    if (index == -1) {
      return null;
    }
    if (index == name.length() - 1) {
      return "";
    }
    return name.substring(index + 1);
  }
  
  private static IStringMapping[] getStringMappings(Map map)
  {
    IStringMapping[] result = new IStringMapping[map.size()];
    int index = 0;
    for (Iterator iter = map.entrySet().iterator(); iter.hasNext();)
    {
      Map.Entry entry = (Map.Entry)iter.next();
      result[(index++)] = new StringMapping((String)entry.getKey(), ((Integer)entry.getValue()).intValue());
    }
    return result;
  }
  
  private IStringMapping[] getMappings(UserStringMappings userMappings, PluginStringMappings pluginMappings)
  {
    Map mappings = new HashMap();
    if (pluginMappings != null) {
      mappings.putAll(pluginMappings.referenceMap());
    }
    mappings.putAll(userMappings.referenceMap());
    return getStringMappings(mappings);
  }
}

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

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.team.FileModificationValidationContext;
import org.eclipse.core.resources.team.FileModificationValidator;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.team.core.RepositoryProvider;

public class FileModificationValidatorManager
  extends FileModificationValidator
{
  private FileModificationValidator defaultValidator;
  
  public IStatus validateEdit(IFile[] files, FileModificationValidationContext context)
  {
    ArrayList returnStati = new ArrayList();
    
    Map providersToFiles = new HashMap(files.length);
    for (int i = 0; i < files.length; i++)
    {
      IFile file = files[i];
      RepositoryProvider provider = RepositoryProvider.getProvider(file.getProject());
      if (!providersToFiles.containsKey(provider)) {
        providersToFiles.put(provider, new ArrayList());
      }
      ((ArrayList)providersToFiles.get(provider)).add(file);
    }
    Iterator providersIterator = providersToFiles.keySet().iterator();
    
    boolean allOK = true;
    while (providersIterator.hasNext())
    {
      RepositoryProvider provider = (RepositoryProvider)providersIterator.next();
      ArrayList filesList = (ArrayList)providersToFiles.get(provider);
      IFile[] filesArray = (IFile[])filesList.toArray(new IFile[filesList.size()]);
      FileModificationValidator validator = getDefaultValidator();
      if (provider != null)
      {
        FileModificationValidator v = provider.getFileModificationValidator2();
        if (v != null) {
          validator = v;
        }
      }
      IStatus status = validator.validateEdit(filesArray, context);
      if (!status.isOK()) {
        allOK = false;
      }
      returnStati.add(status);
    }
    if (returnStati.size() == 1) {
      return (IStatus)returnStati.get(0);
    }
    return new MultiStatus("org.eclipse.team.core", 
      0, 
      (IStatus[])returnStati.toArray(new IStatus[returnStati.size()]), 
      allOK ? 
      Messages.ok : 
      Messages.FileModificationValidator_editFailed, 
      null);
  }
  
  public IStatus validateSave(IFile file)
  {
    RepositoryProvider provider = RepositoryProvider.getProvider(file.getProject());
    FileModificationValidator validator = getDefaultValidator();
    if (provider != null)
    {
      FileModificationValidator v = provider.getFileModificationValidator2();
      if (v != null) {
        validator = v;
      }
    }
    return validator.validateSave(file);
  }
  
  private synchronized FileModificationValidator getDefaultValidator()
  {
    if (defaultValidator == null) {
      defaultValidator = new DefaultFileModificationValidator();
    }
    return defaultValidator;
  }
}

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

import org.eclipse.core.resources.IProject;
import org.eclipse.team.core.RepositoryProvider;

public abstract interface IRepositoryProviderListener
{
  public abstract void providerMapped(RepositoryProvider paramRepositoryProvider);
  
  public abstract void providerUnmapped(IProject paramIProject);
}

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

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;

public class InfiniteSubProgressMonitor
  extends SubProgressMonitor
{
  int totalWork;
  int halfWay;
  int currentIncrement;
  int nextProgress;
  int worked;
  
  public InfiniteSubProgressMonitor(IProgressMonitor monitor, int ticks)
  {
    this(monitor, ticks, 0);
  }
  
  public InfiniteSubProgressMonitor(IProgressMonitor monitor, int ticks, int style)
  {
    super(monitor, ticks, style);
  }
  
  public void beginTask(String name, int totalWork)
  {
    super.beginTask(name, totalWork);
    this.totalWork = totalWork;
    halfWay = (totalWork / 2);
    currentIncrement = 1;
    nextProgress = currentIncrement;
    worked = 0;
  }
  
  public void worked(int work)
  {
    if (worked >= totalWork) {
      return;
    }
    if (--nextProgress <= 0)
    {
      super.worked(1);
      worked += 1;
      if (worked >= halfWay)
      {
        currentIncrement *= 2;
        halfWay += (totalWork - halfWay) / 2;
      }
      nextProgress = currentIncrement;
    }
  }
  
  public void subTask(String name)
  {
    if ((name != null) && (!name.equals(""))) {
      super.subTask(name);
    }
  }
}

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

import org.eclipse.osgi.util.NLS;

public class Messages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.eclipse.team.internal.core.messages";
  public static String LocalFileHistory_RefreshLocalHistory;
  public static String MergeContext_5;
  public static String MergeContext_6;
  public static String ok;
  public static String concatStrings;
  public static String AbstractResourceVariantTree_0;
  public static String Assert_assertionFailed;
  public static String FileModificationValidator_someReadOnly;
  public static String FileModificationValidator_fileIsReadOnly;
  public static String FileModificationValidator_editFailed;
  public static String RepositoryProvider_Error_removing_nature_from_project___1;
  public static String RepositoryProvider_couldNotInstantiateProvider;
  public static String RepositoryProvider_No_Provider_Registered;
  public static String RepositoryProvider_linkedResourcesExist;
  public static String RepositoryProvider_linkedResourcesNotSupported;
  public static String RepositoryProvider_linkedURIsExist;
  public static String RepositoryProvider_linkedURIsNotSupported;
  public static String RepositoryProvider_couldNotClearAfterError;
  public static String RepositoryProvider_invalidClass;
  public static String RepositoryProvider_toString;
  public static String SubscriberDiffTreeEventHandler_0;
  public static String Team_readError;
  public static String PollingInputStream_readTimeout;
  public static String PollingInputStream_closeTimeout;
  public static String PollingOutputStream_writeTimeout;
  public static String PollingOutputStream_closeTimeout;
  public static String TimeoutOutputStream_cannotWriteToStream;
  public static String RemoteSyncElement_delimit;
  public static String RemoteSyncElement_insync;
  public static String RemoteSyncElement_conflicting;
  public static String RemoteSyncElement_outgoing;
  public static String RemoteSyncElement_incoming;
  public static String RemoteSyncElement_change;
  public static String RemoteSyncElement_addition;
  public static String RemoteSyncElement_deletion;
  public static String RemoteSyncElement_manual;
  public static String RemoteSyncElement_auto;
  public static String Team_Error_loading_ignore_state_from_disk_1;
  public static String Team_Conflict_occured_for_ignored_resources_pattern;
  public static String RemoteContentsCache_cacheDisposed;
  public static String RemoteContentsCache_fileError;
  public static String SubscriberEventHandler_2;
  public static String SubscriberEventHandler_jobName;
  public static String SubscriberChangeSetCollector_0;
  public static String SubscriberChangeSetCollector_1;
  public static String SubscriberChangeSetCollector_2;
  public static String SubscriberChangeSetCollector_3;
  public static String SubscriberChangeSetCollector_4;
  public static String SubscriberChangeSetCollector_5;
  public static String SubscriberEventHandler_errors;
  public static String RemoteContentsCacheEntry_3;
  public static String SynchronizationCacheRefreshOperation_0;
  public static String SubscriberEventHandler_8;
  public static String SubscriberEventHandler_9;
  public static String SubscriberEventHandler_10;
  public static String SubscriberEventHandler_11;
  public static String CachedResourceVariant_0;
  public static String CachedResourceVariant_1;
  public static String SyncInfoTree_0;
  public static String ResourceVariantTreeSubscriber_1;
  public static String ResourceVariantTreeSubscriber_2;
  public static String SyncByteConverter_1;
  public static String BatchingLock_11;
  public static String SubscriberEventHandler_12;
  public static String ProjectSetCapability_0;
  public static String ProjectSetCapability_1;
  public static String SubscriberResourceMappingContext_0;
  public static String SubscriberResourceMappingContext_1;
  public static String MergeContext_0;
  public static String MergeContext_1;
  public static String MergeContext_2;
  public static String MergeContext_3;
  public static String MergeContext_4;
  public static String LocalFileRevision_currentVersion;
  public static String LocalFileRevision_currentVersionTag;
  public static String LocalFileRevision_localRevisionTag;
  public static String DelegatingStorageMerger_0;
  public static String DelegatingStorageMerger_1;
  public static String WorkspaceSubscriber_0;
  public static String WorkspaceSubscriber_1;
  public static String ScopeManagerEventHandler_0;
  public static String ScopeManagerEventHandler_1;
  
  static
  {
    NLS.initializeMessages("org.eclipse.team.internal.core.messages", Messages.class);
  }
}

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

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.team.IMoveDeleteHook;
import org.eclipse.core.resources.team.IResourceTree;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.core.RepositoryProvider;

public class MoveDeleteManager
  implements IMoveDeleteHook
{
  private static final IMoveDeleteHook DEFAULT_HOOK = new DefaultMoveDeleteHook();
  
  private IMoveDeleteHook getHookFor(IResource resource)
  {
    IProject project = resource.getProject();
    RepositoryProvider provider = RepositoryProvider.getProvider(project);
    if (provider == null) {
      return DEFAULT_HOOK;
    }
    IMoveDeleteHook hook = provider.getMoveDeleteHook();
    if (hook == null) {
      return DEFAULT_HOOK;
    }
    return hook;
  }
  
  public boolean deleteFile(IResourceTree tree, IFile file, int updateFlags, IProgressMonitor monitor)
  {
    return getHookFor(file).deleteFile(tree, file, updateFlags, monitor);
  }
  
  public boolean deleteFolder(IResourceTree tree, IFolder folder, int updateFlags, IProgressMonitor monitor)
  {
    return getHookFor(folder).deleteFolder(tree, folder, updateFlags, monitor);
  }
  
  public boolean deleteProject(IResourceTree tree, IProject project, int updateFlags, IProgressMonitor monitor)
  {
    return getHookFor(project).deleteProject(tree, project, updateFlags, monitor);
  }
  
  public boolean moveFile(IResourceTree tree, IFile source, IFile destination, int updateFlags, IProgressMonitor monitor)
  {
    return getHookFor(source).moveFile(tree, source, destination, updateFlags, monitor);
  }
  
  public boolean moveFolder(IResourceTree tree, IFolder source, IFolder destination, int updateFlags, IProgressMonitor monitor)
  {
    return getHookFor(source).moveFolder(tree, source, destination, updateFlags, monitor);
  }
  
  public boolean moveProject(IResourceTree tree, IProject source, IProjectDescription description, int updateFlags, IProgressMonitor monitor)
  {
    return getHookFor(source).moveProject(tree, source, description, updateFlags, monitor);
  }
}

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

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;

public class NullSubProgressMonitor
  extends SubProgressMonitor
{
  public NullSubProgressMonitor(IProgressMonitor monitor)
  {
    super(monitor, 0, 0);
  }
  
  public void beginTask(String name, int totalWork) {}
  
  public void done() {}
  
  public void internalWorked(double work) {}
  
  public void subTask(String name) {}
  
  public void worked(int work) {}
}

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

import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.resources.team.ResourceRuleFactory;
import org.eclipse.core.runtime.jobs.ISchedulingRule;

public class PessimisticResourceRuleFactory
  extends ResourceRuleFactory
{
  IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
  
  public ISchedulingRule copyRule(IResource source, IResource destination)
  {
    return root;
  }
  
  public ISchedulingRule createRule(IResource resource)
  {
    return root;
  }
  
  public ISchedulingRule deleteRule(IResource resource)
  {
    return root;
  }
  
  public ISchedulingRule modifyRule(IResource resource)
  {
    return root;
  }
  
  public ISchedulingRule moveRule(IResource source, IResource destination)
  {
    return root;
  }
  
  public ISchedulingRule refreshRule(IResource resource)
  {
    return root;
  }
  
  public ISchedulingRule validateEditRule(IResource[] resources)
  {
    return root;
  }
  
  public ISchedulingRule charsetRule(IResource resource)
  {
    return root;
  }
}

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

import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtension;
import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform;

public class PluginStringMappings
{
  private final String fExtensionID;
  private final String fAttributeName;
  private SortedMap fMappings;
  
  public PluginStringMappings(String extensionID, String stringAttributeName)
  {
    fExtensionID = extensionID;
    fAttributeName = stringAttributeName;
  }
  
  private SortedMap loadPluginPatterns()
  {
    SortedMap result = new TreeMap();
    
    TeamPlugin plugin = TeamPlugin.getPlugin();
    if (plugin == null) {
      return result;
    }
    IExtensionPoint extension = Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.team.core", fExtensionID);
    if (extension == null) {
      return result;
    }
    IExtension[] extensions = extension.getExtensions();
    for (int i = 0; i < extensions.length; i++)
    {
      IConfigurationElement[] configElements = extensions[i].getConfigurationElements();
      for (int j = 0; j < configElements.length; j++)
      {
        String ext = configElements[j].getAttribute(fAttributeName);
        String type = configElements[j].getAttribute("type");
        if ((ext != null) && (type != null)) {
          if (type.equals("text")) {
            result.put(ext, new Integer(1));
          } else if (type.equals("binary")) {
            result.put(ext, new Integer(2));
          }
        }
      }
    }
    return result;
  }
  
  public Map referenceMap()
  {
    if (fMappings == null) {
      fMappings = loadPluginPatterns();
    }
    return fMappings;
  }
  
  public int getType(String filename)
  {
    Map mappings = referenceMap();
    return mappings.containsKey(filename) ? ((Integer)mappings.get(filename)).intValue() : 0;
  }
}

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

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.SubProgressMonitor;

public class Policy
{
  public static boolean DEBUG_STREAMS = false;
  public static boolean DEBUG_REFRESH_JOB = true;
  public static boolean DEBUG_BACKGROUND_EVENTS = false;
  public static boolean DEBUG_THREADING = false;
  
  static
  {
    if (TeamPlugin.getPlugin().isDebugging())
    {
      DEBUG_STREAMS = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.team.core/streams"));
      DEBUG_REFRESH_JOB = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.team.core/refreshjob"));
      DEBUG_BACKGROUND_EVENTS = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.team.core/backgroundevents"));
      DEBUG_THREADING = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.team.core/threading"));
    }
  }
  
  public static void checkCanceled(IProgressMonitor monitor)
  {
    if ((monitor != null) && (monitor.isCanceled())) {
      throw new OperationCanceledException();
    }
  }
  
  public static IProgressMonitor monitorFor(IProgressMonitor monitor)
  {
    if (monitor == null) {
      return new NullProgressMonitor();
    }
    return monitor;
  }
  
  public static IProgressMonitor subMonitorFor(IProgressMonitor monitor, int ticks)
  {
    if (monitor == null) {
      return new NullProgressMonitor();
    }
    if ((monitor instanceof NullProgressMonitor)) {
      return monitor;
    }
    return new SubProgressMonitor(monitor, ticks);
  }
  
  public static IProgressMonitor infiniteSubMonitorFor(IProgressMonitor monitor, int ticks)
  {
    if (monitor == null) {
      return new NullProgressMonitor();
    }
    if ((monitor instanceof NullProgressMonitor)) {
      return monitor;
    }
    return new InfiniteSubProgressMonitor(monitor, ticks);
  }
}

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

import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.ListenerList;
import org.eclipse.team.core.RepositoryProvider;

public class RepositoryProviderManager
  implements IRepositoryProviderListener
{
  private static RepositoryProviderManager instance;
  private ListenerList listeners = new ListenerList();
  
  public static synchronized RepositoryProviderManager getInstance()
  {
    if (instance == null) {
      instance = new RepositoryProviderManager();
    }
    return instance;
  }
  
  public void providerMapped(RepositoryProvider provider)
  {
    Object[] allListeners = listeners.getListeners();
    for (int i = 0; i < allListeners.length; i++)
    {
      IRepositoryProviderListener listener = (IRepositoryProviderListener)allListeners[i];
      listener.providerMapped(provider);
    }
  }
  
  public void providerUnmapped(IProject project)
  {
    Object[] allListeners = listeners.getListeners();
    for (int i = 0; i < allListeners.length; i++)
    {
      IRepositoryProviderListener listener = (IRepositoryProviderListener)allListeners[i];
      listener.providerUnmapped(project);
    }
  }
  
  public void addListener(IRepositoryProviderListener listener)
  {
    listeners.add(listener);
  }
  
  public void removeListener(IRepositoryProviderListener listener)
  {
    listeners.remove(listener);
  }
}

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

import java.io.File;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.jobs.IJobManager;
import org.eclipse.core.runtime.jobs.ILock;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.variants.CachedResourceVariant;

public class ResourceVariantCache
{
  private static final String CACHE_DIRECTORY = ".cache";
  private static final long CACHE_FILE_LIFESPAN = 3600000L;
  private static Map caches = new HashMap();
  private String name;
  private Map cacheEntries;
  private long lastCacheCleanup;
  private int cacheDirSize;
  private ILock lock = Job.getJobManager().newLock();
  
  public static synchronized void enableCaching(String cacheId)
  {
    if (isCachingEnabled(cacheId)) {
      return;
    }
    ResourceVariantCache cache = new ResourceVariantCache(cacheId);
    cache.createCacheDirectory();
    caches.put(cacheId, cache);
  }
  
  public static boolean isCachingEnabled(String cacheId)
  {
    return getCache(cacheId) != null;
  }
  
  public static void disableCache(String cacheId)
  {
    ResourceVariantCache cache = getCache(cacheId);
    if (cache == null) {
      return;
    }
    caches.remove(cacheId);
    cache.deleteCacheDirectory();
  }
  
  public static synchronized ResourceVariantCache getCache(String cacheId)
  {
    return (ResourceVariantCache)caches.get(cacheId);
  }
  
  public static synchronized void shutdown()
  {
    String[] keys = (String[])caches.keySet().toArray(new String[caches.size()]);
    for (int i = 0; i < keys.length; i++)
    {
      String id = keys[i];
      disableCache(id);
    }
  }
  
  private ResourceVariantCache(String name)
  {
    this.name = name;
  }
  
  public boolean hasEntry(String id)
  {
    return internalGetCacheEntry(id) != null;
  }
  
  protected IPath getCachePath()
  {
    return getStateLocation().append(".cache").append(name);
  }
  
  private IPath getStateLocation()
  {
    return TeamPlugin.getPlugin().getStateLocation();
  }
  
  private synchronized void clearOldCacheEntries()
  {
    long current = new Date().getTime();
    if ((lastCacheCleanup != -1L) && (current - lastCacheCleanup < 3600000L)) {
      return;
    }
    List stale = new ArrayList();
    for (Iterator iter = cacheEntries.values().iterator(); iter.hasNext();)
    {
      ResourceVariantCacheEntry entry = (ResourceVariantCacheEntry)iter.next();
      long lastHit = entry.getLastAccessTimeStamp();
      if (current - lastHit > 3600000L) {
        stale.add(entry);
      }
    }
    for (Iterator iter = stale.iterator(); iter.hasNext();)
    {
      ResourceVariantCacheEntry entry = (R
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd