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.*; 17 18 35 class CopyHandler extends ResponseHandler { 36 public String getResponseID() { 37 return "Copy-file"; } 39 40 public void handle(Session session, String localDir, 41 IProgressMonitor monitor) throws CVSException { 42 String repositoryFile = session.readLine(); 44 String newFile = session.readLine(); 45 if (session.isNoLocalChanges() || ! session.isCreateBackups()) return; 46 47 String fileName = repositoryFile.substring(repositoryFile.lastIndexOf("/") + 1); ICVSFolder mParent = session.getLocalRoot().getFolder(localDir); 50 ICVSFile mFile = mParent.getFile(fileName); 51 52 Assert.isTrue(mParent.exists()); 53 Assert.isTrue(mFile.exists() && mFile.isManaged()); 54 55 mFile.copyTo(newFile); 57 } 58 } 59 60 | Popular Tags |