Interface ContentTypeResolver


  • public interface ContentTypeResolver
    Resolver to determine Content-Type for file attachments.

    Strategy introduced to work around mail providers having problems with this such as geronimo mail jars.

    Note using SUN mail jar have no problem with resolving Content-Type based on file attachments. This resolver is thus only needed to work around mail providers having bugs or when you a new mime type is unknown by the mail provider allowing you to determine it.

    • Method Detail

      • resolveContentType

        String resolveContentType​(String fileName)
        Resolves the mime content-type based on the attachment file name.

        Return null if you cannot resolve a content type or want to rely on the mail provider to resolve it for you.

        The returned value should only be the mime part of the ContentType header, for example: image/jpeg should be returned. Camel will add the remaining ; name=FILENAME.

        Parameters:
        fileName - the attachment file name
        Returns:
        the Content-Type or null to rely on the mail provider