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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

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

ghole
1-Visitor

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

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

Announcements


Top Tags