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

throws CVSException
  {
    // Byte code:
    //   0: aload_0
    //   1: invokespecial 865	org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer:beginOperation	()V
    //   4: aload_0
    //   5: getfield 823	org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer:synchronizerCache	Lorg/eclipse/team/internal/ccvs/core/resources/SynchronizerSyncInfoCache;
    //   8: aload_1
    //   9: iconst_1
    //   10: invokevirtual 944	org/eclipse/team/internal/ccvs/core/resources/SynchronizerSyncInfoCache:getCachedFolderSync	(Lorg/eclipse/core/resources/IContainer;Z)Lorg/eclipse/team/internal/ccvs/core/syncinfo/FolderSyncInfo;
    //   13: astore_2
    //   14: aload_2
    //   15: ifnull +225 -> 240
    //   18: aload_1
    //   19: ldc_w 370
    //   22: invokeinterface 1023 2 0
    //   27: invokeinterface 1021 1 0
    //   32: ifeq +89 -> 121
    //   35: aload_0
    //   36: aload_1
    //   37: invokevirtual 903	org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer:getFolderSync	(Lorg/eclipse/core/resources/IContainer;)Lorg/eclipse/team/internal/ccvs/core/syncinfo/FolderSyncInfo;
    //   40: astore_3
    //   41: aload_3
    //   42: invokevirtual 947	org/eclipse/team/internal/ccvs/core/syncinfo/FolderSyncInfo:getRoot	()Ljava/lang/String;
    //   45: aload_2
    //   46: invokevirtual 947	org/eclipse/team/internal/ccvs/core/syncinfo/FolderSyncInfo:getRoot	()Ljava/lang/String;
    //   49: invokevirtual 828	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   52: ifeq +17 -> 69
    //   55: aload_3
    //   56: invokevirtual 946	org/eclipse/team/internal/ccvs/core/syncinfo/FolderSyncInfo:getRepository	()Ljava/lang/String;
    //   59: aload_2
    //   60: invokevirtual 946	org/eclipse/team/internal/ccvs/core/syncinfo/FolderSyncInfo:getRepository	()Ljava/lang/String;
    //   63: invokevirtual 828	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   66: ifne +55 -> 121
    //   69: aload_1
    //   70: invokestatic 861	org/eclipse/team/internal/ccvs/core/resources/CVSWorkspaceRoot:getCVSFolderFor	(Lorg/eclipse/core/resources/IContainer;)Lorg/eclipse/team/internal/ccvs/core/ICVSFolder;
    //   73: astore 4
    //   75: aload 4
    //   77: bipush 16
    //   79: invokeinterface 1046 2 0
    //   84: astore 5
    //   86: iconst_0
    //   87: istore 6
    //   89: goto +24 -> 113
    //   92: aload 5
    //   94: iload 6
    //   96: aaload
    //   97: astore 7
    //   99: aload_0
    //   100: aload 7
    //   102: invokeinterface 1047 1 0
    //   107: invokevirtual 876	org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer:deleteResourceSync	(Lorg/eclipse/core/resources/IResource;)V
    //   110: iinc 6 1
    //   113: iload 6
    //   115: aload 5
    //   117: arraylength
    //   118: if_icmplt -26 -> 92
    //   121: aload_0
    //   122: aload_1
    //   123: aload_2
    //   124: invokevirtual 904	org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer:setFolderSync	(Lorg/eclipse/core/resources/IContainer;Lorg/eclipse/team/internal/ccvs/core/syncinfo/FolderSyncInfo;)V
    //   127: aload_0
    //   128: getfield 822	org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer:sessionPropertyCache	Lorg/eclipse/team/internal/ccvs/core/resources/SessionPropertySyncInfoCache;
    //   131: aload_1
    //   132: invokevirtual 915	org/eclipse/team/internal/ccvs/core/resources/SessionPropertySyncInfoCache:purgeDirtyCache	(Lorg/eclipse/core/resources/IResource;)V
    //   135: aload_0
    //   136: aload_1
    //   137: invokevirtual 897	org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer:members	(Lorg/eclipse/core/resources/IContainer;)[Lorg/eclipse/core/resources/IResource;
    //   140: astore_3
    //   141: aconst_null
    //   142: astore 4
    //   144: iconst_0
    //   145: istore 5
    //   147: goto +28 -> 175
    //   150: aload_3
    //   151: iload 5
    //   153: aaload
    //   154: astore 6
    //   156: aload_0
    //   157: aload 6
    //   159: invokevirtual 883	org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer:getSyncBytes	(Lorg/eclipse/core/resources/IResource;)[B
    //   162: ifnull +10 -> 172
    //   165: aload 6
    //   167: astore 4
    //   169: goto +13 -> 182
    //   172: iinc 5 1
    //   175: iload 5
    //   177: aload_3
    //   178: arraylength
    //   179: if_icmplt -29 -> 150
    //   182: aload 4
    //   184: ifnonnull +14 -> 198
    //   187: aload_1
    //   188: ldc_w 377
    //   191: invokeinterface 1022 2 0
    //   196: astore 4
    //   198: aload_0
    //   199: aload 4
    //   201: invokespecial 877	org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer:resourceChanged	(Lorg/eclipse/core/resources/IResource;)V
    //   204: goto +36 -> 240
    //   207: astore 8
    //   209: aload_0
    //   210: invokespecial 866	org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer:endOperation	()V
    //   213: goto +16 -> 229
    //   216: astore 9
    //   218: aload_0
    //   219: getfield 823	org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer:synchronizerCache	Lorg/eclipse/team/internal/ccvs/core/resources/SynchronizerSyncInfoCache;
    //   222: aload_1
    //   223: invokevirtual 937	org/eclipse/team/internal/ccvs/core/resources/SynchronizerSyncInfoCache:flush	(Lorg/eclipse/core/resources/IFolder;)V
    //   226: aload 9
    //   228: athrow
    //   229: aload_0
    //   230: getfield 823	org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer:synchronizerCache	Lorg/eclipse/team/internal/ccvs/core/resources/SynchronizerSyncInfoCache;
    //   233: aload_1
    //   234: invokevirtual 937	org/eclipse/team/internal/ccvs/core/resources/SynchronizerSyncInfoCache:flush	(Lorg/eclipse/core/resources/IFolder;)V
    //   237: aload 8
    //   239: athrow
    //   240: aload_0
    //   241: invokespecial 866	org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer:endOperation	()V
    //   244: goto +16 -> 260
    //   247: astore 9
    //   249: aload_0
    //   250: getfield 823	org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer:synchronizerCache	Lorg/eclipse/team/internal/ccvs/core/resources/SynchronizerSyncInfoCache;
    //   253: aload_1
    //   254: invokevirtual 937	org/eclipse/team/internal/ccvs/core/resources/SynchronizerSyncInfoCache:flush	(Lorg/eclipse/core/resources/IFolder;)V
    //   257: aload 9
    //   259: athrow
    //   260: aload_0
    //   261: getfield 823	org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer:synchronizerCache	Lorg/eclipse/team/internal/ccvs/core/resources/SynchronizerSyncInfoCache;
    //   264: aload_1
    //   265: invokevirtual 937	org/eclipse/team/internal/ccvs/core/resources/SynchronizerSyncInfoCache:flush	(Lorg/eclipse/core/resources/IFolder;)V
    //   268: return
    // Line number table:
    //   Java source line #1854	-> byte code offset #0
    //   Java source line #1855	-> byte code offset #4
    //   Java source line #1856	-> byte code offset #14
    //   Java source line #1858	-> byte code offset #18
    //   Java source line #1867	-> byte code offset #35
    //   Java source line #1868	-> byte code offset #41
    //   Java source line #1869	-> byte code offset #55
    //   Java source line #1875	-> byte code offset #69
    //   Java source line #1876	-> byte code offset #75
    //   Java source line #1877	-> byte code offset #86
    //   Java source line #1878	-> byte code offset #92
    //   Java source line #1879	-> byte code offset #99
    //   Java source line #1877	-> byte code offset #110
    //   Java source line #1885	-> byte code offset #121
    //   Java source line #1887	-> byte code offset #127
    //   Java source line #1889	-> byte code offset #135
    //   Java source line #1890	-> byte code offset #141
    //   Java source line #1891	-> byte code offset #144
    //   Java source line #1892	-> byte code offset #150
    //   Java source line #1893	-> byte code offset #156
    //   Java source line #1894	-> byte code offset #165
    //   Java source line #1895	-> byte code offset #169
    //   Java source line #1891	-> byte code offset #172
    //   Java source line #1898	-> byte code offset #182
    //   Java source line #1899	-> byte code offset #187
    //   Java source line #1901	-> byte code offset #198
    //   Java source line #1903	-> byte code offset #207
    //   Java source line #1905	-> byte code offset #209
    //   Java source line #1906	-> byte code offset #216
    //   Java source line #1907	-> byte code offset #218
    //   Java source line #1908	-> byte code offset #226
    //   Java source line #1907	-> byte code offset #229
    //   Java source line #1909	-> byte code offset #237
    //   Java source line #1905	-> byte code offset #240
    //   Java source line #1906	-> byte code offset #247
    //   Java source line #1907	-> byte code offset #249
    //   Java source line #1908	-> byte code offset #257
    //   Java source line #1907	-> byte code offset #260
    //   Java source line #1910	-> byte code offset #268
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	269	0	this	EclipseSynchronizer
    //   0	269	1	folder	org.eclipse.core.resources.IFolder
    //   13	111	2	folderInfo	FolderSyncInfo
    //   40	16	3	newFolderInfo	FolderSyncInfo
    //   140	38	3	members	IResource[]
    //   73	3	4	cvsFolder	org.eclipse.team.internal.ccvs.core.ICVSFolder
    //   142	58	4	changedResource	IResource
    //   84	32	5	children	org.eclipse.team.internal.ccvs.core.ICVSResource[]
    //   145	31	5	i	int
    //   87	27	6	i	int
    //   154	12	6	resource	IResource
    //   97	4	7	resource	org.eclipse.team.internal.ccvs.core.ICVSResource
    //   207	31	8	localObject1	Object
    //   216	11	9	localObject2	Object
    //   247	11	9	localObject3	Object
    // Exception table:
    //   from	to	target	type
    //   0	207	207	finally
    //   209	216	216	finally
    //   240	247	247	finally
  }
  
  /* Error */
  private void restoreResourceSync(IResource resource)
    throws CVSException
  {
    // Byte code:
    //   0: aload_0
    //   1: invokespecial 865	org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer:beginOperation	()V
    //   4: aload_0
    //   5: getfield 823	org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer:synchronizerCache	Lorg/eclipse/team/internal/ccvs/core/resources/SynchronizerSyncInfoCache;
    //   8: aload_1
    //   9: iconst_1
    //   10: invokevirtual 940	org/eclipse/team/internal/ccvs/core/resources/SynchronizerSyncInfoCache:getCachedSyncBytes	(Lorg/eclipse/core/resources/IResource;Z)[B
    //   13: astore_2
    //   14: aload_2
    //   15: ifnull +95 -> 110
    //   18: aload_2
    //   19: invokestatic 963	org/eclipse/team/internal/ccvs/core/syncinfo/ResourceSyncInfo:isFolder	([B)Z
    //   22: ifne +8 -> 30
    //   25: aload_2
    //   26: invokestatic 964	org/eclipse/team/internal/ccvs/core/syncinfo/ResourceSyncInfo:convertFromDeletion	([B)[B
    //   29: astore_2
    //   30: aload_0
    //   31: aload_1
    //   32: invokevirtual 883	org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer:getSyncBytes	(Lorg/eclipse/core/resources/IResource;)[B
    //   35: astore_3
    //   36: aload_3
    //   37: ifnull +15 -> 52
    //   40: aload_3
    //   41: invokestatic 963	org/eclipse/team/internal/ccvs/core/syncinfo/ResourceSyncInfo:isFolder	([B)Z
    //   44: ifne +8 -> 52
    //   47: aload_3
    //   48: invokestatic 964	org/eclipse/team/internal/ccvs/core/syncinfo/ResourceSyncInfo:convertFromDeletion	([B)[B
    //   51: astore_3
    //   52: aload_3
    //   53: ifnull +11 -> 64
    //   56: aload_2
    //   57: aload_3
    //   58: invokestatic 986	org/eclipse/team/internal/ccvs/core/util/Util:equals	([B[B)Z
    //   61: ifeq +49 -> 110
    //   64: aload_0
    //   65: aload_1
    //   66: aload_2
    //   67: invokevirtual 887	org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer:setSyncBytes	(Lorg/eclipse/core/resources/IResource;[B)V
    //   70: goto +40 -> 110
    //   73: astore 4
    //   75: aload_0
    //   76: invokespecial 866	org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer:endOperation	()V
    //   79: goto +18 -> 97
    //   82: astore 5
    //   84: aload_0
    //   85: getfield 823	org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer:synchronizerCache	Lorg/eclipse/team/internal/ccvs/core/resources/SynchronizerSyncInfoCache;
    //   88: aload_1
    //   89: aconst_null
    //   90: iconst_1
    //   91: invokevirtual 941	org/eclipse/team/internal/ccvs/core/resources/SynchronizerSyncInfoCache:setCachedSyncBytes	(Lorg/eclipse/core/resources/IResource;[BZ)V
    //   94: aload 5
    //   96: athrow
    //   97: aload_0
    //   98: getfield 823	org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer:synchronizerCache	Lorg/eclipse/team/internal/ccvs/core/resources/SynchronizerSyncInfoCache;
    //   101: aload_1
    //   102: aconst_null
    //   103: iconst_1
    //   104: invokevirtual 941	org/eclipse/team/internal/ccvs/core/resources/SynchronizerSyncInfoCache:setCachedSyncBytes	(Lorg/eclipse/core/resources/IResource;[BZ)V
    //   107: aload 4
    //   109: athrow
    //   110: aload_0
    //   111: invokespecial 866	org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer:endOperation	()V
    //   114: goto +18 -> 132
    //   117: astore 5
    //   119: aload_0
    //   120: getfield 823	org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer:synchronizerCache	Lorg/eclipse/team/internal/ccvs/core/resources/SynchronizerSyncInfoCache;
    //   123: aload_1
    //   124: aconst_null
    //   125: iconst_1
    //   126: invokevirtual 941	org/eclipse/team/internal/ccvs/core/resources/SynchronizerSyncInfoCache:setCachedSyncBytes	(Lorg/eclipse/core/resources/IResource;[BZ)V
    //   129: aload 5
    //   131: athrow
    //   132: aload_0
    //   133: getfield 823	org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer:synchronizerCache	Lorg/eclipse/team/internal/ccvs/core/resources/SynchronizerSyncInfoCache;
    //   136: aload_1
    //   137: aconst_null
    //   138: iconst_1
    //   139: invokevirtual 941	org/eclipse/team/internal/ccvs/core/resources/SynchronizerSyncInfoCache:setCachedSyncBytes	(Lorg/eclipse/core/resources/IResource;[BZ)V
    //   142: return
    // Line number table:
    //   Java source line #1917	-> byte code offset #0
    //   Java source line #1918	-> byte code offset #4
    //   Java source line #1919	-> byte code offset #14
    //   Java source line #1920	-> byte code offset #18
    //   Java source line #1921	-> byte code offset #25
    //   Java source line #1923	-> byte code offset #30
    //   Java source line #1924	-> byte code offset #36
    //   Java source line #1925	-> byte code offset #47
    //   Java source line #1927	-> byte code offset #52
    //   Java source line #1929	-> byte code offset #64
    //   Java source line #1932	-> byte code offset #73
    //   Java source line #1934	-> byte code offset #75
    //   Java source line #1935	-> byte code offset #82
    //   Java source line #1936	-> byte code offset #84
    //   Java source line #1937	-> byte code offset #94
    //   Java source line #1936	-> byte code offset #97
    //   Java source line #1938	-> byte code offset #107
    //   Java source line #1934	-> byte code offset #110
    //   Java source line #1935	-> byte code offset #117
    //   Java source line #1936	-> byte code offset #119
    //   Java source line #1937	-> byte code offset #129
    //   Java source line #1936	-> byte code offset #132
    //   Java source line #1939	-> byte code offset #142
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	143	0	this	EclipseSynchronizer
    //   0	143	1	resource	IResource
    //   13	54	2	syncBytes	byte[]
    //   35	23	3	newBytes	byte[]
    //   73	35	4	localObject1	Object
    //   82	13	5	localObject2	Object
    //   117	13	5	localObject3	Object
    // Exception table:
    //   from	to	target	type
    //   0	73	73	finally
    //   75	82	82	finally
    //   110	117	117	finally
  }
  
  private void purgeDirtyCache(IProject project, IProgressMonitor monitor)
    throws CVSException
  {
    sessionPropertyCache.purgeDirtyCache(project);
  }
}

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

import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.CVSTag;
import org.eclipse.team.internal.ccvs.core.ICVSFile;
import org.eclipse.team.internal.ccvs.core.ICVSFolder;
import org.eclipse.team.internal.ccvs.core.ICVSResource;
import org.eclipse.team.internal.ccvs.core.Policy;
import org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation;

public class FileContentCachingService
{
  String[] fileDiffs;
  private CVSRepositoryLocation repository;
  private ICVSFolder remoteRoot;
  
  public static RemoteFolderTree buildRemoteTree(CVSRepositoryLocation repository, ICVSFolder root, CVSTag tag, IProgressMonitor monitor)
    throws CVSException
  {
    monitor.beginTask(null, 100);
    try
    {
      RemoteFolderTreeBuilder builder = new RemoteFolderTreeBuilder(repository, root, tag);
      RemoteFolderTree tree = builder.buildTree(new ICVSResource[] { root }, Policy.subMonitorFor(monitor, 50));
      FileContentCachingService service = new FileContentCachingService(repository, tree, builder.getFileDiffs());
      service.cacheFileContents(Policy.subMonitorFor(monitor, 50));
      return tree;
    }
    finally
    {
      monitor.done();
    }
  }
  
  public static void fetchFileContents(RemoteFolderTree root, String[] filePaths, IProgressMonitor monitor)
    throws CVSException
  {
    FileContentCachingService service = new FileContentCachingService((CVSRepositoryLocation)root.getRepository(), root, filePaths);
    service.cacheFileContents(monitor);
  }
  
  public static RemoteFile buildRemoteTree(CVSRepositoryLocation repository, ICVSFile file, CVSTag tag, IProgressMonitor monitor)
    throws CVSException
  {
    monitor.beginTask(null, 100);
    try
    {
      RemoteFolderTreeBuilder builder = new RemoteFolderTreeBuilder(repository, file.getParent(), tag);
      RemoteFile remote = builder.buildTree(file, monitor);
      if (builder.getFileDiffs().length > 0) {
        remote.getStorage(Policy.subMonitorFor(monitor, 50));
      }
      return remote;
    }
    catch (TeamException e)
    {
      throw CVSException.wrapException(e);
    }
    finally
    {
      monitor.done();
    }
  }
  
  public FileContentCachingService(CVSRepositoryLocation repository, RemoteFolderTree tree, String[] fileDiffs)
  {
    this.repository = repository;
    remoteRoot = tree;
    this.fileDiffs = fileDiffs;
  }
  
  /* Error */
  private void cacheFileContents(IProgressMonitor monitor)
    throws CVSException
  {
    // Byte code:
    //   0: aload_0
    //   1: invokespecial 192	org/eclipse/team/internal/ccvs/core/resources/FileContentCachingService:getUncachedFiles	()[Ljava/lang/String;
    //   4: astore_2
    //   5: aload_2
    //   6: arraylength
    //   7: ifne +4 -> 11
    //   10: return
    //   11: aload_1
    //   12: aconst_null
    //   13: bipush 10
    //   15: aload_2
    //   16: arraylength
    //   17: bipush 100
    //   19: imul
    //   20: iadd
    //   21: invokeinterface 206 3 0
    //   26: aload_1
    //   27: invokestatic 186	org/eclipse/team/internal/ccvs/core/Policy:checkCanceled	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   30: new 94	org/eclipse/team/internal/ccvs/core/client/Session
    //   33: dup
    //   34: aload_0
    //   35: getfield 180	org/eclipse/team/internal/ccvs/core/resources/FileContentCachingService:repository	Lorg/eclipse/team/internal/ccvs/core/connection/CVSRepositoryLocation;
    //   38: aload_0
    //   39: getfield 179	org/eclipse/team/internal/ccvs/core/resources/FileContentCachingService:remoteRoot	Lorg/eclipse/team/internal/ccvs/core/ICVSFolder;
    //   42: iconst_0
    //   43: invokespecial 190	org/eclipse/team/internal/ccvs/core/client/Session:<init>	(Lorg/eclipse/team/internal/ccvs/core/ICVSRepositoryLocation;Lorg/eclipse/team/internal/ccvs/core/ICVSFolder;Z)V
    //   46: astore_3
    //   47: aload_3
    //   48: aload_1
    //   49: bipush 10
    //   51: invokestatic 187	org/eclipse/team/internal/ccvs/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   54: iconst_0
    //   55: invokevirtual 189	org/eclipse/team/internal/ccvs/core/client/Session:open	(Lorg/eclipse/core/runtime/IProgressMonitor;Z)V
    //   58: aload_1
    //   59: invokestatic 186	org/eclipse/team/internal/ccvs/core/Policy:checkCanceled	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   62: getstatic 176	org/eclipse/team/internal/ccvs/core/client/Command:UPDATE	Lorg/eclipse/team/internal/ccvs/core/client/Update;
    //   65: aload_3
    //   66: getstatic 175	org/eclipse/team/internal/ccvs/core/client/Command:NO_GLOBAL_OPTIONS	[Lorg/eclipse/team/internal/ccvs/core/client/Command$GlobalOption;
    //   69: iconst_1
    //   70: anewarray 93	org/eclipse/team/internal/ccvs/core/client/Command$LocalOption
    //   73: dup
    //   74: iconst_0
    //   75: getstatic 177	org/eclipse/team/internal/ccvs/core/client/Update:IGNORE_LOCAL_CHANGES	Lorg/eclipse/team/internal/ccvs/core/client/Command$LocalOption;
    //   78: aastore
    //   79: aload_2
    //   80: aconst_null
    //   81: aload_1
    //   82: aload_2
    //   83: arraylength
    //   84: bipush 100
    //   86: imul
    //   87: invokestatic 187	org/eclipse/team/internal/ccvs/core/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   90: invokevirtual 191	org/eclipse/team/internal/ccvs/core/client/Update:execute	(Lorg/eclipse/team/internal/ccvs/core/client/Session;[Lorg/eclipse/team/internal/ccvs/core/client/Command$GlobalOption;[Lorg/eclipse/team/internal/ccvs/core/client/Command$LocalOption;[Ljava/lang/String;Lorg/eclipse/team/internal/ccvs/core/client/listeners/ICommandOutputListener;Lorg/eclipse/core/runtime/IProgressMonitor;)Lorg/eclipse/core/runtime/IStatus;
    //   93: astore 4
    //   95: aload 4
    //   97: invokeinterface 207 1 0
    //   102: ifne +33 -> 135
    //   105: new 85	org/eclipse/team/internal/ccvs/core/CVSException
    //   108: dup
    //   109: aload 4
    //   111: invokespecial 183	org/eclipse/team/internal/ccvs/core/CVSException:<init>	(Lorg/eclipse/core/runtime/IStatus;)V
    //   114: invokestatic 185	org/eclipse/team/internal/ccvs/core/CVSProviderPlugin:log	(Lorg/eclipse/core/runtime/CoreException;)V
    //   117: goto +18 -> 135
    //   120: astore 5
    //   122: aload_3
    //   123: invokevirtual 188	org/eclipse/team/internal/ccvs/core/client/Session:close	()V
    //   126: aload_1
    //   127: invokeinterface 205 1 0
    //   132: aload 5
    //   134: athrow
    //   135: aload_3
    //   136: invokevirtual 188	org/eclipse/team/internal/ccvs/core/client/Session:close	()V
    //   139: aload_1
    //   140: invokeinterface 205 1 0
    //   145: return
    // Line number table:
    //   Java source line #90	-> byte code offset #0
    //   Java source line #91	-> byte code offset #5
    //   Java source line #94	-> byte code offset #11
    //   Java source line #95	-> byte code offset #26
    //   Java source line #96	-> byte code offset #30
    //   Java source line #97	-> byte code offset #47
    //   Java source line #99	-> byte code offset #58
    //   Java source line #100	-> byte code offset #62
    //   Java source line #101	-> byte code offset #66
    //   Java source line #102	-> byte code offset #69
    //   Java source line #103	-> byte code offset #79
    //   Java source line #104	-> byte code offset #80
    //   Java source line #105	-> byte code offset #81
    //   Java source line #100	-> byte code offset #90
    //   Java source line #106	-> byte code offset #95
    //   Java source line #108	-> byte code offset #105
    //   Java source line #110	-> byte code offset #120
    //   Java source line #111	-> byte code offset #122
    //   Java source line #112	-> byte code offset #126
    //   Java source line #113	-> byte code offset #132
    //   Java source line #111	-> byte code offset #135
    //   Java source line #112	-> byte code offset #139
    //   Java source line #114	-> byte code offset #145
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	146	0	this	FileContentCachingService
    //   0	146	1	monitor	IProgressMonitor
    //   4	79	2	files	String[]
    //   46	90	3	session	org.eclipse.team.internal.ccvs.core.client.Session
    //   93	17	4	status	org.eclipse.core.runtime.IStatus
    //   120	13	5	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   58	120	120	finally
  }
  
  private String[] getUncachedFiles()
  {
    if (fileDiffs.length == 0) {
      return fileDiffs;
    }
    List existing = new ArrayList();
    for (int i = 0; i < fileDiffs.length; i++)
    {
      String filePath = fileDiffs[i];
      try
      {
        ICVSFile file = remoteRoot.getFile(filePath);
        if (((file instanceof RemoteFile)) && 
          (!((RemoteFile)file).isContentsCached())) {
          existing.add(filePath);
        }
      }
      catch (CVSException localCVSException) {}
    }
    return (String[])existing.toArray(new String[existing.size()]);
  }
}

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

import java.util.Set;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.resources.IResourceDeltaVisitor;
import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.internal.ccvs.core.CVSException;
import org.eclipse.team.internal.ccvs.core.CVSProviderPlugin;

class FileModificationManager$1
  implements IResourceDeltaVisitor
{
  final FileModificationManager this$0;
  
  FileModificationManager$1(FileModificationManager paramFileModificationManager)
  {
    this$0 = paramFileModificationManager;
  }
  
  public boolean visit(IResourceDelta delta)
  {
    IResource resource = delta.getResource();
    if (resource.getType() == 4)
    {
      IProject project = (IProject)resource;
      if (!project.isAccessible()) {
        return false;
      }
      if ((delta.getFlags() & 0x4000) != 0) {
        return false;
      }
      if (RepositoryProvider.getProvider(project, CVSProviderPlugin.getTypeId()) == null) {
        return false;
      }
    }
    if ((resource.getType() == 1) && (delta.getKind() == 4) && (resource.exists()))
    {
      int flags = delta.getFlags();
      if ((flags & this$0.INTERESTING_CHANGES) != 0) {
        this$0.resourceChanged(resource, false);
      }
    }
    else if (delta.getKind() == 1)
    {
      try
      {
        EclipseSynchronizer.getInstance().handleAdded(resource);
      }
      catch (CVSException e)
      {
        CVSProviderPlugin.log(e);
      }
      this$0.resourceChanged(resource, true);
    }
    else if (delta.getKind() == 2)
    {
      try
      {
        EclipseSynchronizer.getInstance().handleDeleted(resource);
      }
      catch (CVSException e)
      {
        CVSProviderPlugin.log(e);
      }
      this$0.modifiedResources.add(resource);
    }
    return true;
  }
}

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

import java.util.HashSet;
import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceChangeEvent;
import org.eclipse.core.resources.IResourceChangeListener;
import org.eclipse.core.resources.IResourceDelta;
import org.eclipse.core.resources.IResourceDeltaVisitor;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.team.core.RepositoryProvider;
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.util.ResourceStateChangeListeners;

public class FileModificationManager
  implements IResourceChangeListener
{
  private static final QualifiedName UPDATE_TIMESTAMP = new QualifiedName("org.eclipse.team.cvs.core", "update-timestamp");
  Set modifiedResources = new HashSet();
  protected int INTERESTING_CHANGES = 323840;
  
  public void resourceChanged(IResourceChangeEvent event)
  {
    try
    {
      event.getDelta().accept(new IResourceDeltaVisitor()
      {
        public boolean visit(IResourceDelta delta)
        {
          IResource resource = delta.getResource();
          if (resource.getType() == 4)
          {
            IProject project = (IProject)resource;
            if (!project.isAccessible()) {
              return false;
            }
            if ((delta.getFlags() & 0x4000) != 0) {
              return false;
            }
            if (RepositoryProvider.getProvider(project, CVSProviderPlugin.getTypeId()) == null) {
              return false;
            }
          }
          if ((resource.getType() == 1) && (delta.getKind() == 4) && (resource.exists()))
          {
            int flags = delta.getFlags();
            if ((flags & INTERESTING_CHANGES) != 0) {
              resourceChanged(resource, false);
            }
          }
          else if (delta.getKind() == 1)
          {
            try
            {
              EclipseSynchronizer.getInstance().handleAdded(resource);
            }
            catch (CVSException e)
            {
              CVSProviderPlugin.log(e);
            }
            resourceChanged(resource, true);
          }
          else if (delta.getKind() == 2)
          {
            try
            {
              EclipseSynchronizer.getInstance().handleDeleted(resource);
            }
            catch (CVSException e)
            {
              CVSProviderPlugin.log(e);
            }
            modifiedResources.add(resource);
          }
          return true;
        }
      });
      if (!modifiedResources.isEmpty())
      {
        ResourceStateChangeListeners.getListener().resourceModified(
          (IResource[])modifiedResources.toArray(new IResource[modifiedResources.size()]));
        modifiedResources.clear();
      }
    }
    catch (CoreException e)
    {
      CVSProviderPlugin.log(e);
    }
  }
  
  public void updated(ICVSFile mFile)
  {
    try
    {
      if ((mFile instanceof EclipseFile))
      {
        IFile file = (IFile)mFile.getIResource();
        file.setSessionProperty(UPDATE_TIMESTAMP, new Long(file.getModificationStamp()));
      }
    }
    catch (CoreException e)
    {
      CVSProviderPlugin.log(e);
    }
  }
  
  void resourceChanged(IResource resource, boolean addition)
  {
    if (isCleanUpdate(resource)) {
      return;
    }
    try
    {
      EclipseResource cvsResource = (EclipseResource)CVSWorkspaceRoot.getCVSResourceFor(resource);
      if (!cvsResource.isIgnored())
      {
        cvsResource.handleModification(addition);
        modifiedResources.add(resource);
      }
      if ((cvsResource.getName().equals(".cvsignore")) && (cvsResource.isIgnored()))
      {
        EclipseSynchronizer.getInstance().setModified((EclipseFile)cvsResource, 1);
        modifiedResources.add(resource);
      }
    }
    catch (CVSException e)
    {
      CVSProviderPlugin.log(e);
    }
  }
  
  private boolean isCleanUpdate(IResource resource)
  {
    if (resource.getType() != 1) {
      return false;
    }
    long modStamp = resource.getModificationStamp();
    Long whenWeWrote;
    try
    {
      Long whenWeWrote = (Long)resource.getSessionProperty(UPDATE_TIMESTAMP);
      resource.setSessionProperty(UPDATE_TIMESTAMP, null);
    }
    catch (CoreException e)
    {
      CVSProviderPlugin.log(e);
      whenWeWrote = null;
    }
    return (whenWeWrote != null) && (whenWeWrote.longValue() == modStamp);
  }
}

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

import java.util.ArrayList;
import java.util.List;
import org.eclipse.team.internal.ccvs.core.ICVSRemoteFile;
import org.eclipse.team.internal.ccvs.core.ILogEntry;
import org.eclipse.team.internal.ccvs.core.client.listeners.ILogEntryListener;

final class RemoteFile$LogEntryListener
  implements ILogEntryListener
{
  private final List entries;
  final RemoteFile this$0;
  
  RemoteFile$LogEntryListener(RemoteFile paramRemoteFile, LogEntryListener paramLogEntryListener)
  {
    this(paramRemoteFile);
  }
  
  private RemoteFile$LogEntryListener(RemoteFile paramRemoteFile)
  {
    this$0 = paramRemoteFile;
    entries = new ArrayList();
  }
  
  public void handleLogEntryReceived(ILogEntry entry)
  {
    if (entry.getRemoteFile().getRepositoryRelativePath().equals(this$0.getRepositoryRelativePath())) {
      entries.add(entry);
    }
  }
  
  public ILogEntry[] getEntries()
  {
    return (ILogEntry[])entries.toArray(new ILogEntry[entries.size()]);
  }
}

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

import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IStorage;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.core.history.IFileRevision;
import org.eclipse.team.core.variants.CachedResourceVariant;
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.CVSTag;
import org.eclipse.team.internal.ccvs.core.ICVSFile;
import org.eclipse.team.internal.ccvs.core.ICVSFolder;
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.ICVSResource;
import org.eclipse.team.internal.ccvs.core.ICVSResourceVisitor;
import org.eclipse.team.internal.ccvs.core.ILogEntry;
import org.eclipse.team.internal.ccvs.core.Policy;
import org.eclipse.team.internal.ccvs.core.client.Command;
import org.eclipse.team.internal.ccvs.core.client.Command.KSubstOption;
import org.eclipse.team.internal.ccvs.core.client.Command.LocalOption;
import org.eclipse.team.internal.ccvs.core.client.RTag;
import org.eclipse.team.internal.ccvs.core.client.Session;
import org.eclipse.team.internal.ccvs.core.client.Update;
import org.eclipse.team.internal.ccvs.core.client.listeners.ILogEntryListener;
import org.eclipse.team.internal.ccvs.core.connection.CVSServerException;
import org.eclipse.team.internal.ccvs.core.filehistory.CVSResourceVariantFileRevision;
import org.eclipse.team.internal.ccvs.core.filesystem.CVSURI;
import org.eclipse.team.internal.ccvs.core.syncinfo.MutableResourceSyncInfo;
import org.eclipse.team.internal.ccvs.core.syncinfo.NotifyInfo;
import org.eclipse.team.internal.ccvs.core.syncinfo.ResourceSyncInfo;

public class RemoteFile
  extends RemoteResource
  implements ICVSRemoteFile
{
  private byte[] syncBytes;
  private ILogEntry entry;
  
  private final class LogEntryListener
    implements ILogEntryListener
  {
    LogEntryListener(LogEntryListener paramLogEntryListener)
    {
      this();
    }
    
    private final List entries = new ArrayList();
    
    public void handleLogEntryReceived(ILogEntry entry)
    {
      if (entry.getRemoteFile().getRepositoryRelativePath().equals(getRepositoryRelativePath())) {
        entries.add(entry);
      }
    }
    
    public ILogEntry[] getEntries()
    {
      return (ILogEntry[])entries.toArray(new ILogEntry[entries.size()]);
    }
    
    private LogEntryListener() {}
  }
  
  private boolean fetching = false;
  private boolean executable = false;
  
  public static RemoteFile getBase(RemoteFolder parent, ICVSFile managed)
    throws CVSException
  {
    Assert.isNotNull(parent, "A parent folder must be provided for file " + managed.getName());
    byte[] syncBytes = managed.getSyncBytes();
    if ((syncBytes == null) || (ResourceSyncInfo.isAddition(syncBytes))) {
      return null;
    }
    if (ResourceSyncInfo.isDeletion(syncBytes)) {
      syncBytes = ResourceSyncInfo.convertFromDeletion(syncBytes);
    }
    RemoteFile file = new RemoteFile(parent, syncBytes);
    parent.setChildren(new ICVSRemoteResource[] { file });
    return file;
  }
  
  public static RemoteFile fromBytes(IResource local, byte[] bytes, byte[] parentBytes)
    throws CVSException
  {
    Assert.isNotNull(bytes);
    Assert.isTrue(local.getType() == 1);
    RemoteFolder parent = RemoteFolder.fromBytes(local.getParent(), parentBytes);
    RemoteFile file = new RemoteFile(parent, bytes);
    parent.setChildren(new ICVSRemoteResource[] { file });
    return file;
  }
  
  public static RemoteFile create(String filePath, ICVSRepositoryLocation location)
  {
    return create(filePath, location, null, null);
  }
  
  public static RemoteFile create(String filePath, ICVSRepositoryLocation location, CVSTag tag, String revision)
  {
    Assert.isNotNull(filePath);
    Assert.isNotNull(location);
    IPath path = new Path(null, filePath);
    if ((tag != null) && (revision != null) && (tag.getName().equals(revision))) {
      tag = null;
    }
    RemoteFolder parent = new RemoteFolder(null, location, path.removeLastSegments(1).toString(), tag);
    RemoteFile file = new RemoteFile(parent, 0, path.lastSegment(), revision, null, tag);
    parent.setChildren(new ICVSRemoteResource[] { file });
    return file;
  }
  
  public RemoteFile(RemoteFolder parent, int workspaceSyncState, String name, String revision, Command.KSubstOption keywordMode, CVSTag tag)
  {
    this(parent, name, workspaceSyncState, getSyncBytes(name, revision, keywordMode, tag));
  }
  
  private static byte[] getSyncBytes(String name, String revision, Command.KSubstOption keywordMode, CVSTag tag)
  {
    if (revision == null) {
      revision = "0";
    }
    if (keywordMode == null) {
      keywordMode = Command.KSubstOption.fromMode("");
    }
    MutableResourceSyncInfo newInfo = new MutableResourceSyncInfo(name, revision);
    newInfo.setKeywordMode(keywordMode);
    newInfo.setTag(tag);
    return newInfo.getBytes();
  }
  
  public RemoteFile(RemoteFolder parent, byte[] syncBytes)
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