* @param content
* @return
*/
protected Attachment uploadTestCaseAttachment(Integer testCaseId, String title, String description,
String fileName, String fileType, String content) throws TestLinkAPIException {
Attachment attachment = null;
Integer id = 0;
attachment = new Attachment(id, testCaseId, TestLinkTables.NODES_HIERARCHY.toString(), title, description,
fileName, null, fileType, content);
try {
Map<String, Object> executionData = Util.getTestCaseAttachmentMap(attachment);
Object response = this.executeXmlRpcCall(TestLinkMethods.UPLOAD_TEST_CASE_ATTACHMENT.toString(),
executionData);
Map<String, Object> responseMap = Util.castToMap(response);
id = Util.getInteger(responseMap, TestLinkResponseParams.ID.toString());
attachment.setId(id);
} catch (XmlRpcException xmlrpcex) {
throw new TestLinkAPIException("Error uploading attachment for test case: " + xmlrpcex.getMessage(),
xmlrpcex);
}