我正在尝试从我的 Windows PC 的 linux 服务器上的完整性 PTC 项目中提取附件,但它一直给我错误。完全相同的命令在命令行中工作
IntegrationPoint integrationPoint =
IntegrationPointFactory.getInstance().createIntegrationPoint(
hostName,
port,
APIVersion.API_4_16);
System.out.println("Start download Attachment");
// Start the Integrity client.
integrationPoint.setAutoStartIntegrityClient(true);
// Connect to the Integrity server.
Session session = integrationPoint.createSession(username, password);
Command command = new Command(Command.IM, "extractattachments");
command.addOption(new Option("issue", itemID));
command.addOption(new Option("field", "Text Attachments"));
command.addSelection(attachment);
Response response = session.createCmdRunner().execute(command);
我收到一条错误消息
尝试获取下一个名称时遇到错误:文件路径必须植根于 /export/home/ptc/Integrity/ILMServer11.0/data/tmp:当前文件是 /export/home/ptc/Integrity/ILMServer11.0/bin/ C:\Workspace\document/bear.jpg
每当我将 cwd 添加到命令时,它只会附加我在 /bin/ 之后放置的任何内容,它说它是 InvalidCommandSelectionException 和 CommandException