Class AbstractAttachment

java.lang.Object
ch.tocco.nice2.messaging.mail.spi.AbstractAttachment
All Implemented Interfaces:
Attachment
Direct Known Subclasses:
AttachmentImpl, BinaryAttachment

public abstract class AbstractAttachment extends Object implements Attachment
  • Field Details

    • id

      protected final String id
    • idGenerated

      protected final boolean idGenerated
    • fileName

      protected String fileName
    • encodedFileName

      protected String encodedFileName
    • description

      protected String description
    • disposition

      protected Attachment.Disposition disposition
    • mimeType

      protected jakarta.activation.MimeType mimeType
  • Constructor Details

    • AbstractAttachment

      public AbstractAttachment(@Nullable @Nullable String id)
  • 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 interface Attachment
    • getId

      public String getId()
      Specified by:
      getId in interface Attachment
    • getFileName

      @Nullable public @Nullable String getFileName()
      Specified by:
      getFileName in interface Attachment
    • setFileName

      public 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. 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 interface Attachment
    • getEncodedFileName

      @Nullable public @Nullable String getEncodedFileName()
      Specified by:
      getEncodedFileName in interface Attachment
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in interface Attachment
    • setDescription

      public void setDescription(String description)
      Specified by:
      setDescription in interface Attachment
    • getMimeType

      public jakarta.activation.MimeType getMimeType()
      Specified by:
      getMimeType in interface Attachment
    • setMimeType

      public void setMimeType(jakarta.activation.MimeType mimeType)
      Specified by:
      setMimeType in interface Attachment
    • getDisposition

      public Attachment.Disposition getDisposition()
      Specified by:
      getDisposition in interface Attachment
    • setDisposition

      public void setDisposition(Attachment.Disposition disposition)
      Specified by:
      setDisposition in interface Attachment
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object