Skip to main content
1-Visitor
March 3, 2015
Question

AddLabel not working through API but generated command works from commad prompt.

  • March 3, 2015
  • 1 reply
  • 1054 views

Hi,

I am trying to add label on files but CmdRunner returning null. When I run the command created by com.mks.api.Command on command prompt its adds labels on file.

Code as given below,

public static void addLabel(String username, String password,

String filepath, String label,

String filename, String fileversion) {

Command cmd = new Command("si", "addlabel");

cmd.addOption(new Option("project", filepath + "/project.pj"));

cmd.addOption(new Option("label", label));

cmd.addOption(new Option("revision", fileversion));

cmd.addSelection(filename);

Session session = IntegrationPointFactory.getInstance().

createIntegrationPoint("xxxx.xxxx.com",

6786, true,

4,

12)

.createSession(username, password);

session.setAutoReconnect(true);

CmdRunner cr = session.createCmdRunner();

cr.execute(cmd);

}

Generated Command: si addlabel --project=/abc/xyz/test/project.pj --label="LabelParam1#LabelParam2" --revision=1.2 -- FileName

Please help.

Message was edited by: Gajanan Hole

    1 reply

    ghole1-VisitorAuthor
    1-Visitor
    March 4, 2015

    It's working, it was problem with file name's case sensitiveness. I didn't know that file name is case sensitive.