String fileType,
String content
)
throws TestLinkAPIException
{
Attachment attachment = null;
Integer id = 0;
attachment = new Attachment(
id,
reqSpecId,
TestLinkTables.reqSpecs.toString(),
title,
description,
fileName,
null,
fileType,
content
);
try
{
Map<String, Object> executionData = Util.getRequirementSpecificatoinAttachmentMap(attachment);
Object response = this.executeXmlRpcCall(
TestLinkMethods.uploadRequirementSpecificationAttachment.toString(), executionData);
Map<String, Object> responseMap = (Map<String, Object>)response;
id = Util.getInteger(responseMap, TestLinkResponseParams.id.toString());
attachment.setId(id);
}
catch ( XmlRpcException xmlrpcex )
{
throw new TestLinkAPIException(
"Error uploading attachment for requirement specification: " + xmlrpcex.getMessage(), xmlrpcex);