Class DefaultAttachment

    • Constructor Detail

      • DefaultAttachment

        public DefaultAttachment​(DataHandler dh)
      • DefaultAttachment

        public DefaultAttachment​(DataSource ds)
    • Method Detail

      • getDataHandler

        public DataHandler getDataHandler()
        Description copied from interface: Attachment
        Return a DataHandler for the content within this attachment.
        Specified by:
        getDataHandler in interface Attachment
        Returns:
        DataHandler for the content
      • getHeader

        public String getHeader​(String name)
        Description copied from interface: Attachment
        Get all the headers for this header name. Returns null if no headers for this header name are available.
        Specified by:
        getHeader in interface Attachment
        Parameters:
        name - he name of this header
        Returns:
        a comma separated list of all header values
      • getHeaderAsList

        public List<String> getHeaderAsList​(String name)
        Description copied from interface: Attachment
        Get all the headers for this header name. Returns null if no headers for this header name are available.
        Specified by:
        getHeaderAsList in interface Attachment
        Parameters:
        name - The name of this header
        Returns:
        a list of all header values
      • addHeader

        public void addHeader​(String headerName,
                              String headerValue)
        Description copied from interface: Attachment
        Add this value to the existing values for this headerName.
        Specified by:
        addHeader in interface Attachment
        Parameters:
        headerName - the name of this header
        headerValue - the value for this header
      • setHeader

        public void setHeader​(String headerName,
                              String headerValue)
        Description copied from interface: Attachment
        Set the value for this headerName. Replaces all existing header values with this new value.
        Specified by:
        setHeader in interface Attachment
        Parameters:
        headerName - the name of this header
        headerValue - the value for this header
      • removeHeader

        public void removeHeader​(String headerName)
        Description copied from interface: Attachment
        Remove all headers with this name.
        Specified by:
        removeHeader in interface Attachment
        Parameters:
        headerName - the name of this header
      • clearHeaders

        public void clearHeaders()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object