use of com.mks.api.FileOption in project maven-scm by apache.
the class Member method checkout.
/**
* Performs a checkout of this MKS Integrity Source File to a working file location on the build server represented
* by targetFile
*
* @param api MKS API Session
* @return true if the operation succeeded or false if failed
* @throws APIException
*/
public boolean checkout(APISession api) throws APIException {
// Make sure the directory is created
if (!targetFile.getParentFile().isDirectory()) {
targetFile.getParentFile().mkdirs();
}
// Construct the project check-co command
Command coCMD = new Command(Command.SI, "projectco");
coCMD.addOption(new Option(overwriteExisting));
coCMD.addOption(new Option("nolock"));
coCMD.addOption(new Option("project", projectConfigPath));
coCMD.addOption(new FileOption("targetFile", targetFile));
coCMD.addOption(new Option(restoreTimestamp));
coCMD.addOption(new Option("lineTerminator", lineTerminator));
coCMD.addOption(new Option("revision", memberRev));
// Add the member selection
coCMD.addSelection(memberID);
// Execute the checkout command
Response res = api.runCommand(coCMD);
// Return true if we were successful
return (res.getExitCode() == 0);
}
Aggregations