Class handler_base

  • All Implemented Interfaces:
    jakarta.activation.DataContentHandler
    Direct Known Subclasses:
    image_gif, message_rfc822, multipart_mixed, text_plain

    public abstract class handler_base
    extends Object
    implements jakarta.activation.DataContentHandler
    Base class for other DataContentHandlers.
    • Constructor Summary

      Constructors 
      Constructor Description
      handler_base()  
    • Constructor Detail

      • handler_base

        public handler_base()
    • Method Detail

      • getDataFlavors

        protected abstract jakarta.activation.ActivationDataFlavor[] getDataFlavors()
        Return an array of ActivationDataFlavors that we support. Usually there will be only one.
        Returns:
        array of ActivationDataFlavors that we support
      • getData

        protected Object getData​(jakarta.activation.ActivationDataFlavor aFlavor,
                                 jakarta.activation.DataSource ds)
                          throws IOException
        Given the flavor that matched, return the appropriate type of object. Usually there's only one flavor so just call getContent.
        Parameters:
        aFlavor - the ActivationDataFlavor
        ds - DataSource containing the data
        Returns:
        the object
        Throws:
        IOException - for errors reading the data
      • getTransferDataFlavors

        public jakarta.activation.ActivationDataFlavor[] getTransferDataFlavors()
        Return the ActivationDataFlavors for this DataContentHandler.
        Specified by:
        getTransferDataFlavors in interface jakarta.activation.DataContentHandler
        Returns:
        The ActivationDataFlavors
      • getTransferData

        public Object getTransferData​(jakarta.activation.ActivationDataFlavor df,
                                      jakarta.activation.DataSource ds)
                               throws IOException
        Return the Transfer Data of type ActivationDataFlavor from InputStream.
        Specified by:
        getTransferData in interface jakarta.activation.DataContentHandler
        Parameters:
        df - The ActivationDataFlavor
        ds - The DataSource corresponding to the data
        Returns:
        the object
        Throws:
        IOException - for errors reading the data