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
ConstructorDescriptionBinaryAttachment
(@Nullable String id, @Nullable String fileName, Binary binary) -
Method Summary
Modifier and TypeMethodDescriptionclone()
boolean
byte[]
jakarta.activation.MimeType
int
hashCode()
boolean
Whether the id is set manually (`true`) or generated automatically (`false`).void
loadContent
(InputStream input) void
void
setContent
(byte[] content) void
setMimeType
(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:Attachment
Whether the id is set manually (`true`) or generated automatically (`false`).- Specified by:
isManualId
in interfaceAttachment
- Overrides:
isManualId
in classAbstractAttachment
-
getMimeType
public jakarta.activation.MimeType getMimeType()- Specified by:
getMimeType
in interfaceAttachment
- Overrides:
getMimeType
in classAbstractAttachment
-
setMimeType
public void setMimeType(jakarta.activation.MimeType mimeType) - Specified by:
setMimeType
in interfaceAttachment
- Overrides:
setMimeType
in classAbstractAttachment
-
getBinary
-
setBinary
-
getContent
public byte[] getContent() -
setContent
public void setContent(byte[] content) -
loadContent
- Throws:
IOException
-
equals
- Overrides:
equals
in classAbstractAttachment
-
hashCode
public int hashCode()- Overrides:
hashCode
in classAbstractAttachment
-
clone
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-