0

i try to implement a Java Application to sync down sandboxes.

Command cmd = new Command( Command.SI, "createsandbox" );
cmd.addOption( new Option( "recurse" ) );
cmd.addOption( new Option( "nopopulate" ) );
cmd.addOption( new Option( "project", ptcProject ) );
cmd.addOption( new Option( "cwd", sandboxDir ) );
api.runCommand( cmd );

With this part of sourcecode I got this Exception.

Sandboxes cannot be created or imported directly on the Integrity Server.

as Input i use for Project

Project: #p=e:/MKSProjects/<unknown>/<unknown>.pj#<subproject>/project.pj
cwd: C:\\Temp\\<notexistingfolder>

What is wrong here? My MKSAPI.jar Version is 4.15

Martin M.
  • 11
  • 2

1 Answers1

0

As @vasilenicusor said, use a LocalIntegrationPoint to create a sandbox on the local machine.

This code works the way you are expecting ...

IntegrationPointFactory ipfact = IntegrationPointFactory.getInstance();

IntegrationPoint ip = ipfact.createLocalIntegrationPoint(APIVersion.API_4_16);

Session session = ip.createNamedSession("test", APIVersion.API_4_16, user, passwd);

CmdRunner cr = session.createCmdRunner();

Command cmd = new Command( Command.SI, "createsandbox" );
cmd.addOption( new Option( "recurse" ) );
cmd.addOption( new Option( "nopopulate" ) );
cmd.addOption( new Option( "project", ptcProject ) );
cmd.addOption( new Option( "cwd", sandboxDir ) );

cr.execute(cmd);

cr.release();

session.release();

ip.release();
David G
  • 3,940
  • 1
  • 22
  • 30