1 11 package org.eclipse.team.internal.ccvs.core.resources; 12 13 14 import org.eclipse.core.resources.IResource; 15 import org.eclipse.core.runtime.Assert; 16 import org.eclipse.core.runtime.IProgressMonitor; 17 import org.eclipse.team.internal.ccvs.core.*; 18 import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo; 19 import org.eclipse.team.internal.ccvs.core.util.KnownRepositories; 20 21 26 public class RemoteFolderTree extends RemoteFolder { 27 28 public static RemoteFolderTree fromBytes(RemoteFolderTree parent, IResource local, byte[] bytes) throws CVSException { 29 Assert.isNotNull(bytes); 30 Assert.isTrue(local.getType() != IResource.FILE); 31 FolderSyncInfo syncInfo = FolderSyncInfo.getFolderSyncInfo(bytes); 32 return new RemoteFolderTree(parent, local.getName(), KnownRepositories.getInstance().getRepository(syncInfo.getRoot()), syncInfo.getRepository(), syncInfo.getTag(), syncInfo.getIsStatic()); 33 } 34 35 public RemoteFolderTree(RemoteFolder parent, ICVSRepositoryLocation repository, String repositoryRelativePath, CVSTag tag) { 36 super(parent, repository, repositoryRelativePath, tag); 37 } 38 39 public RemoteFolderTree(RemoteFolder parent, String name, ICVSRepositoryLocation repository, String repositoryRelativePath, CVSTag tag) { 40 this(parent, name, repository, repositoryRelativePath, tag, false); 41 } 42 43 public RemoteFolderTree(RemoteFolder parent, String name, ICVSRepositoryLocation repository, String repositoryRelativePath, CVSTag tag, boolean isStatic) { 44 super(parent, name, repository, repositoryRelativePath, tag, isStatic); 45 } 46 47 50 public ICVSRemoteResource[] getMembers(CVSTag tagName, IProgressMonitor monitor) throws CVSException { 51 if (getChildren() == null) 52 setChildren(super.getMembers(tagName, monitor)); 53 return getChildren(); 54 } 55 56 60 public void setChildren(ICVSRemoteResource[] children) { 61 super.setChildren(children); 62 } 63 64 67 public void acceptChildren(ICVSResourceVisitor visitor) throws CVSException { 68 ICVSRemoteResource[] children = getChildren(); 69 if (children == null) return; 70 for (int i=0; i<children.length; i++) { 71 ((ICVSResource)children[i]).accept(visitor); 72 } 73 } 74 } 75 76 | Popular Tags |