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);
}
Aggregations