Class BinaryAttachment
java.lang.Object
ch.tocco.nice2.messaging.mail.spi.AbstractAttachment
ch.tocco.nice2.messaging.mail.spi.BinaryAttachment
- All Implemented Interfaces:
Attachment
A special attachment class that holds the content as a `Binary` value
to avoid copying the data multiple times.
-
Nested Class Summary
Nested classes/interfaces inherited from interface ch.tocco.nice2.messaging.mail.api.Attachment
Attachment.Disposition -
Field Summary
Fields inherited from class ch.tocco.nice2.messaging.mail.spi.AbstractAttachment
description, disposition, encodedFileName, fileName, id, idGenerated, mimeType -
Constructor Summary
ConstructorsConstructorDescriptionBinaryAttachment(@Nullable String id, @Nullable String fileName, Binary binary) -
Method Summary
Modifier and TypeMethodDescriptionclone()booleanbyte[]jakarta.activation.MimeTypeinthashCode()booleanWhether the id is set manually (`true`) or generated automatically (`false`).voidloadContent(InputStream input) voidvoidsetContent(byte[] content) voidsetMimeType(jakarta.activation.MimeType mimeType) Methods inherited from class ch.tocco.nice2.messaging.mail.spi.AbstractAttachment
getDescription, getDisposition, getEncodedFileName, getFileName, getId, setDescription, setDisposition, setFileName
-
Constructor Details
-
BinaryAttachment
-
-
Method Details
-
isManualId
public boolean isManualId()Description copied from interface:AttachmentWhether the id is set manually (`true`) or generated automatically (`false`).- Specified by:
isManualIdin interfaceAttachment- Overrides:
isManualIdin classAbstractAttachment
-
getMimeType
public jakarta.activation.MimeType getMimeType()- Specified by:
getMimeTypein interfaceAttachment- Overrides:
getMimeTypein classAbstractAttachment
-
setMimeType
public void setMimeType(jakarta.activation.MimeType mimeType) - Specified by:
setMimeTypein interfaceAttachment- Overrides:
setMimeTypein classAbstractAttachment
-
getBinary
-
setBinary
-
getContent
public byte[] getContent() -
setContent
public void setContent(byte[] content) -
loadContent
- Throws:
IOException
-
equals
- Overrides:
equalsin classAbstractAttachment
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractAttachment
-
clone
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-