Search in sources :

Example 21 with Command

use of com.mks.api.Command in project maven-scm by apache.

the class Sandbox method lock.

/**
 * Executes a 'si lock' command using the relativeName of the file
 *
 * @param memberFile   Full path to the member's current sandbox location
 * @param relativeName Relative path from the nearest subproject or project
 * @return MKS API Response object
 * @throws APIException
 */
public Response lock(File memberFile, String relativeName) throws APIException {
    // Setup the lock command
    api.getLogger().debug("Locking member: " + memberFile.getAbsolutePath());
    Command siLock = new Command(Command.SI, "lock");
    siLock.addOption(new Option("revision", ":member"));
    siLock.addOption(new Option("cpid", cpid));
    siLock.addOption(new Option("cwd", memberFile.getParentFile().getAbsolutePath()));
    siLock.addSelection(relativeName);
    // Execute the lock command
    return api.runCommand(siLock);
}
Also used : Command(com.mks.api.Command) Option(com.mks.api.Option)

Aggregations

Command (com.mks.api.Command)21 Option (com.mks.api.Option)20 Response (com.mks.api.response.Response)9 WorkItem (com.mks.api.response.WorkItem)5 WorkItemIterator (com.mks.api.response.WorkItemIterator)5 ArrayList (java.util.ArrayList)4 ChangeFile (org.apache.maven.scm.ChangeFile)4 ScmFile (org.apache.maven.scm.ScmFile)4 MultiValue (com.mks.api.MultiValue)3 APIException (com.mks.api.response.APIException)3 File (java.io.File)3 Item (com.mks.api.response.Item)2 Hashtable (java.util.Hashtable)2 CmdRunner (com.mks.api.CmdRunner)1 FileOption (com.mks.api.FileOption)1 Field (com.mks.api.response.Field)1 Date (java.util.Date)1 ChangeSet (org.apache.maven.scm.ChangeSet)1 ChangeLogSet (org.apache.maven.scm.command.changelog.ChangeLogSet)1