MCPcopy Create free account
hub / github.com/M66B/FairEmail / MimeBodyPart

Class MimeBodyPart

app/src/main/java/javax/mail/internet/MimeBodyPart.java:62–1714  ·  view source on GitHub ↗

This class represents a MIME body part. It implements the BodyPart abstract class and the MimePart interface. MimeBodyParts are contained in MimeMultipart objects. MimeBodyPart uses the InternetHeaders class to parse and store the headers of t

Source from the content-addressed store, hash-verified

60 */
61
62public class MimeBodyPart extends BodyPart implements MimePart {
63
64 // Paranoia:
65 // allow this last minute change to be disabled if it causes problems
66 private static final boolean setDefaultTextCharset =
67 PropUtil.getBooleanSystemProperty(
68 "mail.mime.setdefaulttextcharset", true);
69
70 private static final boolean setContentTypeFileName =
71 PropUtil.getBooleanSystemProperty(
72 "mail.mime.setcontenttypefilename", true);
73
74 private static final boolean encodeFileName =
75 PropUtil.getBooleanSystemProperty("mail.mime.encodefilename", false);
76 private static final boolean decodeFileName =
77 PropUtil.getBooleanSystemProperty("mail.mime.decodefilename", false);
78 private static final boolean ignoreMultipartEncoding =
79 PropUtil.getBooleanSystemProperty(
80 "mail.mime.ignoremultipartencoding", true);
81 //private static final boolean allowutf8 =
82 //PropUtil.getBooleanSystemProperty("mail.mime.allowutf8", true);
83
84 // Paranoia:
85 // allow this last minute change to be disabled if it causes problems
86 static final boolean cacheMultipart = // accessed by MimeMessage
87 PropUtil.getBooleanSystemProperty("mail.mime.cachemultipart", true);
88
89
90 /**
91 * The DataHandler object representing this Part's content.
92 */
93 protected DataHandler dh;
94
95 /**
96 * Byte array that holds the bytes of the content of this Part.
97 */
98 protected byte[] content;
99
100 /**
101 * If the data for this body part was supplied by an
102 * InputStream that implements the SharedInputStream interface,
103 * <code>contentStream</code> is another such stream representing
104 * the content of this body part. In this case, <code>content</code>
105 * will be null.
106 *
107 * @since JavaMail 1.2
108 */
109 protected InputStream contentStream;
110
111 /**
112 * The InternetHeaders object that stores all the headers
113 * of this body part.
114 */
115 protected InternetHeaders headers;
116
117 /**
118 * If our content is a Multipart of Message object, we save it
119 * the first time it's created by parsing a stream so that changes

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected