1 11 package org.eclipse.team.internal.ccvs.core.syncinfo; 12 13 import org.eclipse.core.resources.IContainer; 14 import org.eclipse.core.resources.IResource; 15 import org.eclipse.team.core.TeamException; 16 import org.eclipse.team.core.variants.ResourceVariantByteStore; 17 import org.eclipse.team.internal.ccvs.core.resources.EclipseSynchronizer; 18 19 20 public class CVSBaseResourceVariantTree extends ResourceVariantByteStore { 21 public void dispose() { 22 } 24 public byte[] getBytes(IResource resource) throws TeamException { 25 if (resource.getType() == IResource.FILE) { 26 byte[] bytes = EclipseSynchronizer.getInstance().getSyncBytes(resource); 28 if (bytes != null) { 29 if (ResourceSyncInfo.isDeletion(bytes)) { 31 bytes = ResourceSyncInfo.convertFromDeletion(bytes); 32 } else if (ResourceSyncInfo.isAddition(bytes)) { 33 bytes = null; 34 } 35 } 36 return bytes; 37 } else { 38 FolderSyncInfo info = EclipseSynchronizer.getInstance().getFolderSync((IContainer)resource); 40 if (info == null) return null; 41 return info.getBytes(); 42 } 43 } 44 public boolean isVariantKnown(IResource resource) throws TeamException { 45 return getBytes(resource) != null; 46 } 47 public boolean flushBytes(IResource resource, int depth) throws TeamException { 48 throw new UnsupportedOperationException (); 49 } 50 public boolean setBytes(IResource resource, byte[] bytes) throws TeamException { 51 throw new UnsupportedOperationException (); 52 } 53 public boolean deleteBytes(IResource resource) throws TeamException { 54 throw new UnsupportedOperationException (); 55 } 56 57 60 public IResource[] members(IResource resource) throws TeamException { 61 if(resource.getType() == IResource.FILE) { 62 return new IResource[0]; 63 } 64 return EclipseSynchronizer.getInstance().members((IContainer)resource); 65 } 66 } 67 | Popular Tags |