Created
July 9, 2012 17:56
-
-
Save pjstadig/3077895 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/mail/src/main/java/javax/mail/internet/MimeMultipart.java b/mail/src/main/java/javax/mail/internet/MimeMultipart.java | |
index 58537ef..0278d12 100644 | |
--- a/mail/src/main/java/javax/mail/internet/MimeMultipart.java | |
+++ b/mail/src/main/java/javax/mail/internet/MimeMultipart.java | |
@@ -468,6 +468,10 @@ public class MimeMultipart extends Multipart { | |
los.writeln(boundary + "--"); | |
} | |
+ private boolean getWithSystemDefault(Properties props, String name, boolean df) { | |
+ return PropUtil.getBooleanProperty(props, name, PropUtil.getBooleanSystemProperty(name, df)); | |
+ } | |
+ | |
/** | |
* Parse the InputStream from our DataSource, constructing the | |
* appropriate MimeBodyParts. The <code>parsed</code> flag is | |
@@ -482,22 +486,22 @@ public class MimeMultipart extends Multipart { | |
return; | |
// read properties that control parsing | |
+ | |
+ Properties props = new MessageContext(this.parent).getSession().getProperties(); | |
// default to true | |
- ignoreMissingEndBoundary = PropUtil.getBooleanSystemProperty( | |
- "mail.mime.multipart.ignoremissingendboundary", true); | |
+ ignoreMissingEndBoundary = getWithSystemDefault(props, | |
+ "mail.mime.multipart.ignoremissingendboundary", true); | |
// default to true | |
- ignoreMissingBoundaryParameter = PropUtil.getBooleanSystemProperty( | |
+ ignoreMissingBoundaryParameter = getWithSystemDefault(props, | |
"mail.mime.multipart.ignoremissingboundaryparameter", true); | |
// default to false | |
- ignoreExistingBoundaryParameter = PropUtil.getBooleanSystemProperty( | |
+ ignoreExistingBoundaryParameter = getWithSystemDefault(props, | |
"mail.mime.multipart.ignoreexistingboundaryparameter", false); | |
// default to false | |
- allowEmpty = PropUtil.getBooleanSystemProperty( | |
- "mail.mime.multipart.allowempty", false); | |
+ allowEmpty = getWithSystemDefault(props, "mail.mime.multipart.allowempty", false); | |
// default to true | |
- bmparse = PropUtil.getBooleanSystemProperty( | |
- "mail.mime.multipart.bmparse", true); | |
+ bmparse = getWithSystemDefault(props, "mail.mime.multipart.bmparse", true); | |
if (bmparse) { | |
parsebm(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment