1 11 package org.eclipse.team.internal.ccvs.core.client; 12 13 14 import org.eclipse.core.runtime.Assert; 15 import org.eclipse.core.runtime.IProgressMonitor; 16 import org.eclipse.team.internal.ccvs.core.CVSException; 17 import org.eclipse.team.internal.ccvs.core.ICVSFolder; 18 import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo; 19 import org.eclipse.team.internal.ccvs.core.syncinfo.MutableFolderSyncInfo; 20 21 37 class StaticHandler extends ResponseHandler { 38 private final boolean setStaticDirectory; 39 40 public StaticHandler(boolean setStaticDirectory) { 41 this.setStaticDirectory = setStaticDirectory; 42 } 43 44 public String getResponseID() { 45 if (setStaticDirectory) { 46 return "Set-static-directory"; } else { 48 return "Clear-static-directory"; } 50 } 51 52 public void handle(Session session, String localDir, 53 IProgressMonitor monitor) throws CVSException { 54 String repositoryDir = session.readLine(); 56 57 Assert.isTrue(repositoryDir.endsWith("/")); repositoryDir = repositoryDir.substring(0, repositoryDir.length() - 1); 60 try { 61 ICVSFolder folder = createFolder(session, localDir, repositoryDir); 62 FolderSyncInfo syncInfo = folder.getFolderSyncInfo(); 63 if (syncInfo == null) return; 65 MutableFolderSyncInfo newInfo = syncInfo.cloneMutable(); 66 newInfo.setStatic(setStaticDirectory); 67 if (!syncInfo.equals(newInfo)) 69 folder.setFolderSyncInfo(newInfo); 70 } catch (CVSException e) { 71 if (!handleInvalidResourceName(session, session.getLocalRoot().getFolder(localDir), e)) { 72 throw e; 73 } 74 } 75 } 76 } 77 78 | Popular Tags |