cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

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

ghole
1-Newbie

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

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 1
ghole
1-Newbie
(To:ghole)

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

Top Tags