Class MimeBodyPartDataSource
java.lang.Object
com.atlassian.confluence.mail.embed.MimeBodyPartDataSource
- All Implemented Interfaces:
javax.activation.DataSource
DataSource decorator that custom-URL-encodes the name for use with a MimeBodyPart.
-
Constructor Details
-
MimeBodyPartDataSource
public MimeBodyPartDataSource(javax.activation.DataSource source)
-
-
Method Details
-
getName
- Specified by:
getName
in interfacejavax.activation.DataSource
-
getInputStream
- Specified by:
getInputStream
in interfacejavax.activation.DataSource
- Throws:
IOException
-
getOutputStream
- Specified by:
getOutputStream
in interfacejavax.activation.DataSource
- Throws:
IOException
-
getContentType
- Specified by:
getContentType
in interfacejavax.activation.DataSource
-
getWrappedSource
public javax.activation.DataSource getWrappedSource() -
encode
Plugin datasources often include : as a separator, e.g. plugin.name:module.key:resource.key. These strings need escaping before they can be used in MIME part headers. 1. However, plugin keys may include other characters not permitted in URLs, so we must do a URL encode. 2. However, per a few RFCs out there, escaped URLs are not expected in Content-Disposition and Content-Type filenames and names (resp.) so we replace the encoded bits and assume that nothing will conflict.
-