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

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

Highlighted
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

Tags (3)
1 REPLY 1

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

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

Announcements