1 11 package org.eclipse.team.internal.ccvs.core.client; 12 13 14 import org.eclipse.core.runtime.IProgressMonitor; 15 import org.eclipse.core.runtime.IStatus; 16 import org.eclipse.team.internal.ccvs.core.CVSException; 17 import org.eclipse.team.internal.ccvs.core.ICVSResource; 18 import org.eclipse.team.internal.ccvs.core.ICVSResourceVisitor; 19 import org.eclipse.team.internal.ccvs.core.client.listeners.ICommandOutputListener; 20 21 22 public class Import extends Command { 23 protected Import() { } 24 protected String getRequestId() { 25 return "import"; } 27 28 protected ICVSResource[] computeWorkResources(Session session, LocalOption[] localOptions, 29 String [] arguments) throws CVSException { 30 if (arguments.length < 3) throw new IllegalArgumentException (); 31 return new ICVSResource[0]; 32 } 33 34 protected IStatus doExecute(Session session, GlobalOption[] globalOptions, 35 LocalOption[] localOptions, String [] arguments, ICommandOutputListener listener, 36 IProgressMonitor monitor) throws CVSException { 37 38 if (findOption(localOptions, "-b") == null) { LocalOption[] newLocalOptions = new LocalOption[localOptions.length + 1]; 42 newLocalOptions[0] = new LocalOption("-b", "1.1.1"); System.arraycopy(localOptions, 0, newLocalOptions, 1, localOptions.length); 44 localOptions = newLocalOptions; 45 } 46 return super.doExecute(session, globalOptions, localOptions, arguments, listener, monitor); 47 } 48 49 protected ICVSResource[] sendLocalResourceState(Session session, GlobalOption[] globalOptions, 50 LocalOption[] localOptions, ICVSResource[] resources, IProgressMonitor monitor) 51 throws CVSException { 52 53 ICVSResourceVisitor visitor = new ImportStructureVisitor(session, 54 collectOptionArguments(localOptions, "-W"), monitor); session.getLocalRoot().accept(visitor); 56 return resources; 57 } 58 59 protected void sendLocalWorkingDirectory(Session session) throws CVSException { 60 session.sendConstructedRootDirectory(); 61 } 62 63 } 64 65 | Popular Tags |