Class AbstractAttachment
java.lang.Object
ch.tocco.nice2.messaging.mail.spi.AbstractAttachment
- All Implemented Interfaces:
Attachment
- Direct Known Subclasses:
AttachmentImpl
,BinaryAttachment
-
Nested Class Summary
Nested classes/interfaces inherited from interface ch.tocco.nice2.messaging.mail.api.Attachment
Attachment.Disposition
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
protected Attachment.Disposition
protected String
protected String
protected final String
protected final boolean
protected jakarta.activation.MimeType
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
@Nullable String
@Nullable String
getId()
jakarta.activation.MimeType
int
hashCode()
boolean
Whether the id is set manually (`true`) or generated automatically (`false`).void
setDescription
(String description) void
setDisposition
(Attachment.Disposition disposition) void
setFileName
(String fileName) The file name will be UTF-8 encoded cause otherwise other characters than specified in the ASCII standard won't be displayed correctly on mail clients.void
setMimeType
(jakarta.activation.MimeType mimeType) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ch.tocco.nice2.messaging.mail.api.Attachment
getContent, loadContent, setContent
-
Field Details
-
id
-
idGenerated
protected final boolean idGenerated -
fileName
-
encodedFileName
-
description
-
disposition
-
mimeType
protected jakarta.activation.MimeType mimeType
-
-
Constructor Details
-
AbstractAttachment
-
-
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
-
getId
- Specified by:
getId
in interfaceAttachment
-
getFileName
- Specified by:
getFileName
in interfaceAttachment
-
setFileName
The file name will be UTF-8 encoded cause otherwise other characters than specified in the ASCII standard won't be displayed correctly on mail clients. Encoding and decoding the file names violates the MIME specification but other big mail clients do the same and therefore also have the ability to decode UTF-8 encoded file names. See also: http://www.oracle.com/technetwork/java/faq-135477.html#encodefilename If the file name has no other characters than specified in the ASCII standard, the encoded file will be equally to the file name.- Specified by:
setFileName
in interfaceAttachment
-
getEncodedFileName
- Specified by:
getEncodedFileName
in interfaceAttachment
-
getDescription
- Specified by:
getDescription
in interfaceAttachment
-
setDescription
- Specified by:
setDescription
in interfaceAttachment
-
getMimeType
public jakarta.activation.MimeType getMimeType()- Specified by:
getMimeType
in interfaceAttachment
-
setMimeType
public void setMimeType(jakarta.activation.MimeType mimeType) - Specified by:
setMimeType
in interfaceAttachment
-
getDisposition
- Specified by:
getDisposition
in interfaceAttachment
-
setDisposition
- Specified by:
setDisposition
in interfaceAttachment
-
equals
-
hashCode
public int hashCode()
-