use of net.parostroj.timetable.model.Attachment.AttachmentType in project grafikon by jub77.
the class FileLoadSaveAttachments method getAttachment.
private Attachment getAttachment(Pair<LSAttachment, OutputTemplate> pair, byte[] bytes) {
AttachmentType type = AttachmentType.valueOf(pair.first.getType());
Attachment attachment = null;
if (type == AttachmentType.BINARY) {
attachment = new Attachment(pair.first.getName(), bytes);
} else {
String text = new String(bytes, TEXT_ENCODING);
attachment = new Attachment(pair.first.getName(), text);
}
return attachment;
}
Aggregations