Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.netbeans.lib.cvsclient.command.impord;
 
 import  org.netbeans.lib.cvsclient.IClientEnvironment;
 import  org.netbeans.lib.cvsclient.IRequestProcessor;
 import  org.netbeans.lib.cvsclient.connection.AuthenticationException;
 import  org.netbeans.lib.cvsclient.command.Command;
 import  org.netbeans.lib.cvsclient.command.CommandException;
 import  org.netbeans.lib.cvsclient.command.IOCommandException;
 import  org.netbeans.lib.cvsclient.event.ICvsListenerRegistry;
import  org.netbeans.lib.cvsclient.event.IEventSender;
import  org.netbeans.lib.cvsclient.file.DirectoryObject;
import  org.netbeans.lib.cvsclient.file.FileUtils;
import  org.netbeans.lib.cvsclient.progress.IProgressViewer;
import  org.netbeans.lib.cvsclient.progress.sending.DummyRequestsProgressHandler;
import  org.netbeans.lib.cvsclient.request.CommandRequest;
import  org.netbeans.lib.cvsclient.request.DirectoryRequest;
import  org.netbeans.lib.cvsclient.request.Requests;
import  org.netbeans.lib.cvsclient.util.BugLog;

Author(s):
Thomas Singer
public final class CreateModuleCommand extends Command {
	// Fields =================================================================
	private String module;
	// Setup ==================================================================
	public CreateModuleCommand() {
	}
	// Implemented ============================================================
	public boolean execute(IRequestProcessor requestProcessor, IEventSender eventManager, ICvsListenerRegistry listenerRegistry, IClientEnvironment clientEnvironment, IProgressViewer progressViewerthrows CommandException,
                                                                                                                                                                                                                  AuthenticationException {
		// check necessary fields
		BugLog.getInstance().assertNotNull();
		final String repositoryRoot = FileUtils.removeTrailingSlash(clientEnvironment.getCvsRoot().getRepositoryPath()) + '/' + ;
		final Requests requests = new Requests(CommandRequest.IMPORT, clientEnvironment);
		requests.addArgumentRequest("-b");
		requests.addArgumentRequest("1.1.1");
		requests.addMessageRequests("Create module");
		requests.addArgumentRequest();
		requests.addArgumentRequest("vendor-tag");
		requests.addArgumentRequest("release-tag");
		requests.addRequest(new DirectoryRequest("."repositoryRoot));
		if (!requestProcessor.processRequests(requestsnew DummyRequestsProgressHandler())) {
			return false;
		}
		try {
			createCvsDirectory(clientEnvironmentrepositoryRoot);
		}
		catch (IOException ex) {
			throw new IOCommandException(ex);
		}
		return true;
	}
	public void resetCvsCommand() {
		super.resetCvsCommand();
		setModule(null);
	}
		return "import " + ;
	}
	// Accessing ==============================================================
	public void setModule(String module) {
		this. = getTrimmedString(module);
	}
	// Utils ==================================================================
	private void createCvsDirectory(IClientEnvironment clientEnvironmentString repositoryRootthrows IOException {
		clientEnvironment.getAdminWriter().ensureCvsDirectory(DirectoryObject.getRoot(), repositoryRootclientEnvironment.getCvsRoot(), clientEnvironment.getCvsFileSystem());
	}
New to GrepCode? Check out our FAQ X