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
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Attachment.Dispositionprotected Stringprotected Stringprotected final Stringprotected final booleanprotected jakarta.activation.MimeType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean@Nullable String@Nullable StringgetId()jakarta.activation.MimeTypeinthashCode()booleanWhether the id is set manually (`true`) or generated automatically (`false`).voidsetDescription(String description) voidsetDisposition(Attachment.Disposition disposition) voidsetFileName(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.voidsetMimeType(jakarta.activation.MimeType mimeType) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods 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:AttachmentWhether the id is set manually (`true`) or generated automatically (`false`).- Specified by:
isManualIdin interfaceAttachment
-
getId
- Specified by:
getIdin interfaceAttachment
-
getFileName
- Specified by:
getFileNamein 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:
setFileNamein interfaceAttachment
-
getEncodedFileName
- Specified by:
getEncodedFileNamein interfaceAttachment
-
getDescription
- Specified by:
getDescriptionin interfaceAttachment
-
setDescription
- Specified by:
setDescriptionin interfaceAttachment
-
getMimeType
public jakarta.activation.MimeType getMimeType()- Specified by:
getMimeTypein interfaceAttachment
-
setMimeType
public void setMimeType(jakarta.activation.MimeType mimeType) - Specified by:
setMimeTypein interfaceAttachment
-
getDisposition
- Specified by:
getDispositionin interfaceAttachment
-
setDisposition
- Specified by:
setDispositionin interfaceAttachment
-
equals
-
hashCode
public int hashCode()
-