if(parameter == null){
throw new TracException(MessageUtils.getMessage("core.parameter.not.found", "TicketAttachment", this.getClass().getName()));
}
TicketAttachment ticketAttachment = (TicketAttachment)parameter;
// check for mandatory fields
Integer idTicket = ticketAttachment.getIdTicket();
if(idTicket == 0){
throw new TracException(MessageUtils.getMessage("core.parameter.not.found", "TicketAttachment.idTicket", this.getClass().getName()));
}
String fileName = ticketAttachment.getFilename();
if(fileName == null || fileName.trim().equals("")){
throw new TracException(MessageUtils.getMessage("core.parameter.not.found", "TicketAttachment.fileName", this.getClass().getName()));
}
String description = ticketAttachment.getDescription();
if(description == null) description = "";
String fullFileName = ticketAttachment.getFullFileName();
if(fullFileName == null || fullFileName.trim().equals("")){
throw new TracException(MessageUtils.getMessage("core.parameter.not.found", "TicketAttachment.fullFileName", this.getClass().getName()));
}
byte[] binaryData = Utils.getBinaryData(fullFileName, tracProperties);