private Attachment convert(final Path source, final ResultsVisitor visitor, final io.qameta.allure.model.Attachment attachment) { final Path attachmentFile = source.resolve(attachment.getSource()); if (Files.isRegularFile(attachmentFile)) { final Attachment found = visitor.visitAttachmentFile(attachmentFile); if (nonNull(attachment.getType())) { found.setType(attachment.getType()); } if (nonNull(attachment.getName())) { found.setName(attachment.getName()); } return found; } else { visitor.error("Could not find attachment " + attachment.getSource() + " in directory " + source); return new Attachment() .setType(attachment.getType()) .setName(attachment.getName()) .setSize(0L); } }
private Attachment convert(final Path source, final ResultsVisitor visitor, final io.qameta.allure.model.Attachment attachment) { final Path attachmentFile = source.resolve(attachment.getSource()); if (Files.isRegularFile(attachmentFile)) { final Attachment found = visitor.visitAttachmentFile(attachmentFile); if (nonNull(attachment.getType())) { found.setType(attachment.getType()); } if (nonNull(attachment.getName())) { found.setName(attachment.getName()); } return found; } else { visitor.error("Could not find attachment " + attachment.getSource() + " in directory " + source); return new Attachment() .setType(attachment.getType()) .setName(attachment.getName()) .setSize(0L); } }