Search in sources :

Example 1 with AttachmentType

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;
}
Also used : AttachmentType(net.parostroj.timetable.model.Attachment.AttachmentType) Attachment(net.parostroj.timetable.model.Attachment)

Aggregations

Attachment (net.parostroj.timetable.model.Attachment)1 AttachmentType (net.parostroj.timetable.model.Attachment.AttachmentType)1