Search in sources :

Example 1 with FileOption

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);
}
Also used : Response(com.mks.api.response.Response) Command(com.mks.api.Command) FileOption(com.mks.api.FileOption) Option(com.mks.api.Option) FileOption(com.mks.api.FileOption)

Aggregations

Command (com.mks.api.Command)1 FileOption (com.mks.api.FileOption)1 Option (com.mks.api.Option)1 Response (com.mks.api.response.Response)1