Class PartFactory


  • public class PartFactory
    extends Object
    The PartFactory creates an object that represents a Part (implements the Part interface). There are different ways to represent a part (backing file or backing array etc.). These different implementations should not be exposed to the other layers of the code. The PartFactory helps maintain this abstraction, and makes it easier to add new implementations.
    • Constructor Detail

      • PartFactory

        public PartFactory()
    • Method Detail

      • createPart

        public static Part createPart​(LifecycleManager manager,
                                      MIMEBodyPartInputStream in,
                                      boolean isSOAPPart,
                                      int thresholdSize,
                                      String attachmentDir,
                                      int messageContentLength)
                               throws OMException
        Creates a part from the input stream. The remaining parameters are used to determine if the part should be represented in memory (byte buffers) or backed by a file.
        Parameters:
        in - MIMEBodyPartInputStream
        isSOAPPart -
        thresholdSize -
        attachmentDir -
        messageContentLength -
        Returns:
        Part
        Throws:
        OMException - if any exception is encountered while processing.