/** * Method used to map an <code>BaseFileTransferMappedRecord</code> object to a * <code>Payload</code> object. * * @param record The record as returned from the File Transfer Client * @return A payload constructed from the record. */ public static Payload mappedRecordToPayload(BaseFileTransferMappedRecord record) { Date createdDayTime = record.getCreatedDayTime(); //calculate a payload id based on the filename and created date int id = createdDayTime.hashCode(); id = (37 * id) + (record.getName()).hashCode(); Payload payload = payloadFactory.newPayload(""+id, record.getContent()); payload.setAttribute(FilePayloadAttributeNames.FILE_NAME, record.getName()); // Don't set the Checksum, the client doesn't calculate checksum as the payload does it // Don't set the name return payload; }