Interface Part

  • All Known Implementing Classes:
    PartOnFile, PartOnMemory, PartOnMemoryEnhanced

    public interface Part
    Abstract for Part. A Part can be the SOAP Part or an Attachment Part. There are several implementations for part, which are optimized for space and time. A Part is created with the PartFactory.
    See Also:
    PartFactory
    • Method Detail

      • getDataHandler

        DataHandler getDataHandler()
                            throws javax.mail.MessagingException
        Returns:
        DataHandler representing this part
        Throws:
        javax.mail.MessagingException
      • getSize

        long getSize()
              throws javax.mail.MessagingException
        Returns:
        size
        Throws:
        javax.mail.MessagingException
      • getContentType

        String getContentType()
                       throws javax.mail.MessagingException
        Returns:
        content type of the part
        Throws:
        javax.mail.MessagingException
      • getContentID

        String getContentID()
                     throws javax.mail.MessagingException
        Returns:
        content id of the part
        Throws:
        javax.mail.MessagingException
      • getFileName

        String getFileName()
                    throws javax.mail.MessagingException
        Deprecated.
        The callers should not no how the part is implemented.
        The part may be backed by a file. If that is the case, this method returns the file name.
        Returns:
        the name of the file
        Throws:
        javax.mail.MessagingException
      • getInputStream

        InputStream getInputStream()
                            throws IOException,
                                   javax.mail.MessagingException
        Returns:
        Get the part data as an input stream
        Throws:
        IOException
        javax.mail.MessagingException
      • addHeader

        void addHeader​(String name,
                       String value)
                throws javax.mail.MessagingException
        Add a Header (name, value) to the part
        Parameters:
        name -
        value -
        Throws:
        javax.mail.MessagingException
      • getHeader

        String getHeader​(String name)
                  throws javax.mail.MessagingException
        Get the value of a specific header
        Parameters:
        name -
        Returns:
        value or null
        Throws:
        javax.mail.MessagingException
      • getAllHeaders

        Enumeration getAllHeaders()
                           throws javax.mail.MessagingException
        Returns:
        Enumeration of javax.mail.Header
        Throws:
        javax.mail.MessagingException