1 | package fr.sii.ogham.email.exception.handler; | |
2 | ||
3 | import static fr.sii.ogham.core.CoreConstants.SERIAL_VERSION_UID; | |
4 | ||
5 | import fr.sii.ogham.core.exception.MessagingException; | |
6 | import fr.sii.ogham.email.attachment.Attachment; | |
7 | ||
8 | /** | |
9 | * Attachments are referenced using a resource path. Therefore the resource must | |
10 | * be resolved and it's content read. This is done using a resource handlers. | |
11 | * | |
12 | * This exception is general and has subclasses to identify the reason why the | |
13 | * attachment resource handling has failed. | |
14 | * | |
15 | * @author Aurélien Baudet | |
16 | * | |
17 | * @see NoAttachmentResourceHandlerException | |
18 | * @see UnresolvableAttachmentResourceHandlerException | |
19 | */ | |
20 | public class AttachmentResourceHandlerException extends MessagingException { | |
21 | private static final long serialVersionUID = SERIAL_VERSION_UID; | |
22 | ||
23 | private final transient Attachment attachment; | |
24 | ||
25 | public AttachmentResourceHandlerException(String message, Attachment attachment, Throwable cause) { | |
26 | super(message, cause); | |
27 | this.attachment = attachment; | |
28 | } | |
29 | ||
30 | public AttachmentResourceHandlerException(String message, Attachment attachment) { | |
31 | super(message); | |
32 | this.attachment = attachment; | |
33 | } | |
34 | ||
35 | public AttachmentResourceHandlerException(Throwable cause, Attachment attachment) { | |
36 | super(cause); | |
37 | this.attachment = attachment; | |
38 | } | |
39 | ||
40 | public Attachment getAttachment() { | |
41 |
1
1. getAttachment : replaced return value with null for fr/sii/ogham/email/exception/handler/AttachmentResourceHandlerException::getAttachment → NO_COVERAGE |
return attachment; |
42 | } | |
43 | } | |
Mutations | ||
41 |
1.1 |