Class BodypartGeneralText


  • public class BodypartGeneralText
    extends Bodypart
    This class represents a General Text bodypart.

    When creating an instance of this class, you must provide the charset and the content. You must ensure that the content is correct for the charset.

    The charset must be one the ones provided by the class Charset E.g. WEST_EUROPEAN (that maps to "1 6 100")

    • Constructor Detail

      • BodypartGeneralText

        public BodypartGeneralText​(BodyPart bp_obj)
                            throws X400APIException
        Constructor based on an existing bodypart object, for example, one read from an existing message.
        Parameters:
        bp_obj -
        Throws:
        X400APIException
      • BodypartGeneralText

        public BodypartGeneralText​(BodypartGeneralText.Charset cs,
                                   java.lang.String ct)
                            throws X400APIException
        Constructor based on data provided by the user, including the charset and content. For ISO-8895-1 and ISO-8895-2 you can use the constructor BodypartGeneralText(boolean iso1, String ct) specifying true for ISO-8895-1 and false for ISO-8895-2
        Parameters:
        cs -
        ct -
        Throws:
        X400APIException
      • BodypartGeneralText

        public BodypartGeneralText​(java.lang.String charset,
                                   java.lang.String ct)
                            throws X400APIException
        Constructor based on data provided by the user, including the charset and content. For ISO-8895-1 and ISO-8895-2 you can use the constructor BodypartGeneralText(boolean iso1, String ct) specifying true for ISO-8895-1 and false for ISO-8895-2
        Parameters:
        charset -
        ct -
        Throws:
        X400APIException
      • BodypartGeneralText

        public BodypartGeneralText​(java.lang.String charset,
                                   java.lang.String rawContent,
                                   boolean emptyCharset)
                            throws X400APIException
        Constructor based on data provided by the user, including the charset as a String and the raw content as a String. The emptyCharset boolean method indicates if the charset should be set or not
        Parameters:
        charset -
        rawContent -
        emptyCharset -
        Throws:
        X400APIException
      • BodypartGeneralText

        public BodypartGeneralText​(boolean iso_8859_1,
                                   java.lang.String ct)
                            throws X400APIException
        Creates a General Text bodypart, with a content suitable for ISO-8895-1 (if iso_8859_1 is true) or ISO-8895-2 (if iso_8859_1 is false). The advantage of this method is that there's no need to specify the charset.
        Parameters:
        iso_8859_1 -
        ct -
        Throws:
        X400APIException
      • BodypartGeneralText

        public BodypartGeneralText​(java.lang.String fileName,
                                   java.nio.charset.Charset sourceCharacterSet,
                                   java.lang.String isoCharsets)
                            throws X400APIException
        Creates a General Text bodypart which will be encoded using the specified ISO character sets, reading the data for the bodypart from the specified file using the selected encoding.
        Parameters:
        fileName - name of file to read data from
        sourceCharacterSet - identifies the encoding which the input file uses
        isoCharsets - identifies the ISO-2022 character sets to be used by the bodypart
        Throws:
        X400APIException